Click here to Skip to main content
16,016,477 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: HELP WITH ARRAYS Pin
Tom Archer6-May-02 2:15
Tom Archer6-May-02 2:15 
GeneralGeting width of my CListbox Pin
4-May-02 12:40
suss4-May-02 12:40 
GeneralRe: Geting width of my CListbox Pin
Tom Archer4-May-02 13:23
Tom Archer4-May-02 13:23 
GeneralRe: Geting width of my CListbox Pin
Michael Dunn4-May-02 14:04
sitebuilderMichael Dunn4-May-02 14:04 
GeneralRe: Geting width of my CListbox - Thx Pin
4-May-02 14:45
suss4-May-02 14:45 
GeneralRe: Geting width of my CListbox - Thx Pin
Nish Nishant4-May-02 14:59
sitebuilderNish Nishant4-May-02 14:59 
GeneralRe: Geting width of my CListbox - Thx Pin
4-May-02 15:15
suss4-May-02 15:15 
GeneralRe: Geting width of my CListbox - Thx Pin
Tom Archer4-May-02 15:26
Tom Archer4-May-02 15:26 
You're welcome. Just make sure that you understand that these functions will return different values and so deciding which one to use is going to be based on what you're trying to do.

Regarding positioning (x,y coordinates), the GetWindowRect returns the windows position relative to the overal screen. You can take the returned CRect and use it in a call to ScreenToClient to get the coordinates relative to the control's parent (e.g., the dialog). The GetClientRect will always return 0 and 0 for top and left.

Regarding sizing (cx,cy coordinates) the GetWindowRect size is based on the overall control (including its frame) while the GetClientRect is for getting the control's client area. Therefore GetClientRect will not include the size of the overall window and will usually be a bit smaller than the values returned from GetWindowRect (usually 4 pixels in the case of the default listbox).



Cheers,
Tom Archer
Author, Inside C#
Author, Visual C++.NET Bible

A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the af
GeneralRe: Geting width of my CListbox - Thx Pin
4-May-02 16:10
suss4-May-02 16:10 
GeneralSetting Permanent Margins CEditView :: MFC Pin
valikac4-May-02 12:31
valikac4-May-02 12:31 
GeneralAccesing other programs Pin
4-May-02 11:23
suss4-May-02 11:23 
GeneralRe: Accesing other programs Pin
Gabriel.P.G4-May-02 13:12
Gabriel.P.G4-May-02 13:12 
GeneralRe: Accesing other programs Pin
Nish Nishant4-May-02 14:58
sitebuilderNish Nishant4-May-02 14:58 
GeneralUnresolved External Symbol :( Pin
Derek Lakin4-May-02 11:11
Derek Lakin4-May-02 11:11 
GeneralExporting Classes Pin
Peter Liddle4-May-02 10:45
Peter Liddle4-May-02 10:45 
GeneralRe: Exporting Classes Pin
Paul M Watt4-May-02 12:17
mentorPaul M Watt4-May-02 12:17 
GeneralRe: Exporting Classes Pin
Tom Archer4-May-02 13:58
Tom Archer4-May-02 13:58 
GeneralOverrides using Properties window in VC++ .NET Pin
4-May-02 9:31
suss4-May-02 9:31 
QuestionWhere should I post my TurboC++ / ASM / BIOS question? Pin
Maxwell Chen4-May-02 8:38
Maxwell Chen4-May-02 8:38 
GeneralArray of pointers Pin
Rohde4-May-02 8:16
Rohde4-May-02 8:16 
GeneralRe: Array of pointers Pin
Nish Nishant4-May-02 8:29
sitebuilderNish Nishant4-May-02 8:29 
GeneralRe: Array of pointers Pin
Paul M Watt4-May-02 9:22
mentorPaul M Watt4-May-02 9:22 
GeneralRe: Array of pointers Pin
Maxwell Chen4-May-02 9:33
Maxwell Chen4-May-02 9:33 
GeneralRe: Array of pointers Pin
Christian Graus4-May-02 11:34
protectorChristian Graus4-May-02 11:34 
GeneralRe: Array of pointers Pin
Maxwell Chen4-May-02 20:57
Maxwell Chen4-May-02 20:57 

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.