The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: Mark Jones on February 08, 2005, 12:08:36 AM

Title: Is there a WM_ message which...
Post by: Mark Jones on February 08, 2005, 12:08:36 AM
Hi, is there a WM_? message which triggers only once, AFTER the window is drawn?

There is WM_ENTERIDLE, but this sounds like it would be called continuously. Is conditionals the only answer?

TIA. :)
Title: Re: Is there a WM_ message which...
Post by: Biterider on February 08, 2005, 07:05:47 AM
Hi Mark,
I way to do what you want is to intercept (subclassing) the WM_PAINT. Once you have done it, execute the default drawing code (DefWndProc) and then your own code, returning the the value given by the default code.

Regards,

Biterider
Title: Re: Is there a WM_ message which...
Post by: sluggy on February 08, 2005, 08:25:25 AM
What you need is WM_CREATE. As mentioned by MSDN here (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/windows/windowreference/windowmessages/wm_create.asp), this message is sent *after* the window is created, but *before* it is visible. This is when you normally create child windows. If you want control before the window is created, look for the WM_NCCREATE message.
Title: Re: Is there a WM_ message which...
Post by: Relvinian on February 08, 2005, 04:10:09 PM
Quote from: Mark Jones on February 08, 2005, 12:08:36 AM
Hi, is there a WM_? message which triggers only once, AFTER the window is drawn?

There is WM_ENTERIDLE, but this sounds like it would be called continuously. Is conditionals the only answer?

TIA. :)

There is no specific message which is sent only ONCE after a window has been painted. There are other messages you can use (WM_SHOWWINDOW, WM_ACTIVATE, etc) to process during limited conditions of the window. If you only want to process a message ONCE AFTER the window is VISIBLE, then the best method is to POST yourself a message to your windows/ctrl in the WM_CREATE handler.

Relvinian
Title: Re: Is there a WM_ message which...
Post by: Mark Jones on February 08, 2005, 04:59:40 PM
Cool, thanks.  :U