home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 10 / 10.iso / l / l430 / 1.ddi / WINIOBC.ZIP / WMHANDLR.H < prev   
Encoding:
C/C++ Source or Header  |  1992-06-09  |  2.0 KB  |  68 lines

  1. /*
  2. WMHANDLR.H
  3. Event (WM_ message) handlers - interface
  4. Part of the WINIO Library
  5.  
  6. from "Undocumented Windows" (Addison-Wesley, 1992)
  7. by Andrew Schulman, Dave Maxey and Matt Pietrek.
  8.  
  9. Copyright (c) Dave Maxey and Andrew Schulman 1991-1992. All rights reserved.
  10. */
  11.  
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15.  
  16. #define MAX_EXTRA_WMS        16
  17.  
  18. typedef long (* WMHANDLER)(HWND, unsigned, WORD, LONG);
  19. typedef WMHANDLER    WMHANDLERTABLE[WM_USER + MAX_EXTRA_WMS];
  20. typedef struct {
  21.     WMHANDLERTABLE    wmhandlertable;
  22.     WORD            wExtraMsg[MAX_EXTRA_WMS];
  23.     } WMHANDLERDATA, FAR * WMTAB;
  24.  
  25. // This structure is pointed at by the lParam of the WM_CREATE. The
  26. // wmTab field is the handler table for the new window, the lpdata
  27. // is for any other data the app needs to store with the window. The
  28. // window class must allow for at least 8 window extra bytes.
  29. typedef struct {
  30.     WMTAB wmTab;
  31.     LPVOID lpData;
  32.     } CREATEPARAMS, FAR * LPCREATEPARAMS;
  33.     
  34.  
  35. /* The generic window procedure - invokes the appropriate
  36.     message handler */
  37. long FAR PASCAL _export wmhandler_wndproc(HWND, WORD, WORD, LONG);
  38.  
  39. /* wmhandler_get returns current handler for an event for a window */
  40. WMHANDLER wmhandler_get(HWND hWnd, WORD wMessage);
  41.  
  42. /* wmhandler_set also returns current handler, and then
  43.    makes the supplied handler current for the message type for the
  44.    specified window (the ...tab version operates on a known WMTAB) */
  45. WMHANDLER wmhandler_set(HWND, WORD, WMHANDLER);
  46. WMHANDLER wmhandler_settab(WMTAB, WORD, WMHANDLER);
  47.  
  48. /* optional function to create an invisible "object window" to
  49.    be used as a recipient for events */
  50. HWND wmhandler_hwnd(char *name);
  51.  
  52. /* Allocate and initialize a new WM_ handler table */
  53. WMTAB wmhandler_create(void);
  54.  
  55. /* Free (destroy) a previously created WM_ handler table */
  56. void wmhandler_destroy(HWND);
  57.  
  58. /* Check for, receive, and dispatch messages */
  59. void wmhandler_yield(void);
  60.  
  61. /* An application's main event loop */
  62. void wmhandler_mainloop(void);
  63.  
  64. #ifdef __cplusplus
  65. }
  66. #endif
  67.  
  68.