flat assembler
Message board for the users of flat assembler.

Index > Heap > MAKEPOINTS winapi macro - how its done?

Author
Thread Post new topic Reply to topic
SomeoneNew



Joined: 12 Aug 2006
Posts: 54
SomeoneNew
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/rectangl_24j7.asp

How does this macro work? where can I see the code?
Thanks.

_________________
Im new, sorry if I bothered with any stupid question Smile
Post 26 Feb 2007, 13:37
View user's profile Send private message Reply with quote
Vasilev Vjacheslav



Joined: 11 Aug 2004
Posts: 392
Vasilev Vjacheslav
#define MAKEPOINTS(l) (*((POINTS FAR *)&(l)))

so imho it's a simple pointer to a l (to a POINTS structure)

typedef struct tagPOINTS
{
SHORT x;
SHORT y;
} POINTS, *PPOINTS, *LPPOINTS;
Post 26 Feb 2007, 13:56
View user's profile Send private message Reply with quote
SomeoneNew



Joined: 12 Aug 2006
Posts: 54
SomeoneNew
I'm not sure. Because the lParam on the window callback carries both X and Y coords, its just a matter of getting the lo and hi words from the int. Thing is, the macro does this and stores into the points structure as well. However I wouldnt be asking for this if I didnt had an issue.

the issue is that when I get the HI and LO words, they go from 0 to 128 then from 0 to -128 and so on. I was wondering how did the macro work in that case.

I dont want to call GetCursorPos() all the time and then another call to convert onto client area on the given window, etc, when I could avoid the polling by analyzing the messages of my window directly.

Also is there anything similar to "WM_MOUSE" ? Because Its clean to check for WM_MOUSEMOVE, and gather all button status and coords there, but.. when you aint moving, you have to check every flag separetly (WM_LBUTTONDOWN, WM_LBUTTONUP, WM_RBUTTONDOWN, WM_RBUTTONUP, etc) and that gives me a piece of ugly code!

I ask this because for keyboard theres WM_KEYDOWN and WM_KEYUP which gives you a way of coding things tidy.


Thanks.

_________________
Im new, sorry if I bothered with any stupid question Smile
Post 26 Feb 2007, 15:55
View user's profile Send private message 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 can attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.