Hi,
does anybody know how to show a new window? (not a dialog) (I succeeded in dialog but I want a window :)). I use standard prototypes 'WinMain' and 'WndProc'. I have a button on a main window and when I click on it I want the button to show the new window.
Any help appreciated,
sF
does anybody know how to show a new window? (not a dialog) (I succeeded in dialog but I want a window :)). I use standard prototypes 'WinMain' and 'WndProc'. I have a button on a main window and when I click on it I want the button to show the new window.
Any help appreciated,
sF
CreateWindow and CreateWindowEx is what you are looking for.
CreateWindow and CreateWindowEx is what you are looking for.
I know, I know, but I don't know where to put the code with the CreateWindowEx function (WM_CREATE/WM_COMMAND) and don't know how the code should look like.
sF
It would help if you posted some more details about exactly what you want to achieve. You can put CreateWindow* code anywhere, but that doesn't necessarily help you....
A control of class BUTTON will, when clicked, send a WM_COMMAND with a control ID and a notification code BN_CLICKED.
Each control ought to have a unique ID number defined in the hMenu argument of the call that creates the control. If you are actually using a dialog proc for your main window, define the control ID in the resource file (as well as in your program).
Each control ought to have a unique ID number defined in the hMenu argument of the call that creates the control. If you are actually using a dialog proc for your main window, define the control ID in the resource file (as well as in your program).
; in WM_COMMAND handler
mov eax, wParam
.if eax == (IDC_BUTTON_CTL_ID or (BN_CLICKED << 16))
; Create your new window
.endif
Well, I want to create my own "About" window. What I want to do is similar to Iczelion's example (tut.) no. 11/1 (but I don't want to show a dialog window).
I use this code:
Here is an example how I create a button:
And I don't know what to change to show the new window (not a button).
sF
I use this code:
.if uMsg == WM_COMMAND
mov eax, wParam
.if eax == 87 ;my "About" button
CreateWindowEx, don't know how to continue... :(
.endif
Here is an example how I create a button:
INVOKE CreateWindowEx, 0, addr ButtClass, addr szAboutText,
WS_CHILD or WS_VISIBLE,
95, 175, 65, 20, hWin, 87, hInstance, 0
And I don't know what to change to show the new window (not a button).
sF
The conventional way is to create a new window class, using a WNDCLASSEX, and use RegisterClassEx to register it at the same time you register your main window class.
You'll need a new WndProc to go with the new window.
In your CreateWindowEx invoke, use the window class you created and the window type (WS_OVERLAPPED, or WS_POPUP, or WS_CHILD). Do not use WS_CHILD if you want the box to work like a normal About box.
You'll either need to make a menu resource, or create a menu with the menu functions to use the hMenu argument. Otherwise, use NULL.
Everything else is pretty much the same. Read the docs and experiment!
You'll need a new WndProc to go with the new window.
In your CreateWindowEx invoke, use the window class you created and the window type (WS_OVERLAPPED, or WS_POPUP, or WS_CHILD). Do not use WS_CHILD if you want the box to work like a normal About box.
You'll either need to make a menu resource, or create a menu with the menu functions to use the hMenu argument. Otherwise, use NULL.
Everything else is pretty much the same. Read the docs and experiment!