Re: Win32Lib & Multi-open programs
- Posted by Brian Broker <bkb at CNW.COM> Jan 14, 2001
- 423 views
On Sat, 13 Jan 2001 21:57:56 -0500, Euman wrote: >Hello > > I certainly hope someone can explain why / how >to find out if MYPROG has been task-switched out >for another program. (covered up) > >I need this info to redisplay certain info in MYPROG >if and when MYPROG comes back into FOCUS (visible) > >onLostFocus( ) -- doesnt tell me when another program > -- is on top > >onGotFocus -- NO > >I have tried many times w/ many commands to do this. > >onMouse and testing to see if mouse is not within Window >only works part of the time. > >TIA >euman at bellsouth.net Euman, onLostFocus should tell you when your program has lost focus, which should be all you need to know (i.e. just assume another program is on top.) If you are using controls defined by Win32Lib, then you shouldn't need to worry about updating them, Windows will do that for you. If you are not using a label and using something like wPrintf to write to your window and you are worried about another window erasing your text, then you should be using your onPaint() routine to remedy the problem. It is a good practice to use a double buffering technique using a pixmap if your onPaint routine gets too big. My RGBview.exw program included with Wolf's Win32Lib tutorials demonstrates this technique. If I am misunderstanding your problem, please send me an example and I will do my best to help. -- Brian