Solved

DoModal()

Posted on 1998-05-13
2
726 Views
Last Modified: 2013-11-20
How can I control the position of the dialog called by DoModal()
0
Comment
Question by:nhcuong
2 Comments
 
LVL 4

Accepted Solution

by:
piano_boxer earned 0 total points
ID: 1310263
The position can be changed in the dialogs own OnInitDialog() function. If you want to position the dialog from where you call DoModal, you need to pass the x/y point in member variables of you dialog class:

CMyDialog dlg;
dlg.m_x = 200;
dlg.m_y = 100;
dlg.DoModal();

---

BOOL CMyDialog::OnInitDialog()
{
    CDialog::OnInitDialog();

    SetWindowPos(NULL, m_x, m_y, 0, 0, SWP_NOZORDER|SWP_NOSIZE);

    return TRUE;
}

-----------------------
2 Points ??????????????
0
 

Author Comment

by:nhcuong
ID: 1310264
I've done as you directed. The position of main dialog or modal
is called by the main dialog change depend where I put SetWindowPos.
But modal always fix over main dialog, that's mean when I the modal
displayed, I can't see the main dialog.


0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

705 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now