mfc >> maximised dialog box

by free2cric@yahoo.com » Wed, 22 Mar 2006 20:04:39 GMT

Hi,
My application is dialog based application in which I want my dialog
to be occupying whole desktop area except the taskbar portion.

But I am not getting the desired result. It just having size which was
at the time of resource editing.

I have implemented following method.

BOOL CDiaDlg::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Add your specialized code here and/or call the base class
RECT rc;
SystemParametersInfo(SPI_GETWORKAREA, 0, &rc, 0);
cs.cx=rc.right-rc.left;
cs.cy=rc.bottom-rc.top;
cs.x=rc.left;
cs.y=rc.top;
return CDialog::PreCreateWindow(cs);
}

Please help
cric



mfc >> maximised dialog box

by Ajay Kalra » Wed, 22 Mar 2006 21:43:24 GMT


How about calling ShowWindow(SW_MAXIMIZE) on your dialog before its
displayed?

------
Ajay Kalra
XXXX@XXXXX.COM




mfc >> maximised dialog box

by VSP » Wed, 22 Mar 2006 22:18:19 GMT

PreCreateWindow will not be called for Modal Dialogs.
Get the systemparameters info in OnInitDialog and call MoveWindow

-VSP







Similar Threads

1. standard color dialog box inside another dialog box

2. ? Both Help Box AND Minimize Box in Title Bar of MFC Dialog App

    Hi,

    I assume that this question has been asked before but since I can't find
it anywhere...

    How can you put both a question-mark context-sensitive help button AND a
Minimize/Maximize Box in the title bar of a Dialog mode MFC app?


    Thanks




3. How to Update Dialog box (text box) from another Class (none mfc)

4. Edit box in a dialog box

Hi,

    I am trying to create an edit box inside a dialog box during runtime, using
MFC. Mine is a single document/view application.

    The way I am trying to do, is as follows.

    In the OnInitDialog() function of my dialog box(CmyDialog::OnInitDialog()),
I declare a CEdit object and call its Create() function.

    BOOL CmyDialog::OnInitDialog()
    {

    CEdit myEdit;
    
    CDialog::OnInitDialog();

    myEdit.Create(ES_NUMBER | WS_OVERLAPPED | WS_VISIBLE, CRect(0,0,10,10),
		  this, 1);

    myEdit.ShowWindow(SW_SHOWNORMAL); 

    return TRUE;
    }

    I am expecting an edit box to appear in my Dialog box. But it is not. I 
also checked the return status of Create() and ShowWindow() calls. They are 
not zero.

    Can you please let me know what am I doing wrong? Is OnInitDialog() the 
right place to create dynamic controls? If so, is there anything extra I need
to do to make the edit box appear on the dialog box? If not, where should I be
creating the controls?

Thanks in advance,
Learner

5. Getting a value from a Text box in a dialog Box

6. Cannot fill the left-hand list box of toolbar's dialog box

7. dialog controls breaking dialog box...

8. MFC Dialog based application does not hide the dialog box

I am working on a dialog based application with MFC wizard. My requirement is to hide the dialog window upon accepting
a command line option (with_gui) . First of all I would like to know whether this is possible ? If so, please guide me to hide
the dialog box (the one which comes immidiately after running the project) and opening a dos window. Hence, my applicaition
should be able to run in both GUI and CLI mode.

For more information Invokation will be something like thi
1.
c:\> myapp without_gu
The application will run in the same console window printing all the tool messages in the same consol
2.)
c:\> myapp with_gu
A dialog box will popup and user will work on this dialog box further