Solved

DoModal()

Posted on 1998-05-13
2
747 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Windows Drag & Drop Location 2 100
Looking for a specific application/software 2 109
sum67 challenge 35 97
My project did see openJDK that I installed. What could be the problem 7 140
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
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.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

808 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