Click here to Skip to main content
15,891,204 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Shutting Down Remote PC Pin
GauranG Shah28-Sep-07 3:05
GauranG Shah28-Sep-07 3:05 
GeneralRe: Shutting Down Remote PC Pin
David Crow28-Sep-07 3:11
David Crow28-Sep-07 3:11 
GeneralRe: Shutting Down Remote PC Pin
GauranG Shah28-Sep-07 3:26
GauranG Shah28-Sep-07 3:26 
QuestionRe: Shutting Down Remote PC Pin
David Crow28-Sep-07 3:47
David Crow28-Sep-07 3:47 
AnswerRe: Shutting Down Remote PC Pin
GauranG Shah28-Sep-07 4:02
GauranG Shah28-Sep-07 4:02 
QuestionRe: Shutting Down Remote PC Pin
David Crow28-Sep-07 4:17
David Crow28-Sep-07 4:17 
QuestionDLGTemplate MapDialogRect() problem Pin
prithaa26-Sep-07 21:55
prithaa26-Sep-07 21:55 
AnswerRe: DLGTemplate MapDialogRect() problem Pin
Jason Teagle26-Sep-07 22:38
Jason Teagle26-Sep-07 22:38 
The co-ordinates specified in the control's Create() call are specified in the parent's (your dialogue's) CLIENT co-ordinates.

'Client' co-ords have their (0, 0) at the top-left of the space *within* any border and title bar the dialogue has. If it has no border and no title bar, then this is the same as the top-left of the full dialogue.

If you want to know how far the control is from the top-left of yoour dialogue and you have a title bar and / or border, then you need to get the dialogues 'window' rect, and the control's 'window' rect, and then you can calculate the offset.

Note, though, that if you ask a control for its client rect, it gives you co-ordinates relative to *its*own* client area, not its parent.

If you ask a control or window for its 'window' rect, it gicves you co-ords relative to *the*screen's* top-left.

So, to get the offset from a dialogue's client arrea to a control's top-left, do this:

CRect rctControl ;
MyControl.GetWindowRect(&rctControl);
// It's relative to top-left of screen.
MyDlg.ScreenToClient(&rctControl);
// Now, relative to top-left of dlg's client area.


To get it relative to the full dlg's top-left (ignoring title bar and border):

CRect rctControl ;
MyControl.GetWindowRect(&rctControl);
// It's relative to top-left of screen.
CRect rctDlg ;
MyDlg.GetWindowRect(&rctDlg);
rctControl.OffsetRect(rctDlg.left - rctControl.left,
rctDlg.top - rctControl.top);
// Now, relative to top-left of dlg's full area.


AnswerRe: DLGTemplate MapDialogRect() problem Pin
Mark Salsbery27-Sep-07 5:43
Mark Salsbery27-Sep-07 5:43 
QuestionLPT Listener using thread Pin
TPN26-Sep-07 21:05
TPN26-Sep-07 21:05 
AnswerRe: LPT Listener using thread Pin
Cedric Moonen26-Sep-07 22:19
Cedric Moonen26-Sep-07 22:19 
GeneralRe: LPT Listener using thread Pin
TPN27-Sep-07 0:44
TPN27-Sep-07 0:44 
GeneralRe: LPT Listener using thread Pin
Cedric Moonen27-Sep-07 4:34
Cedric Moonen27-Sep-07 4:34 
GeneralRe: LPT Listener using thread Pin
TPN27-Sep-07 19:53
TPN27-Sep-07 19:53 
AnswerRe: LPT Listener using thread Pin
Rahul Vaishnav27-Sep-07 1:13
Rahul Vaishnav27-Sep-07 1:13 
GeneralRe: LPT Listener using thread Pin
TPN27-Sep-07 19:57
TPN27-Sep-07 19:57 
GeneralRe: LPT Listener using thread Pin
JudyL_MD28-Sep-07 1:59
JudyL_MD28-Sep-07 1:59 
GeneralRe: LPT Listener using thread Pin
JudyL_MD28-Sep-07 2:03
JudyL_MD28-Sep-07 2:03 
AnswerRe: LPT Listener using thread Pin
David Crow27-Sep-07 3:30
David Crow27-Sep-07 3:30 
AnswerRe: LPT Listener using thread Pin
Rahul Vaishnav2-Oct-07 20:07
Rahul Vaishnav2-Oct-07 20:07 
Questiona pointer Pin
youbo26-Sep-07 21:01
youbo26-Sep-07 21:01 
AnswerRe: a pointer Pin
youbo26-Sep-07 21:31
youbo26-Sep-07 21:31 
GeneralRe: a pointer Pin
toxcct26-Sep-07 21:39
toxcct26-Sep-07 21:39 
AnswerRe: a pointer Pin
toxcct26-Sep-07 21:35
toxcct26-Sep-07 21:35 
GeneralRe: a pointer Pin
John R. Shaw26-Sep-07 21:52
John R. Shaw26-Sep-07 21:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.