Why not standard ChildWindowFromPoint syntax?

Everything else that doesn't fall into one of the other PB categories.
storck
User
User
Posts: 83
Joined: Sat Oct 18, 2003 4:56 pm
Location: Sweden

Why not standard ChildWindowFromPoint syntax?

Post by storck »

This is not a very big deal, but I can't help asking:

Is there a good reason for the ChildWindowFromPoint NOT using the syntax described in MSDN or api help files?

HWND ChildWindowFromPoint(HWND hWndParent, POINT Point);

I wasted quite some hours only to find out that the PB version wanted
ChildWindowFromPoint_ (window, x, y)

I thought I was supposed to be able to use all api calls without keeping track of some calls using a non standard syntax.

It could be that I am just plain stupid, but is there a reason for the syntax differences? Any plans to fix it? Or am I just mistaken?

/Storck
Pupil
Enthusiast
Enthusiast
Posts: 715
Joined: Fri Apr 25, 2003 3:56 pm

Post by Pupil »

It's because purebasic only support passing the pointer to a structured variable and not the individual values inside the structure (as is needed in this case) to a procedure or API function.
Hi-Toro
Enthusiast
Enthusiast
Posts: 270
Joined: Sat Apr 26, 2003 3:23 pm

Post by Hi-Toro »

I got caught by this too. Is this (along with WindowFromPoint) the only case where this occurs? I would never have figured it out if someone else hadn't shown me the 'solution'. I'd swear you can do stuff like this elsewhere in the API though, that is, BlahBlah (@whatever.Example)...?
James Boyd
http://www.hi-toro.com/
Death to the Pixies!
Froggerprogger
Enthusiast
Enthusiast
Posts: 423
Joined: Fri Apr 25, 2003 5:22 pm
Contact:

Post by Froggerprogger »

The MSDN says POINT to be requested, and with it all the seperated values itself.
Many other functions do use a pointer to a struct, such as GetCursorPos_(). The parameter is indicated as LPPOINT then, the LP* stands for 'long pointer' I think.

So just read the MSDN carefully if it is a pointer or not.

(anyway - the MSDN is really misunderstandable in this point)

Happy new year!
%1>>1+1*1/1-1!1|1&1<<$1=1
storck
User
User
Posts: 83
Joined: Sat Oct 18, 2003 4:56 pm
Location: Sweden

Post by storck »

Thank you all! I knew there was something I didn't quite get... It has happened before and I am afraid it will happen again some time soon. :wink:

Regards,

Storck
User avatar
tinman
PureBasic Expert
PureBasic Expert
Posts: 1102
Joined: Sat Apr 26, 2003 4:56 pm
Location: Level 5 of Robot Hell
Contact:

Post by tinman »

Perhaps that's something Fred could add to PB - the ability to pass a structured variable to procedures and it passes a copy of the entire structure (like the API in this case and C).

It would also be pretty neat if you could pass pointers and mark them as read only within the procedure.
[/b]
If you paint your butt blue and glue the hole shut you just themed your ass but lost the functionality.
(WinXPhSP3 PB5.20b14)
Post Reply