Solved

DoModal()

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
windows 10 how make picture as desktop background 2 72
post4 challenge 28 121
Use of condition with 'serial' in ansible 2 101
Work with App store 7 121
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

737 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