flat assembler
Message board for the users of flat assembler.
Index
> Windows > In OpenGL need create window two times. |
Author |
|
Roman 21 Jan 2018, 11:46
I use CreateWindowEx for create two windows. And two windows have:
wc WNDCLASSEX struct. And wc2 WNDCLASSEX struct. I read msdn CreateWindow function in user32 but not see in fasm user32.inc CreateWindowA. And UnRegisterClassEx. |
|||
21 Jan 2018, 11:46 |
|
donn 21 Jan 2018, 16:11
Did the wndClassEx strucs have unique values? Did registering succeed?
I haven't used 2 Windows, but the following is a slightly annotated Window of mine. It's somewhat hackey, but I was referencing MSDN and just needed something running, so it's not that clean. May spark some ideas: Code: ;struct tagWNDCLASSEX { ; UINT cbSize; ;UINT size 4 ; UINT style; ; WNDPROC lpfnWndProc; ;WNDPROC size 8 ; int cbClsExtra; ; int cbWndExtra; ; HINSTANCE hInstance; ;HINSTANCE size 8 ; HICON hIcon; ;HICON size 8 ; HCURSOR hCursor; ;HCURSOR size 8 ; HBRUSH hbrBackground; ;HBRUSH size 8 ; LPCTSTR lpszMenuName; ;LPCTSTR size 8 ; LPCTSTR lpszClassName; ; HICON hIconSm; ;HICON size 8 mov rdx, 32512 ; pass IDC_ARROW, MAKEINTRESOURCE(32512) mov rcx, 0 sub rsp, 8*4 call [LoadCursorA] add rsp, 8*4 mov r12, rax mov rax, [newWindow.wndClassEx] mov qword [rax+0], 50h ;cbSize mov qword [rax+4], 0 ;style lea r11, [windowMsgs] mov qword [rax+8], r11 ;lpfnWndProc mov qword [rax+16], 0 ;cbClsExtra mov qword [rax+20], 0 ;cbWndExtra mov r10, [newWindow.moduleHandle] mov qword [rax+24], r10 ;hInstance mov qword [rax+32], 0;r9 ;hIcon mov qword [rax+40], r12 ;hCursor mov qword [rax+48], 0 ;hbrBackground mov qword [rax+56], 0 ;lpszMenuName mov r10, appTitle mov qword [rax+64], r10 ;lpszClassName mov qword [rax+72],0;r9 ;hIconSm mov rcx, [newWindow.wndClassEx] sub rsp, 8*4 call [RegisterClassExA] add rsp, 8*4 sub rsp, 8*12 mov qword [rsp+11*8], 0 ;lpParam mov rcx, [newWindow.moduleHandle] mov qword [rsp+10*8],rcx ;hInstance mov qword [rsp+9*8], 0 ;hMenu mov qword [rsp+8*8], 0 ;hWndParent mov qword [rsp+7*8], 250 ;nHeight mov qword [rsp+6*8], 300 ;nWidth mov qword [rsp+5*8], 200 ;y mov qword [rsp+4*8], 200 ;x mov r9, 13565952 ;dwStyle ;0CF0000h mov r8, appTitle ;lpWindowName mov rdx, appTitle ;lpClassName mov rcx, 0 ;dwExStyle call [CreateWindowExA] add rsp, 8*12 mov [newWindow.windowHandle], rax Good luck. https://stackoverflow.com/questions/18835592/win32-two-windows-using-the-same-wndproc-why |
|||
21 Jan 2018, 16:11 |
|
Roman 21 Jan 2018, 16:18
Two RegisterClassEx-s work fine.
And two CreateWindowEx-s Win1 and Win2 not get error. And i see Win1 and Win2 But peekmessage get info from Win1(from procWin1Empty) Because i press Alt+F4 and see MessageBox 'Close' ! But window Win1 not closed and steel work. I do four times Alt+F4 and see MessageBox 'Close' always ! |
|||
21 Jan 2018, 16:18 |
|
Roman 21 Jan 2018, 16:19
I create first Win1 then do Destroy,[hWnd2] (destroy Win1)
Then registre and create Win2 ! |
|||
21 Jan 2018, 16:19 |
|
Roman 21 Jan 2018, 18:44
I found !
I create two windows with one name ! Two windows have name "OpenGL" ! And PeekMessage for this reason not correct get message from Win2 ! Now work fine ! |
|||
21 Jan 2018, 18:44 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.