flat assembler
Message board for the users of flat assembler.
Index
> Windows > Location of windows function return |
Author |
|
Ariiio 03 Feb 2024, 18:45
I'm trying to get the cursor position with the windows function "GetCursorPos". As far as I know it takes in a POINT, puts the coordinates in that point and returns 1 if successful. I put 0 into ecx as that is supposed to be the POINT, and since POINT is just a x and y coordinate it should work.
Problem 1: The function doesnt seem to return 1 into eax, so either it doesnt work for some reason or I did something wrong with passing the arguments Problem 2: Since the function is supposed to put the coordinates into the POINT (ecx) it should do just that. ecx does change, but it doesnt look anythingl like ax and y coordinates. When I put my mouse into the upper left corner of my screen (0x0) ecx isnt 0 which doesnt make sense?
_________________ 🔨 |
|||||||||||
03 Feb 2024, 18:45 |
|
Furs 03 Feb 2024, 19:00
The argument is a pointer (i.e. the address) of the POINT structure. Also, it needs to be pushed on the stack since you're using 32-bit?
|
|||
03 Feb 2024, 19:00 |
|
Ariiio 03 Feb 2024, 20:09
Furs wrote: The argument is a pointer (i.e. the address) of the POINT structure. Also, it needs to be pushed on the stack since you're using 32-bit? You are right, completely forgot it took in a pointer. Thanks for mentioning the arguments having to get pushed on the stack in x86, probably got it confused with x64 _________________ 🔨 |
|||
03 Feb 2024, 20:09 |
|
Ariiio 03 Feb 2024, 20:10
macomics wrote:
thanks, works perfectly _________________ 🔨 |
|||
03 Feb 2024, 20:10 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.