flat assembler
Message board for the users of flat assembler.

Index > Main > structure help

Author
Thread Post new topic Reply to topic
redasm



Joined: 28 Aug 2005
Posts: 1
redasm 28 Aug 2005, 00:22
bfr rb $FF
sze dd $FF

struc point
{.x dd ?
.y dd ?}
mxy point

invoke GetCursorPos,mxy
invoke WindowFromPoint,mxy.x,mxy.y
invoke GetWindowText,eax,bfr,sze

does not work ^o^
Post 28 Aug 2005, 00:22
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 28 Aug 2005, 04:10
Let me show you the prototype of WindowFromPoint:
Code:
HWND WindowFromPoint(

    POINT Point         // structure with point
   );    


Tomasz: You had set a wrong amount of params to that function, it needs only one param not two.

Regards,
LocoDelAssembly
Post 28 Aug 2005, 04:10
View user's profile Send private message Reply with quote
vbVeryBeginner



Joined: 15 Aug 2004
Posts: 884
Location: \\world\asia\malaysia
vbVeryBeginner 28 Aug 2005, 05:31
and the point structure is correct.
Code:
typedef struct tagPOINT { 
  LONG x; 
  LONG y; 
} POINT, *PPOINT; 
    
Post 28 Aug 2005, 05:31
View user's profile Send private message Visit poster's website Reply with quote
vbVeryBeginner



Joined: 15 Aug 2004
Posts: 884
Location: \\world\asia\malaysia
vbVeryBeginner 28 Aug 2005, 05:37
try
Code:
invoke WindowFromPoint,[mxy.x],[mxy.y] 
    
Post 28 Aug 2005, 05:37
View user's profile Send private message Visit poster's website Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 28 Aug 2005, 13:04
Sorry, I forgot C support passing structures by copy Embarassed
Post 28 Aug 2005, 13:04
View user's profile Send private message Reply with quote
Reverend



Joined: 24 Aug 2004
Posts: 408
Location: Poland
Reverend 28 Aug 2005, 22:20
locodelassembly: I also had some problems with this API once, but I noticed that API reference says "POINT" (structure) not "LPPOINT" (long pointer to structure). Heh, but for someone who doesn't use this API it could not be clear at first Smile
Post 28 Aug 2005, 22:20
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.