flat assembler
Message board for the users of flat assembler.
Index
> Windows > cursor and center screen |
Author |
|
decard 20 Oct 2003, 21:18
1) you should declare filename of your cursor not via FILE directive, but you should declare normal string, ie:
Code: w_cursor1 db 'c:\fasmw\template\1.cur', 0 2)code Code: invoke GetSystemMetrics,SM_CXSCREEN ; copy paste from masm example stdcall TopXY,Wwd,eax mov [Wtx], eax invoke GetSystemMetrics,SM_CYSCREEN stdcall TopXY,Wht,eax mov [Wty], eax should be Code: invoke GetSystemMetrics,SM_CXSCREEN ; copy paste from masm example stdcall TopXY,[Wwd],eax mov [Wtx], eax invoke GetSystemMetrics,SM_CYSCREEN stdcall TopXY,[Wht],eax mov [Wty], eax regards |
|||
20 Oct 2003, 21:18 |
|
sina 21 Oct 2003, 12:52
ok center screen code works as you helped
but the cursor does not work although i have changed it to the string and in the win32 sdk i have found that it says "If your application must set the cursor while it is in a window, make sure the class cursor for the specified window's class is set to NULL. If the class cursor is not NULL, the system restores the class cursor each time the mouse is moved." is it something to do with this? in the code i have written invoke LoadCursor,0,NULL mov [wc.hCursor],eax to make in null but its not working and the cursor i am trying to apply is the original windows cursor found in the cursors folder of xp anyway thanks for your help |
|||
21 Oct 2003, 12:52 |
|
decard 21 Oct 2003, 15:43
The problem was with your WindowProc. It should directly return a value that DefWindowProc returns (when DefWindowProc is called).
Try this: Code: proc WindowProc, hwnd,wmsg,wparam,lparam enter push ebx esi edi cmp [wmsg],WM_DESTROY je wmdestroy cmp [wmsg],WM_NCHITTEST je wmnchittest wmnchittest: invoke DefWindowProc,[hwnd],[wmsg],[wparam],[lparam] ; go directly to the finish:) jmp finish wmdestroy: stdcall msgbox,_example1 invoke PostQuitMessage,0 xor eax,eax finish: pop edi esi ebx return oh, in future, can you use indents? They make your programs more readable. See some FASMW examples - they show how your progam should look like regards |
|||
21 Oct 2003, 15:43 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.