Click here to Skip to main content
15,887,267 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Program terminates [modified] Pin
Chris Losinger26-Oct-07 8:31
professionalChris Losinger26-Oct-07 8:31 
GeneralRe: Program terminates Pin
pourang26-Oct-07 8:34
pourang26-Oct-07 8:34 
GeneralRe: Program terminates Pin
pourang26-Oct-07 8:36
pourang26-Oct-07 8:36 
QuestionRe: Program terminates Pin
David Crow26-Oct-07 8:37
David Crow26-Oct-07 8:37 
AnswerRe: Program terminates Pin
Chris Losinger26-Oct-07 9:10
professionalChris Losinger26-Oct-07 9:10 
QuestionCWinApp::OnIdle problem?? Pin
SandipG 26-Oct-07 8:01
SandipG 26-Oct-07 8:01 
QuestionDialog based application for different screen resolutions Pin
victoria195026-Oct-07 7:47
victoria195026-Oct-07 7:47 
AnswerRe: Dialog based application for different screen resolutions [modified] Pin
Mattias G26-Oct-07 13:41
Mattias G26-Oct-07 13:41 
Is it really necessary to use a dialog? A simpler option would be to create an ordinary window filling the screen (remember to consider multiple screens when calling GetSystemMetrics) and then populating that window with controls. (The size of dialogs aren't actually related to pixels, but are calculated in terms of "dialog base units" (something that has to do with the size of the default font). Even if you manage to resize your dialog to fill the screen in different resolutions, the dialog will appear different depending on the user's selection for default font.)

If you really have to use a dialog, one option would be to use PostMessage(WM_SIZE, ...) in your OnInitDialog, and the on OnSize reposition the controls using the relative positions derived from the resource. Something in the line of:

<br />
BeginDeferWindowPos(...)<br />
for(i = 0; i < m_nNumCtrls; i ++){<br />
   // calculate new control position and size<br />
   // based on how the control is placed and sized<br />
   // in the original resource in relation to client<br />
   // area of the newly resized window<br />
   DeferWindowPos(...) <br />
}<br />
EndDeferWindowPos(...)<br />



-- modified at 19:59 Friday 26th October, 2007
AnswerRe: Dialog based application for different screen resolutions Pin
MANISH RASTOGI26-Oct-07 18:52
MANISH RASTOGI26-Oct-07 18:52 
AnswerRe: Dialog based application for different screen resolutions Pin
Nelek28-Oct-07 23:24
protectorNelek28-Oct-07 23:24 
QuestionLink error _imp_ Pin
ewpendleton26-Oct-07 6:44
ewpendleton26-Oct-07 6:44 
QuestionRe: Link error _imp_ Pin
Hamid_RT26-Oct-07 7:02
Hamid_RT26-Oct-07 7:02 
AnswerRe: Link error _imp_ Pin
ewpendleton26-Oct-07 9:26
ewpendleton26-Oct-07 9:26 
AnswerRe: Link error _imp_ Pin
Chris Losinger26-Oct-07 9:15
professionalChris Losinger26-Oct-07 9:15 
Questioncompile error,please help me, Pin
nhathoang26-Oct-07 5:48
nhathoang26-Oct-07 5:48 
AnswerRe: compile error,please help me, Pin
Mark Salsbery26-Oct-07 5:56
Mark Salsbery26-Oct-07 5:56 
GeneralRe: compile error,please help me, Pin
nhathoang26-Oct-07 7:21
nhathoang26-Oct-07 7:21 
GeneralRe: compile error,please help me, Pin
Mark Salsbery26-Oct-07 7:53
Mark Salsbery26-Oct-07 7:53 
GeneralRe: compile error,please help me, Pin
nhathoang26-Oct-07 8:37
nhathoang26-Oct-07 8:37 
GeneralRe: compile error,please help me, Pin
Mark Salsbery26-Oct-07 8:53
Mark Salsbery26-Oct-07 8:53 
JokeRe: compile error,please help me, Pin
David Crow26-Oct-07 9:21
David Crow26-Oct-07 9:21 
GeneralRe: compile error,please help me, Pin
Mark Salsbery26-Oct-07 9:36
Mark Salsbery26-Oct-07 9:36 
GeneralRe: compile error,please help me, Pin
nhathoang26-Oct-07 10:05
nhathoang26-Oct-07 10:05 
GeneralRe: compile error,please help me, Pin
Fernando A. Gomez F.26-Oct-07 18:08
Fernando A. Gomez F.26-Oct-07 18:08 
GeneralRe: compile error,please help me, Pin
nhathoang26-Oct-07 21:55
nhathoang26-Oct-07 21:55 

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.