Click here to Skip to main content
15,877,574 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: How to get screen size in millimeters or inches? Pin
includeh1026-Jan-06 18:54
includeh1026-Jan-06 18:54 
QuestionRe: How to get screen size in millimeters or inches? Pin
David Crow27-Jan-06 3:34
David Crow27-Jan-06 3:34 
AnswerRe: How to get screen size in millimeters or inches? Pin
includeh1027-Jan-06 14:59
includeh1027-Jan-06 14:59 
QuestionWM_NCPAINT minimize/restore Pin
picazo26-Jan-06 13:00
picazo26-Jan-06 13:00 
AnswerRe: WM_NCPAINT minimize/restore Pin
includeh1026-Jan-06 15:35
includeh1026-Jan-06 15:35 
GeneralRe: WM_NCPAINT minimize/restore Pin
picazo26-Jan-06 18:17
picazo26-Jan-06 18:17 
GeneralRe: WM_NCPAINT minimize/restore Pin
includeh1026-Jan-06 21:05
includeh1026-Jan-06 21:05 
QuestionDialog Full Screen Pin
JBAK_CP26-Jan-06 11:51
JBAK_CP26-Jan-06 11:51 
I have a dialog box with some buttons, etc, and I wanted to make the dialog box full screen, and I was able to do that without any problems(using the code below). But I noticed that when it's full screen, that basically my dialog box has been shifted to the top left corner, with rest of the screen filled in gray to create the "full screen" effect. What I really want is my dialog to be in the center, with gray filled in around it to create the "full screen" effect. Is there any possible way to do this? Thank you!

This is where my controls show up in full screen
-----------
xxx


-----------

I would like to have my controls show up in the middle of the full screen
-----------

----xxxx---

-----------


Code I have to make it full screen:

int cx, cy;
HDC dc = ::GetDC(NULL);
cx = GetDeviceCaps(dc,HORZRES) +
GetSystemMetrics(SM_CXBORDER);
cy = GetDeviceCaps(dc,VERTRES) +
GetSystemMetrics(SM_CYBORDER);
::ReleaseDC(0,dc);

// Remove caption and border
SetWindowLong(m_hWnd, GWL_STYLE,
GetWindowLong(m_hWnd, GWL_STYLE) &
(~(WS_CAPTION | WS_BORDER)));


// Put window on top and expand it to fill screen
::SetWindowPos(m_hWnd, HWND_NOTOPMOST,
-(GetSystemMetrics(SM_CXBORDER)+1),
-(GetSystemMetrics(SM_CYBORDER)+1),
cx+1,cy+1, SWP_NOZORDER);


-- modified at 17:52 Thursday 26th January, 2006
AnswerRe: Dialog Full Screen Pin
Stephen Hewitt26-Jan-06 13:01
Stephen Hewitt26-Jan-06 13:01 
GeneralRe: Dialog Full Screen Pin
JBAK_CP26-Jan-06 13:26
JBAK_CP26-Jan-06 13:26 
QuestionIP Header Pin
Mohammad A Gdeisat26-Jan-06 11:44
Mohammad A Gdeisat26-Jan-06 11:44 
AnswerRe: IP Header Pin
Gerald Schwab26-Jan-06 12:59
Gerald Schwab26-Jan-06 12:59 
AnswerRe: IP Header Pin
Sebastian Schneider27-Jan-06 0:44
Sebastian Schneider27-Jan-06 0:44 
GeneralRe: IP Header Pin
Mohammad A Gdeisat27-Jan-06 2:00
Mohammad A Gdeisat27-Jan-06 2:00 
QuestionMove button at runtime Pin
masnu26-Jan-06 9:34
masnu26-Jan-06 9:34 
AnswerRe: Move button at runtime Pin
David Crow26-Jan-06 9:58
David Crow26-Jan-06 9:58 
GeneralRe: Move button at runtime Pin
masnu26-Jan-06 10:07
masnu26-Jan-06 10:07 
AnswerRe: Move button at runtime Pin
MANISH RASTOGI26-Jan-06 17:27
MANISH RASTOGI26-Jan-06 17:27 
AnswerRe: Move button at runtime Pin
Michael Dunn26-Jan-06 20:37
sitebuilderMichael Dunn26-Jan-06 20:37 
AnswerRe: Move button at runtime Pin
toxcct26-Jan-06 21:59
toxcct26-Jan-06 21:59 
GeneralRe: Move button at runtime Pin
Owner drawn26-Jan-06 23:35
Owner drawn26-Jan-06 23:35 
Questionchild frame fills main frame? Pin
LeeeNN26-Jan-06 7:52
LeeeNN26-Jan-06 7:52 
Questionsplitter window dynamic merge too panes. Pin
LeeeNN26-Jan-06 7:46
LeeeNN26-Jan-06 7:46 
AnswerRe: splitter window dynamic merge too panes. Pin
David Crow26-Jan-06 8:13
David Crow26-Jan-06 8:13 
QuestionPainting in "CFormView::OnPaint" over controls Pin
AnTri26-Jan-06 7:41
AnTri26-Jan-06 7:41 

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.