The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: dedndave on May 07, 2011, 12:22:56 PM

Title: WndProc Messages at Startup
Post by: dedndave on May 07, 2011, 12:22:56 PM
i was playing around - somemore   :P
i wanted to make sure that certain parts of my code are not executed until the init stages have completed
for example, i don't want to handle WM_SIZE messages until the variables are in place to do so

i modified my WndProc to record messages in a buffer up to the point that the message loop executes
once the message loop starts, it stops recording and dumps the result to the display

the result is interesting...

(http://www.masm32.com/board/index.php?action=dlattach;topic=16633.0;id=9245)

hWin is the main client
hTxt is a child window (there are 6 child windows, in all)
i inserted buffer entries at the beginning and end of the WM_CREATE code for the main window (all 0's)
the last message listed is the first message dispatched by the message loop
of course, the results would vary a little from OS to OS   :wink
i am using XP MCE2005 SP3

the attachment is the above PNG image renamed to ZIP
Title: Re: WndProc Messages at Startup
Post by: Slugsnack on May 09, 2011, 08:11:28 AM
Most of those are expected. WM_NULL though.. haha
Title: Re: WndProc Messages at Startup
Post by: dedndave on May 09, 2011, 11:22:42 AM
i added all WM_NULL messages to the buffer to verify where i was at   :P

the first one, with handle = 0, is inserted into the buffer at the beginning of my WM_CREATE code
the second one, with handle = 0, is inserted into the buffer at the end of my WM_CREATE code
the third one, with handle = hWin, is inserted by using SendMessage, just before the message loop starts
the last message in the list (WM_GETICON) is the first message dispatched by the message loop
after that, buffer "recording" stops, and the results are displayed

when i made that test program, i was using the same WndProc for both hWin and hTxt
since then, i have split them up - it makes for cleaner code
Title: Re: WndProc Messages at Startup
Post by: azdps on May 15, 2011, 03:34:51 AM
dedndave i'm curious as to what program you use to compress your attachments. on several of the attachments you attach to posts im unable to decompress and get "no archives found" error. i use winrar usually but to make sure i also used winzip and 7zip in an attempt to decompress your zip files with no luck.
Title: Re: WndProc Messages at Startup
Post by: Gunner on May 15, 2011, 04:00:35 AM
The zip in the above post is not a zip file but a png image renamed to zip... it is a board cheat to attach and display images...

dave wrote this as his last line:
Quotethe attachment is the above PNG image renamed to ZIP
Title: Re: WndProc Messages at Startup
Post by: dedndave on May 15, 2011, 11:19:28 AM
that's right - if it does not unzip, open it with a binary editor like HxD
you can see the file markers for PNG, GIF, JPG, BMP files
then, just rename it   :P

http://mh-nexus.de/en/hxd/