I have to start off by saying that programming in Assembly is *VERY* bad for ones health! I mean, I smoke more than normal when I write code but jeesh the last few days of writing code with MASM my landlord must think I am just burning cartons of cigs at a time! I don't even get out much anymore, at least I have a store close by for the Corona and Brandy! :grin:

Anyways... I know that when you create a window it must have a WndProc associated with it to recieve and process any messages (does it even have to be called WndProc?), so now I am creating another window... can I use the same WndProc that I used for the main window or do I create another WndProc named something else and point wc.lpfnWndProc to that WndProc, this sounds like a very simple question with a simple answer but oh well, Mr. Cerveza says ask anyway. :cool:

I am really having fun with Assembly now! I knew VB hid a lot from me, but boy did it hide a lot!
Posted on 2002-06-20 21:59:47 by Gunner
Rob,

Basically every window must have a Wndproc type procedure to process its messages. Some windows like controls (buttons etc ...) have then as part of the design that you must access by subclassing the control and often you can share a message handling procedure between controls and other windows.

You can call a WndProc procedure anything you like as long as you pass the correct address to the WNDCLASSEX for CreateWindowEx or to the subclass for a control.

I don't know how safe Staten Island is to go hoofing around in but try and get out and do some decent mileage inbetween sessions, you CAN be healthy and write assembler as well, its just a well kept secret. :)

Regards,

hutch@movsd.com
Posted on 2002-06-20 22:07:47 by hutch--
I have to start off by saying that programming in Assembly is *VERY* bad for ones health! I mean, I smoke more than normal when I write code but jeesh the last few days of writing code with MASM my landlord must think I am just burning cartons of cigs at a time! I don't even get out much anymore, at least I have a store close by for the Corona and Brandy!
Don't you know that smoking can kill you!!!
Anyways... I know that when you create a window it must have a WndProc associated with it to recieve and process any messages (does it even have to be called WndProc?), so now I am creating another window... can I use the same WndProc that I used for the main window or do I create another WndProc named something else and point wc.lpfnWndProc to that WndProc, this sounds like a very simple question with a simple answer but oh well, Mr. Cerveza says ask anyway.
It doesn't have to be called WndProc, you can name it anything you want.

As long as the other window handles the same messages as your main window, yes you can reuse it. But doesn't really makes sense except for sub/superclassing window controls because usually in an app there are no 2 windows that has the same buttons, menus, styles, behaviour, purpose...
Posted on 2002-06-20 22:10:19 by stryker
Just remember you probably have this in your main window proc
.IF uMsg==WM_DESTROY

invoke PostQuitMessage,NULL

You would only want your program to quit if the main window was closed and not some other window using the proc.
Posted on 2002-06-20 23:44:09 by Kudos
hutch--
SI is safe to go hoofing around depending on were you go :grin:
When I was a kid there were actually farms and stables so you could really go "hoofing" around, now there are many houses. :mad:

stryker
I had a feeling I could call it anything I wanted, and I should have 3 different WndProcs if I have 3 different windows since none of them have the same layout.

Kudos
That would of probably slipped by me, thanks.
Posted on 2002-06-21 07:44:28 by Gunner