{ Learn Code. Share Code. Teach Code. Love Code. }

  • Does WM_DEACTIVATE exists? Application deactivated?

  • Post your questions regarding programming in C++ in here.
Post your questions regarding programming in C++ in here.
 #55609  by MrAksel
 Fri Oct 14, 2011 5:27 pm
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.
 #55618  by MrAksel
 Fri Oct 14, 2011 7:33 pm
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
 #55635  by mandai
 Fri Oct 14, 2011 11:26 pm
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
 #55667  by MrAksel
 Sat Oct 15, 2011 9:18 am
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