Old 20th November 2005, 13:06   #1
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
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
Afrow UK is offline   Reply With Quote
Old 20th November 2005, 13:38   #2
deguix
Major Dude
 
deguix's Avatar
 
Join Date: Dec 2002
Location: Everett - MA, USA
Posts: 1,354
Send a message via ICQ to deguix
Use GetWindowRect to get the child window rectangle, then MapWindowPoints to make it relative to the parent window.

My Wiki Pages

Working now on:
New projects. (language: any)
deguix is offline   Reply With Quote
Old 20th November 2005, 20:33   #3
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,442
or GetWindowRect and ScreenToClient

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump