home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c480 / 20.ddi / SAMPLES / MAKEAPP / CLIENT.H_ / CLIENT.H
Encoding:
C/C++ Source or Header  |  1993-02-08  |  1.5 KB  |  56 lines

  1. // Client window class declarations
  2. //
  3. #ifndef _INC_CLIENT
  4. #define _INC_CLIENT
  5.  
  6. // Public declarations
  7.  
  8. BOOL Client_Initialize(APP* papp);
  9. void Client_Terminate(APP* papp, int codeTerm);
  10.  
  11. HWND Client_CreateWindow(HWND hwndParent, int x, int y, int cx, int cy, BOOL fVisible, COLORREF clrText, LPCSTR lpszText);
  12.  
  13. // Private declarations
  14.  
  15. // Window procedure
  16.  
  17. LRESULT CALLBACK _export Client_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
  18.  
  19. // Default message handler
  20.  
  21. #define Client_DefProc  DefWindowProc
  22.  
  23. // Instance data structure
  24.  
  25. typedef struct tagCLIENT
  26. {
  27.     HWND hwnd;
  28.     COLORREF clrText;
  29.     LPCSTR lpszText;
  30. } CLIENT;
  31.  
  32. // Instance data pointer access functions
  33.  
  34. #if defined(M_I86SM) || defined(M_I86MM) || defined(__SMALL__) || defined(__MEDIUM__)
  35. #define Client_GetPtr(hwnd)         (CLIENT*)GetWindowWord((hwnd), 0)
  36. #define Client_SetPtr(hwnd, pcli)   (CLIENT*)SetWindowWord((hwnd), 0, (WORD)(pcli))
  37. #else
  38. #define Client_GetPtr(hwnd)         (CLIENT*)GetWindowLong((hwnd), 0)
  39. #define Client_SetPtr(hwnd, pcli)   (CLIENT*)SetWindowLong((hwnd), 0, (LONG)(pcli))
  40. #endif
  41.  
  42. // Message handler functions
  43.  
  44. BOOL Client_OnCreate(CLIENT* pcli, CREATESTRUCT FAR* lpCreateStruct);
  45. void Client_OnDestroy(CLIENT* pcli);
  46.  
  47. void Client_OnPaint(CLIENT* pcli);
  48. BOOL Client_OnEraseBkgnd(CLIENT* pcli, HDC hdc);
  49.  
  50. BOOL Client_OnQueryEndSession(CLIENT* pcli);
  51. void Client_OnEndSession(CLIENT* pcli, BOOL fEnding);
  52.  
  53. void Client_OnCommand(CLIENT* pcli, int id, HWND hwndCtl, UINT codeNotify);
  54.  
  55. #endif  // !_INC_CLIENT
  56.