Hi all.. I want to ask about the message loop. In my project I need to make (new file) function so I have to use as example CreateWindowEx function several times and every window need to be managed by same window procedure, what I donít know how to do is how to  keep the message loop maintains managing all windows created in same time. does anyone have a suggestion or any example code to do that? Thanks for helping.
Posted on 2009-10-17 03:58:13 by hotspot
Actually you don't need to do anything special: just call GetMessage with NULL as second parameter. It will retrieve messages for all windows created by the calling thread.
Posted on 2009-10-17 05:04:55 by ti_mo_n
Hi Ti_mo_n thank u very much, actually the mistake I did is obtaining the hWin at the wrong place ..

mov eax,uMsg
.if eax==WM_INITDIALOG
push hWin
pop hWnd

this piece of code is from RadASM IDE from DialogAsMain.tpl the very nice IDE I like to use but in this case it doesnít work with me because the window handle will be kept in the hWnd as long as I donít create another window with same WndProc procedure I mean two windows with one window procedure because and while second window been created hWnd will hold the next window handle so when I return back to the first one I lose control of it. First I thought WndProc doesnít receive messages but simply I solved the problem by moving push Ė pop up to the beginning of the procedure.

push hWin
pop hWnd
mov eax,uMsg
.if eax==WM_INITDIALOG

Do you believe that it costs me too much time
Posted on 2009-10-24 03:19:51 by hotspot
Do you really need global copy of handle to dialog currently being processed by WndProc? It's not thread-safe (several modeless dialogs -- with same WndProc -- from different threads will overwrite hWnd), and of what use is that handle outside WndProc? By the way, template's WndProc don't use hWnd, only hWin.
Posted on 2009-10-27 06:06:29 by baldr
I need to process two or more dailogs with one WinProc at same time this is why I need to keep a copy of each handle of dailogs just to swich between them thatís all, and I reached this gole but my problem was obtening the handle as I mantioned above any way thanks for all for helping.
Posted on 2009-10-29 03:22:02 by hotspot