hi
1)- i have 2 windows which have same windows procedure but each window has its own behavior at create message, how can i make differance between the both since windowcreate api send create message before sending the handle so i havn't handle to compare message origin

2)- which APIs could send create message

thnx
Posted on 2002-11-09 08:34:44 by minsiz
Something like this:




; Your wndproc

.if uMsg==WM_CREATE
.data
WindowCounter dd 0
.code
inc WindowCounter
.if WindowCounter==1
; This is the first window
.elseif WindowCounter==2
; This is the second window
.endif

; Rest of your wndproc



I don't really understand your second question. A window should only get a WM_CREATE once (which is sent by the CreateWindow(Ex) API). Of course you could send another WM_CREATE yourself using SendMessage or PostMessage, but I don't think windows would be too happy with that.
Posted on 2002-11-09 09:23:22 by Qweerdy
If the Caption is different on the windows you could get the window text and go from there( since you have the window handle ) .... but Qweerdy's way seems pretty good also.
Posted on 2002-11-09 14:17:24 by gorshing
ok it runs thnx
about the second question; i meant if for example showwindow send also create message
Posted on 2002-11-10 07:28:31 by minsiz
Sorry I am late to reply. Why can you not point to something unique via the lpParam parameter when you call the CreateWindow API for each window? Then, when the WM_CREATE message is processed, the data can be interrogated to determine which window it is. Is that not what lpParam is for? Ratch
Posted on 2002-11-13 10:14:49 by Ratch
Hehe, I never thought about that. Sounds good to me.

I'm going to try that out.
Posted on 2002-11-13 12:05:40 by gorshing
hi ratch
i tried before asking but it didn't run
i put number in lpcreateparam field then when i called createwindowex i compared lParam pointed dword (=lpcreateparam)
but i think the trouble is not there
also i inserted showwindow in other procedure at last just before exit, i think this showwindow send create message which cause recreating action so when i want to exit i recreate that window

hi gorshing
how can u find?, it runs?
Posted on 2002-11-14 08:15:43 by minsiz
minsiz,
I don't think you did it right. Look at the documentation for CreateWindowEx. The last parameter shown, and the first parameter pushed, is called lpParam. Normally it is NULL, but in your case, you should replace it unique number. Use a different number for each of your CreateWindowEx calls. I suggested before that lpParam should be a pointer to a unique number, but I don't see why that parameter cannot be the unique number itself. Anyway, when you process the WM-CREATE message, the lParam parameter points the the CREATESTRUCT structure. The first word in that structure is called lpCreateParams. It should be whatever you used for lpParam when you called CreateWindowEx.
I have a Windows ME OS. I tried the above and created two windows. During the creation, I observed two WM_CREATE messages, and each call had the unique number in the CREATESTRUCT. So for me, it worked. Ratch
Posted on 2002-11-14 09:26:16 by Ratch
ah the trouble is in my last procedure so when i removed ;it rans well
ok thank u for ur help ratch
Posted on 2002-11-15 08:08:35 by minsiz