🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.os.ms-windows.programmer.misc
Article #1770

Re: Novice programmer question

#1770
From: John Grant
Date: Tue, 15 Dec 1992 01:13
39 lines
1687 bytes
In article <710@lax.lax.pe-nelson.com> twbrown@PE-Nelson.COM (Tom W. Brown) writes:
>In article <1992Dec13.204238.8073@ucsu.Colorado.EDU>, tylerd@rintintin.Colorado.EDU (TYLER DAVID CHARLES) writes:
>|> I'll make this brief:
>|> Why doesn't the following work?
>|> 
>|>   if (!hPrevInstance)
>|>   {
>|>     [normal stuff]
>|>   }
>|>   else
>|>   //
>|>   // If an instance is already running, just display it.
>|>   //
>|>   {
>|>     if (IsIconic (hPrevInstance))
>|>     {
>|>       OpenIcon (hPrevInstance);
>|>     }
>|>     BringWindowToTop (hPrevInstance);
>|>     return TRUE;                      // Or should this be FALSE?
>|>   }
>
>The routines IsIconic(), OpenIcon(), and BringWindowToTop() need window
>handles, not instance handles.
	[...stuff deleted...]

	Note: this is the classic case of a handle mismatch.  If you
	use #define STRICT when compiling, the compiler will catch
	things like this.  All of these things are just UINT without
	STRICT, but with STRICT, they become pointers to various
	structs.

		#define STRICT		//USE IT!!!!!
		#include <windows.h>

-- 
John A. Grant						jagrant@emr1.emr.ca
Airborne Geophysics
Geological Survey of Canada, Ottawa
Technical Details
Message-ID: <1992Dec15.011318.29494@emr1.emr.ca>
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cs.utexas.edu!torn!nott!emr1!jagrant
References: <1992Dec13.204238.8073@ucsu.Colorado.EDU> <710@lax.lax.pe-nelson.com>

Show Full Headers
Complete Article Headers
Newsgroups: comp.os.ms-windows.programmer.misc
Path: arc1-ca.pugleaf.net!sparky!uunet!zaphod.mps.ohio-state.edu!cs.utexas.edu!torn!nott!emr1!jagrant
From: jagrant@emr1.emr.ca (John Grant)
Subject: Re: Novice programmer question
Message-ID: <1992Dec15.011318.29494@emr1.emr.ca>
Organization: Energy, Mines, and Resources, Ottawa
References: <1992Dec13.204238.8073@ucsu.Colorado.EDU> <710@lax.lax.pe-nelson.com>
Distribution: usa
Date: Tue, 15 Dec 1992 01:13:18 GMT
Lines: 39