hi, this is my source to create a window, but it doesn't work in winnt! the call returns NULL. but why? invoke LoadIcon,hInst,500 ; icon ID mov hIcon, eax mov wc.cbSize, sizeof WNDCLASSEX mov wc.style, CS_HREDRAW or CS_VREDRAW \ or CS_BYTEALIGNWINDOW mov wc.lpfnWndProc, offset WndProc mov wc.cbClsExtra, NULL mov wc.cbWndExtra, NULL m2m wc.hInstance, hInst invoke CreateSolidBrush,00000000h push eax mov wc.hbrBackground, eax pop eax invoke DeleteObject,eax mov wc.lpszMenuName, NULL mov wc.lpszClassName, offset szClassName m2m wc.hIcon, hIcon invoke LoadCursor,NULL,IDC_ARROW mov wc.hCursor, eax m2m wc.hIconSm, hIcon invoke RegisterClassEx, ADDR wc mov Wwd, 250 mov Wht, 110 invoke CreateWindowEx,WS_EX_LEFT, ADDR szClassName, ADDR szDisplayName, WS_OVERLAPPED or WS_CAPTION or WS_SYSMENU or WS_MINIMIZEBOX, Wtx,Wty,Wwd,Wht, NULL,NULL, hInst,NULL .if eax==NULL invoke MessageBox,NULL,addr fehler18,addr szDisplayName,MB_OK .endif mov hWnd,eax :confused
Posted on 2001-01-25 11:25:00 by [SaFc0n]
Atleast one thing seems to be strange .. If you create a solid brush and set its handle for the window background you should not free this brush before creating the window.
Posted on 2001-01-25 11:43:00 by miracle
ok, first of all, this isn't the problem. I left this CreateSolidBrush out but it still didn't work. The second point is that the handle to the brush is saved in the WNDCLASS structure, isn't it? I'll try again without this solid brush, perhaps i did smth else wrong. tnx anyway.
Posted on 2001-01-26 13:32:00 by [SaFc0n]
THANKS TO ALL FOR PROMPT INTERESTS japheth, ruesult is a REAL8 format, for this reason i do add esp,16 (4+4+8) I'm using TASM, i cna't use INVOKE :( karim msvcrt that work correctly is 261Kb of 01/03/99, the other that give me the error is at home, i have to check becouse now i'm at job. Thanks again it's a strange trouble...
Posted on 2001-06-22 05:32:00 by angelo
safcon this should work change your line: invoke LoadIcon,hInst,500 ; icon ID mov hIcon, eax to this: invoke LoadIcon,hInst,500 ; icon ID mov wc.hIcon, eax remove this line: m2m wc.hIcon, hIcon change this line: m2m wc.hIconSm, hIcon to this: m2m wc.hIconSm, wc.hIcon smurf This message was edited by smurf, on 6/22/2001 6:03:25 AM
Posted on 2001-06-22 06:02:00 by smurf
hehe, smurf, what did you dig out from the depths of the messageboard? :) it's a long time ago that i solved the problem myself..... :cool: but anyway, thanks :)
Posted on 2001-06-22 06:31:00 by [-alloces-]
lol it wasnt my fault it was angelo's!:) smurf
Posted on 2001-06-22 06:34:00 by smurf