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

C / C++ / MFC

 
GeneralRe: IOCP - when a socket is closed ? Pin
yani dzhurov24-Feb-06 3:39
yani dzhurov24-Feb-06 3:39 
GeneralRe: IOCP - when a socket is closed ? Pin
James R. Twine24-Feb-06 4:47
James R. Twine24-Feb-06 4:47 
GeneralRe: IOCP - when a socket is closed ? Pin
George Nistor1-Aug-09 22:11
George Nistor1-Aug-09 22:11 
QuestionResizing windows Pin
Waldermort24-Feb-06 2:30
Waldermort24-Feb-06 2:30 
AnswerRe: Resizing windows Pin
David Crow24-Feb-06 2:54
David Crow24-Feb-06 2:54 
GeneralRe: Resizing windows Pin
Waldermort24-Feb-06 3:47
Waldermort24-Feb-06 3:47 
GeneralRe: Resizing windows Pin
Blake Miller24-Feb-06 6:20
Blake Miller24-Feb-06 6:20 
AnswerRe: Resizing windows Pin
Waldermort24-Feb-06 5:01
Waldermort24-Feb-06 5:01 
Well I figured out the problem, but I haven't found the solution yet. But for anybody else having the same problem:

GetClientRect()
gets the client rectangle (0,0,width-border,height-border) which is your dialog window

GetWindowRect() // passing hwnd of dialog
gets the position and size of the dialog window relative to the screen (x-pos,y-pos,width,height);

GetWindowRect() // passing hwnd of control
gets the pos and size of control, relative to the screen and not the dialog!

SetWindowPos()
expects co-ordinates relative to the client area.

My confusing value of 87 in tha above code was coming from the x-pos of the dialog window (83) plus the width of the dialog border (4). In the world of MFC there is a function ScreenToClient(which will convert the rect), but in Win32 it doesn't quite work the same. You would have to convert your rects using some other method.

But here is the best solution: http://www.codeproject.com/dialog/dlgresizearticle.asp[^] This simple class has proved invaluable, I'm sure I will be using it in most of my future projects. Thanks go to the author Big Grin | :-D
GeneralRe: Resizing windows Pin
Blake Miller24-Feb-06 6:23
Blake Miller24-Feb-06 6:23 
GeneralRe: Resizing windows Pin
David Crow24-Feb-06 6:24
David Crow24-Feb-06 6:24 
Questionabout UNICODE Pin
HOW WHAT24-Feb-06 2:02
HOW WHAT24-Feb-06 2:02 
AnswerRe: about UNICODE Pin
toxcct24-Feb-06 2:15
toxcct24-Feb-06 2:15 
AnswerRe: about UNICODE Pin
PJ Arends24-Feb-06 2:35
professionalPJ Arends24-Feb-06 2:35 
QuestionMedical Image Processing Pin
spyrus24-Feb-06 2:01
spyrus24-Feb-06 2:01 
AnswerRe: Medical Image Processing Pin
Divyang Mithaiwala24-Feb-06 2:33
Divyang Mithaiwala24-Feb-06 2:33 
AnswerRe: Medical Image Processing Pin
Saurabh.Garg24-Feb-06 2:53
Saurabh.Garg24-Feb-06 2:53 
GeneralRe: Medical Image Processing Pin
spyrus24-Feb-06 2:57
spyrus24-Feb-06 2:57 
AnswerRe: Medical Image Processing Pin
Chris Losinger24-Feb-06 3:21
professionalChris Losinger24-Feb-06 3:21 
Questionneed to access a data base without creating a dsn Pin
RavishB24-Feb-06 1:40
RavishB24-Feb-06 1:40 
AnswerRe: need to access a data base without creating a dsn Pin
David Crow24-Feb-06 2:56
David Crow24-Feb-06 2:56 
QuestionDynamically Increasing Arrays Pin
Spykraft24-Feb-06 1:30
Spykraft24-Feb-06 1:30 
AnswerRe: Dynamically Increasing Arrays Pin
toxcct24-Feb-06 1:55
toxcct24-Feb-06 1:55 
GeneralRe: Dynamically Increasing Arrays Pin
Spykraft24-Feb-06 2:23
Spykraft24-Feb-06 2:23 
AnswerRe: Dynamically Increasing Arrays Pin
David Crow24-Feb-06 3:02
David Crow24-Feb-06 3:02 
GeneralRe: Dynamically Increasing Arrays Pin
toxcct24-Feb-06 4:22
toxcct24-Feb-06 4:22 

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.