Click here to Skip to main content
15,925,782 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionResize based on screen resolution Pin
NYTSX30-May-06 4:33
NYTSX30-May-06 4:33 
AnswerRe: Resize based on screen resolution Pin
Zac Howland30-May-06 5:26
Zac Howland30-May-06 5:26 
You can always use the GetSystemMetrics API with the Screen Width and Height values and do some math to size your control properly (I assume you don't want the control to take up the entire screen). Something like the following:
<br />
// there is a CWnd-derived object for the control declared somewhere<br />
const int ScreenWidth = ::GetSystemMetrics(SM_CXSCREEN);<br />
const int ScreenHeight = ::GetSystemMetrics(SM_CYSCREEN);<br />
<br />
CRect ControlRect;<br />
ControlRect.top = 100;   // start control 100 pixels from the top of the screen<br />
ControlRect.left = 50;   // start control 100 pixels from the left of the screen<br />
ControlRect.right = ControlRect.left + 300;   // make the control 300 pixels wide<br />
ControlRect.bottom = ScreenHeight - 50;   // make bottom 50 pixels above bottom of screen<br />
<br />
wndMyControl.MoveWindow(&ControlRect, TRUE);<br />


If you wanted the control on the right side, use the width variable and subtract the desired value from the starting place (and adjust your left value accordingly).

If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week

Zac
AnswerRe: Resize based on screen resolution Pin
Hamid_RT30-May-06 7:55
Hamid_RT30-May-06 7:55 
AnswerRe: Resize based on screen resolution Pin
harilal31-May-06 0:42
harilal31-May-06 0:42 
QuestionReading physical memory Pin
aaaan30-May-06 2:30
aaaan30-May-06 2:30 
AnswerRe: Reading physical memory Pin
toxcct30-May-06 3:05
toxcct30-May-06 3:05 
AnswerRe: Reading physical memory Pin
Chris Losinger30-May-06 3:17
professionalChris Losinger30-May-06 3:17 
AnswerRe: Reading physical memory Pin
Roger Stoltz30-May-06 3:32
Roger Stoltz30-May-06 3:32 
GeneralRe: Reading physical memory Pin
toxcct30-May-06 3:34
toxcct30-May-06 3:34 
GeneralRe: Reading physical memory Pin
Roger Stoltz30-May-06 3:39
Roger Stoltz30-May-06 3:39 
GeneralRe: Reading physical memory Pin
aaaan30-May-06 3:59
aaaan30-May-06 3:59 
AnswerRe: Reading physical memory Pin
Roger Stoltz30-May-06 4:11
Roger Stoltz30-May-06 4:11 
GeneralRe: Reading physical memory Pin
aaaan30-May-06 19:03
aaaan30-May-06 19:03 
GeneralRe: Reading physical memory Pin
Roger Stoltz30-May-06 21:40
Roger Stoltz30-May-06 21:40 
GeneralRe: Reading physical memory Pin
normanS30-May-06 19:06
normanS30-May-06 19:06 
GeneralRe: Reading physical memory Pin
Roger Stoltz30-May-06 21:42
Roger Stoltz30-May-06 21:42 
QuestionBlinking effect in Cwnd child window Pin
aragornx30-May-06 2:17
aragornx30-May-06 2:17 
AnswerRe: Blinking effect in Cwnd child window Pin
Optimus Chaos30-May-06 21:05
Optimus Chaos30-May-06 21:05 
GeneralRe: Blinking effect in Cwnd child window Pin
aragornx30-May-06 23:48
aragornx30-May-06 23:48 
QuestionUrgent :- How to Convert char* to LPWSTR Pin
Rocky Marrone30-May-06 2:08
Rocky Marrone30-May-06 2:08 
AnswerRe: Urgent :- How to Convert char* to LPWSTR Pin
Naveen30-May-06 2:12
Naveen30-May-06 2:12 
AnswerRe: Urgent :- How to Convert char* to LPWSTR Pin
Hamid_RT30-May-06 3:40
Hamid_RT30-May-06 3:40 
GeneralRe: Urgent :- How to Convert char* to LPWSTR Pin
PJ Arends30-May-06 7:33
professionalPJ Arends30-May-06 7:33 
GeneralRe: Urgent :- How to Convert char* to LPWSTR Pin
Hamid_RT30-May-06 8:11
Hamid_RT30-May-06 8:11 
AnswerRe: Urgent :- How to Convert char* to LPWSTR Pin
Sarath C30-May-06 4:18
Sarath C30-May-06 4:18 

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.