Do_OutpWin proc hParent:DWORD
LOCAL opwc:WNDCLASSEX
; register class
mov opwc.cbSize, sizeof WNDCLASSEX
mov opwc.style, CS_HREDRAW or CS_VREDRAW
mov opwc.lpfnWndProc, offset OpwProc
mov opwc.cbClsExtra, NULL
mov opwc.cbWndExtra, NULL
m2m opwc.hInstance, hInstance
mov opwc.hbrBackground, COLOR_APPWORKSPACE
mov opwc.lpszMenuName, NULL
mov opwc.lpszClassName, offset OutpClass
invoke LoadCursor,NULL,IDC_ARROW
mov opwc.hCursor, eax
invoke RegisterClassEx, ADDR opwc
.if eax==0
szText error,"error loading outpwinclass"
invoke MessageBox,hParent,addr error,addr szDisplayName,MB_OK or MB_ICONERROR
.endif
; create the window
invoke CreateWindowEx,WS_EX_TOOLWINDOW,\
addr OutpClass,
addr OutpName,WS_CHILD,\
0,0,500,40,\
hParent,NULL,hInstance,NULL
mov hOutpWin,eax
ret
Do_OutpWin endp
I was trying to make this output window for my editor, and have trapped my error. The reason its not working is the class isnt getting registered, hence the invoke MessageBox tells me that eax==0 after i call registerclassex. Anyone have an idea on why this class isnt getting registered?
Thanks
LOCAL opwc:WNDCLASSEX
; register class
mov opwc.cbSize, sizeof WNDCLASSEX
mov opwc.style, CS_HREDRAW or CS_VREDRAW
mov opwc.lpfnWndProc, offset OpwProc
mov opwc.cbClsExtra, NULL
mov opwc.cbWndExtra, NULL
m2m opwc.hInstance, hInstance
mov opwc.hbrBackground, COLOR_APPWORKSPACE
mov opwc.lpszMenuName, NULL
mov opwc.lpszClassName, offset OutpClass
invoke LoadCursor,NULL,IDC_ARROW
mov opwc.hCursor, eax
invoke RegisterClassEx, ADDR opwc
.if eax==0
szText error,"error loading outpwinclass"
invoke MessageBox,hParent,addr error,addr szDisplayName,MB_OK or MB_ICONERROR
.endif
; create the window
invoke CreateWindowEx,WS_EX_TOOLWINDOW,\
addr OutpClass,
addr OutpName,WS_CHILD,\
0,0,500,40,\
hParent,NULL,hInstance,NULL
mov hOutpWin,eax
ret
Do_OutpWin endp
I was trying to make this output window for my editor, and have trapped my error. The reason its not working is the class isnt getting registered, hence the invoke MessageBox tells me that eax==0 after i call registerclassex. Anyone have an idea on why this class isnt getting registered?
Thanks
add this where you fill your windowclass:
mov opwc.hIcon,NULL
and then it should work :alright:Nope, no luch there either, sill getting the damn messagebox
What else u think it could be?
What else u think it could be?
Maybe you should set the hIconSm member to NULL as well. As the structure is local, this member can be anything and registerclassex will see it as an invalid handle..
Thomas
Thomas
Since your structure is located on the stack it will be filled with junk. You have to set all unused members to 0s. I recommend putting this right after the definition:
This successfully clears the WNDCLASSEX structure before you fill it in. Put it right after your LOCAL declaration.
push edi
xor eax, eax
mov ecx, sizeof opwc
lea edi, [opwc]
rep movsb
pop edi
This successfully clears the WNDCLASSEX structure before you fill it in. Put it right after your LOCAL declaration.
Okay, I've tried and tried, and this program is crashing. I'm even using the proc RegisterWinClass, that my program uses to register the main window. I'm getting an invalid page fault, and when i open up the debugger it says stack overflow. I'm getting really confused at this point.
I have zipped it up. Very small, not anything at all really added to the prostart code except optwin.asm. Someone help me please ;)
Thanks
I have zipped it up. Very small, not anything at all really added to the prostart code except optwin.asm. Someone help me please ;)
Thanks
here it is.. my computer froze and said "not enough memory", sorry
Hi Karl
Just dl your code.
You must add a ret here and there to avoid those nasty
GPF's
OpwProc proc hWin :DWORD,
uMsg :DWORD,
wParam :DWORD,
lParam :DWORD
invoke DefWindowProc,hWin,uMsg,wParam,lParam
ret <----
OpwProc endp
Just dl your code.
You must add a ret here and there to avoid those nasty
GPF's
OpwProc proc hWin :DWORD,
uMsg :DWORD,
wParam :DWORD,
lParam :DWORD
invoke DefWindowProc,hWin,uMsg,wParam,lParam
ret <----
OpwProc endp
Thanks! That fixed the crash, but the window doesnt show up, all though the class for the output win now does register successfully. Hmm, still no window showing tho... right now, its sized to take up the whole client area, but i'll fix that once i can get it to pop up.. Any suggestions on whats wrong now?
You also need to set some styles when you
create your output win
WS_CHILD or WS_VISIBLE or WS_CAPTION
Shold solve your problem
create your output win
WS_CHILD or WS_VISIBLE or WS_CAPTION
Shold solve your problem
Holy shit it works!! ;)
Thanks SOOOO much
Now, another question I know that you can answer ;) how do make it dock to the bottom? just like the output win on yer IDE, I love your setup!!
THanks
Thanks SOOOO much
Now, another question I know that you can answer ;) how do make it dock to the bottom? just like the output win on yer IDE, I love your setup!!
THanks
In RadASM I am using a MDi window. Normaly a window
cannot be a child of another window. (Will not get focus).
The docked windows in RadASM is a fake created by drawing
a caption and a close button. Else there is only a matter of
resizing.
cannot be a child of another window. (Will not get focus).
The docked windows in RadASM is a fake created by drawing
a caption and a close button. Else there is only a matter of
resizing.
Thanks!!
Works like a charm now..
Works like a charm now..