home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / os / os2 / programm / 3826 < prev    next >
Encoding:
Internet Message Format  |  1992-07-27  |  1.5 KB

  1. Path: sparky!uunet!usc!sdd.hp.com!uakari.primate.wisc.edu!usenet.coe.montana.edu!news.u.washington.edu!uw-beaver!lynx.cs.washington.edu!andrewb
  2. From: andrewb@lynx.cs.washington.edu (Andrew Berg)
  3. Newsgroups: comp.os.os2.programmer
  4. Subject: Re: Button Press..HELP!!!!
  5. Message-ID: <1992Jul28.035952.27328@beaver.cs.washington.edu>
  6. Date: 28 Jul 92 03:59:52 GMT
  7. References: <1992Jul22.020524.17316@panix.com>
  8. Sender: news@beaver.cs.washington.edu (USENET News System)
  9. Organization: Computer Science & Engineering Dept., Univ. of Washington, Seattle
  10. Lines: 26
  11. X-Newsreader: Tin 1.1 PL3
  12.  
  13. In C/Set there is a macro that casts from &msg to a *_COMMANDMSG structure.
  14. A version that works with GCC is as follows:
  15.  
  16. /* pmgnu.h - macros not found in the distribution */
  17. typedef struct __COMMANDMSG {
  18.     USHORT msg;    /* the WM_COMMAND msg */
  19.     USHORT fill1;    /* args are 32 bit aligned */
  20.     USHORT cmd;    /* the subcommand */
  21. } _COMMANDMSG, *_pCOMMANDMSG;
  22. #define COMMANDMSG( msg )  ((_pCOMMANDMSG) (msg))
  23.  
  24. typedef struct __CHARMSG {
  25.     USHORT msg;    /* the WM_CHAR msg */
  26.     USHORT fill1;    /* allingment */
  27.     USHORT fs;    /* the modifier flags (is Vkey, isCTRL, etc... ) */
  28.     USHORT fill2;     /* never saw this */
  29.     USHORT chr;    /* the keycode */
  30.     USHORT vkey;    /* the virtual keycode */
  31. } _CHARMSG, *_pCHARMSG;
  32. #define CHARMSG( msg )  ((_pCHARMSG) (msg))
  33.  
  34. /* also you may find it usefull to define */
  35. #define CALLBACK EXPENTRY
  36.  
  37. I got this code from 'urbas@RZ-Berlin.MPG.DE', so if you use it, you might
  38. drop a note and thank him.  He did the hard work
  39.