whats after domodal? - Programmer

This is a discussion on whats after domodal? - Programmer ; i have a dialog box that is started by way of CDialog: oModal(). After the dialog box is visible, I want the newly visible dialog box to start in on a particular scan. Within the dialog box are various indicators ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: whats after domodal?

  1. whats after domodal?

    i have a dialog box that is started by way of CDialog:oModal(). After the
    dialog box is visible, I want the newly visible dialog box to start in on a
    particular scan. Within the dialog box are various indicators used to tell
    the user where the dialog box is in the scan. What event do i need to look
    for to have it start the scan?

    thanks in advance,
    ed



  2. Re: whats after domodal?

    ed wrote:
    > i have a dialog box that is started by way of CDialog:oModal(). After the
    > dialog box is visible, I want the newly visible dialog box to start in on a
    > particular scan. Within the dialog box are various indicators used to tell
    > the user where the dialog box is in the scan. What event do i need to look
    > for to have it start the scan?
    >
    > thanks in advance,
    > ed
    >
    >


    There is no standard event after the dialog is visible. But you can
    make one by posting a user-defined message from OnInitDialog.

    #define UDM_START_SCAN (WM_APP+1)

    // in OnInitDialog
    PostMessage(UDM_START_SCAN, 0, 0);

    // in message map
    ON_MESSAGE(UDM_START_SCAN, OnStartScan)

    // called after dialog is visible
    LRESULT CxxxDialog::OnStartScan(WPARAM, LPARAM)
    {

    return 0;
    }

    --
    Scott McPhillips [VC++ MVP]


  3. Re: whats after domodal?

    by posting the message during OnInitDialog won't that start the scan before
    its visible sinse the dialog box isn't visible until after OnInitDialog
    returns a value?

    ed


    "Scott McPhillips [MVP]" wrote in message
    news:NbSdnTsI3doeJ9TdRVn-hQ@comcast.com...
    > ed wrote:
    > > i have a dialog box that is started by way of CDialog:oModal(). After

    the
    > > dialog box is visible, I want the newly visible dialog box to start in

    on a
    > > particular scan. Within the dialog box are various indicators used to

    tell
    > > the user where the dialog box is in the scan. What event do i need to

    look
    > > for to have it start the scan?
    > >
    > > thanks in advance,
    > > ed
    > >
    > >

    >
    > There is no standard event after the dialog is visible. But you can
    > make one by posting a user-defined message from OnInitDialog.
    >
    > #define UDM_START_SCAN (WM_APP+1)
    >
    > // in OnInitDialog
    > PostMessage(UDM_START_SCAN, 0, 0);
    >
    > // in message map
    > ON_MESSAGE(UDM_START_SCAN, OnStartScan)
    >
    > // called after dialog is visible
    > LRESULT CxxxDialog::OnStartScan(WPARAM, LPARAM)
    > {
    >
    > return 0;
    > }
    >
    > --
    > Scott McPhillips [VC++ MVP]
    >




  4. Re: whats after domodal?

    ed wrote:
    > by posting the message during OnInitDialog won't that start the scan before
    > its visible sinse the dialog box isn't visible until after OnInitDialog
    > returns a value?
    >
    > ed


    Messages are processed one at a time. The message is not processed
    until after OnInitDialog returns.


    --
    Scott McPhillips [VC++ MVP]


+ Reply to Thread