Archive: Get X & Y of control C++


Get X & Y of control C++
Is it possible to get the X and Y coordinates of e.g. a button from the left and top of a window (rather than the screen) in C++?

Neither GetWindowRect nor GetClientRect seem to get it.

Edit: This is for a NSIS plugin I'm writing for some guy.

-Stu


Use GetWindowRect to get the child window rectangle, then MapWindowPoints to make it relative to the parent window.


or GetWindowRect and ScreenToClient