home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / os / mswindo / programm / misc / 4216 < prev    next >
Encoding:
Text File  |  1992-12-14  |  1.6 KB  |  51 lines

  1. Newsgroups: comp.os.ms-windows.programmer.misc
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!cs.utexas.edu!torn!nott!emr1!jagrant
  3. From: jagrant@emr1.emr.ca (John Grant)
  4. Subject: Re: Novice programmer question
  5. Message-ID: <1992Dec15.011318.29494@emr1.emr.ca>
  6. Organization: Energy, Mines, and Resources, Ottawa
  7. References: <1992Dec13.204238.8073@ucsu.Colorado.EDU> <710@lax.lax.pe-nelson.com>
  8. Distribution: usa
  9. Date: Tue, 15 Dec 1992 01:13:18 GMT
  10. Lines: 39
  11.  
  12. In article <710@lax.lax.pe-nelson.com> twbrown@PE-Nelson.COM (Tom W. Brown) writes:
  13. >In article <1992Dec13.204238.8073@ucsu.Colorado.EDU>, tylerd@rintintin.Colorado.EDU (TYLER DAVID CHARLES) writes:
  14. >|> I'll make this brief:
  15. >|> Why doesn't the following work?
  16. >|> 
  17. >|>   if (!hPrevInstance)
  18. >|>   {
  19. >|>     [normal stuff]
  20. >|>   }
  21. >|>   else
  22. >|>   //
  23. >|>   // If an instance is already running, just display it.
  24. >|>   //
  25. >|>   {
  26. >|>     if (IsIconic (hPrevInstance))
  27. >|>     {
  28. >|>       OpenIcon (hPrevInstance);
  29. >|>     }
  30. >|>     BringWindowToTop (hPrevInstance);
  31. >|>     return TRUE;                      // Or should this be FALSE?
  32. >|>   }
  33. >
  34. >The routines IsIconic(), OpenIcon(), and BringWindowToTop() need window
  35. >handles, not instance handles.
  36.     [...stuff deleted...]
  37.  
  38.     Note: this is the classic case of a handle mismatch.  If you
  39.     use #define STRICT when compiling, the compiler will catch
  40.     things like this.  All of these things are just UINT without
  41.     STRICT, but with STRICT, they become pointers to various
  42.     structs.
  43.  
  44.         #define STRICT        //USE IT!!!!!
  45.         #include <windows.h>
  46.  
  47. -- 
  48. John A. Grant                        jagrant@emr1.emr.ca
  49. Airborne Geophysics
  50. Geological Survey of Canada, Ottawa
  51.