?
Solved

DoModal()

Posted on 1998-05-13
2
Medium Priority
?
778 Views
Last Modified: 2013-11-20
How can I control the position of the dialog called by DoModal()
0
Comment
Question by:nhcuong
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

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

Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses
Course of the Month13 days, 14 hours left to enroll

801 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