Modal and non-modal windows

Source: Internet
Author: User

Introduction to the modal and non-modal windows in WinCE

I. Create

Create a non-modal window

Code
Fivelistwnd * Five = New Fivelistwnd ();
Five -> Create ( 0 , 0 , 400 , 600 , M_hwnd, 0 , 0 );
Five -> Setbgcolor (RGB ( 255 , 255 , 255 ))
Five -> Show ();

Create a modal window

 

Code
1 Fivelistwnd five;
2 Five. Create ( 0 , 0 , 400 , 600 , M_hwnd, 0 , 0 );
3 Five. setbgcolor (RGB ( 255 , 255 , 255 ))
4 Five. domodal ();

Ii. Differences

1. After the mode window is opened, the input focus is always maintained. You cannot switch to the parent window unless the window is closed.
In the non-modal window, you can move the focus to the parent window. You can use show (false) to switch the window)

Second, we can see from the above that the non-modal window must be new

Third, the method for closing the window is different.

To use cwnd: destroywindow for a non-modal window

Use cdialog :: enddialog in the modal window

Because the non-modal window is new, delete is required at last. Although destroywindow (), the window instance is not destructed.

Iii. Note

Create ( 0 , 0 , 400 , 600 , M_hwnd, 0 , 0 );

M_hwnd in is the handle of the parent window. In the five window, that is, the subwindow, you can use getparent () to obtain the handle of its parent window.

Introduction to the modal and non-modal windows in WinCE

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.