Page 1 of 1

Does WM_DEACTIVATE exists? Application deactivated?

Posted: Fri Oct 14, 2011 5:27 pm
by MrAksel
First of all this is in the C++ section, i do not want any VB or C# answers.
Im looking for the opposite of WM_ACTIVATE, because i want my program to stop updating some stuff that uses a lot of CPU when its deactivated. I have the WM_ACTIVATE to start updating, but i need a notification similar to WM_DEACTIVATE. Does that even exists? Or is there another way? I couldn't find any help on Google.

Re: Does WM_DEACTIVATE exists? Application deactivated?

Posted: Fri Oct 14, 2011 5:37 pm
by Axel
What do you want to do ?

Re: Does WM_DEACTIVATE exists? Application deactivated?

Posted: Fri Oct 14, 2011 7:33 pm
by MrAksel
In my WndProc, i want to see if the message is the message that is sent when a window is deactivated. The WM_ACTIVATE message is sent when you activate the window, i would like to know if there was a similar WM_DEACTIVATE that is sent when the window is deactivated

Re: Does WM_DEACTIVATE exists? Application deactivated?

Posted: Fri Oct 14, 2011 8:37 pm
by Axel
If you mean hidden/shown with activated then you should take a look at WM_SHOWWINDOW Please don't talk in such a "wannabe pro" language I'm kinda gettin mad of it lol

Re: Does WM_DEACTIVATE exists? Application deactivated?

Posted: Fri Oct 14, 2011 11:26 pm
by mandai
For such "wannabe pro" language you should be able to see that hiding windows is not what is being asked here.

When a window is deactivated, a WM_ACTIVATE message is actually sent to both windows indicating each windows' status and the target/source window handles.

Are you using managed or unmanaged C++ code?

Here is some more documentation: http://msdn.microsoft.com/en-us/library ... S.85).aspx

Re: Does WM_DEACTIVATE exists? Application deactivated?

Posted: Sat Oct 15, 2011 9:18 am
by MrAksel
I'm using unmanaged C++. If I used managed it would probably be much easier, but it depends on the .NET Framework. Thx for the link, I first tried WM_KILLFOCUS but that only fired when it lost keyboard focus, now it works perfect :D