Re: window creation
- Posted by 1evan at sbcglobal.net May 16, 2003
- 463 views
Actually I think it should be *wc = allocate(40)* because I am using WndClass structure and not WndClassEx. No hIconSm or cbSize members to worry about. 1evan at sbcglobal.net wrote: > if id = -1 then > puts(1, "routine_id failed!\n") > abort(1) > end if > WndProcAddress = call_back(id) > wc = allocate(48) --was allocate(40), > changed to 48, still no go > WindowRect = allocate(16) > ClassName = allocate_string("Window Class") > poke4(WindowRect,0) > poke4(WindowRect + 4,width) > poke4(WindowRect + 8, 0) > poke4(WindowRect + 12, height) > hInstance = c_func(GetModuleHandleA,{NULL}) > poke4(wc,or_all({CS_HREDRAW, CS_VREDRAW, CS_OWNDC})) > poke4(wc+4,WndProcAddress) > poke4(wc+8,0) > poke4(wc+12,0) > poke4(wc+16,hInstance) > poke4(wc+20,c_func(LoadIconA,{NULL,IDI_WINLOGO})) > poke4(wc+24,c_func(LoadCursorA,{NULL, IDC_ARROW})) > poke4(wc+28,NULL) > poke4(wc+32,NULL) > poke4(wc+36,ClassName) > > if not c_func(RegisterClassA,{wc}) then > if message_box("Failed to register class","Error", > or_bits(MB_OK,MB_ICONINFORMATION)) then end if > return FALSE > else > printf(1,"Class %s registered > successfully\n\n",{peek({ClassName,6})}) > end if > > euman at bellsouth.net wrote: > >> >> 1evan, >> >> Do you have this correct in your WinMain( ) function? >> >> wndclass = allocate(48) >> >> szAppName = allocate_string("wndclass") >> >> >> Jordah, >> >> hInstance = c_func(xGetModuleHandle, {0}) >> >> >> Euman >> >> >> TOPICA - Start your own email discussion group. FREE! >> >> -- |\ _,,,---,,_ /,`.-'`' -. ;-;;,_ |,4- ) )-,_..;\ ( `'-' '---''(_/--' `-'\_)`-'\_)