Quote
invoke GetDesktopWindow
invoke GetWindowRect,eax,addr DesktopRect
mov eax, DesktopRect.right
shr eax, 1
sub eax, 70
mov XPosition, eax
mov eax, DesktopRect.bottom
shr eax, 1
sub eax, 65
mov YPosition, eax
what way may be get the screen resolution else? GetDesktopWindow gives a fatal error running first time after any programe which sreen resolution change (contral strike).
or may be only on my computer?
Quote
.386
.model flat, stdcall
option casemap :none
include \MASM32\INCLUDE\windows.inc
include \MASM32\INCLUDE\user32.inc
include \MASM32\INCLUDE\kernel32.inc
includelib \MASM32\LIB\user32.lib
includelib \MASM32\LIB\kernel32.lib
.data
ClassName db "WorkerW",0
.data?
buffer db 512 dup(?)
.code
start:
invoke GetDesktopWindow
INVOKE GetClassName,eax,ADDR buffer,sizeof buffer
invoke MessageBox,0,ADDR buffer,ADDR ClassName,MB_OK + MB_ICONASTERISK
invoke ExitProcess,0
end start
PS Are any help for FPU for MASM32 command and Variables exists?
find answer at first question
Quote
invoke GetSystemMetrics,ARW_BOTTOMRIGHT
mov XPOS, eax
invoke GetSystemMetrics,ARW_BOTTOMLEFT
mov YPOS, eax
See here (http://www.masm32.com/board/index.php?topic=14617.msg118180#msg118180) for an explanation why this could fail. The handle returned by GetDesktopWindow looks, ehm, a bit odd, at least on Win XP.
However, it does work with GetWindowRect, so there might be another reason why your code fails.
in this code there is no any other reason for fail. may be it's only on my computer - video driver for example or something else.....
.386
.model flat, stdcall
option casemap :none
include \MASM32\INCLUDE\windows.inc
include \MASM32\INCLUDE\user32.inc
include \MASM32\INCLUDE\kernel32.inc
includelib \MASM32\LIB\user32.lib
includelib \MASM32\LIB\kernel32.lib
.data
ClassName db "WorkerW",0
.data?
buffer db 512 dup(?)
.code
start:
invoke GetDesktopWindow
invoke ExitProcess,0
end start
PS C:\masm32\help\fpuhelp.chm