Prohibition of dialog box under WinCe3.0 operating system full screen display

zhaozj2021-02-17  70

Nowadays, there are many palms, such as Hengji Weiye's palm, Lenovo's Tianzhu and other embedded a Microsoft's Wince operating system. If you buy a PDA for embedding Wince 2.0 operating system, it is OK. But if you buy a PDA of embedd Wince3.0 operating system, you find that the dialog box shown under this operating system is full screen! This approach, not only let me see the uncomfortable, and there is a lot of trouble in many practical applications! ! Then, how do we have a dialog box to display in the programming of our developers?

In fact, this is not difficult to implement, but it is only too little book on WinCe programming in the bookstore. To be available from the Internet! Oh, I will say a few nonsensers when I accidentally. Ok, let's go forward!

To prohibit the dialog box under WinCe3.0 operating system, there are two ways (using programming tools).

The first method is relatively straightforward. It is to use Microsoft to secretly sneak in a variable m_bfullscreen in the dialog box. I can't help but have two words, good dialog box, you have a full screen display! The full screen is specified, and it is not bored with a variable that controls full screen! Ok, the air is over, let's continue! This variable is a Bool type variable. When it is True, the dialog will be full screen. The default is of course true, so we have to set this variable to false before the dialog is initialized. See the example (here you assume your dialog class name cxxxdlg):

Bool cxxxdlg :: oninitdialog ()

{

m_bfullscreen = false;

CDIALOG :: OnInitdialog ();

..........

..........

..........

Return True;

}

Look, it is so simple, compiled, your dialog is no longer full screen!

The second method is to remove CDIALOG :: OnNitDialog () in the OnInitDialog () function of the dialog, replace it with the following statement:

Shinitdlginfo shidi;

HWND HDLG = M_HWND;

Shidi.dwmask = shidim_flags;

Shidi.dwflags = shidif_sipdown;

Shidi.hdlg = HDLG;

ShinitDialog (& shiDi);

In doing so, it is equivalent to creating a new type of dialog that the parameters of the structure can refer to the MSDN description of the EVC.

The above briefly introduces how to disable the dialog box under the WinCe 3.0 operating system, but in the first method, if the virtual keyboard is popled up during the program run, the dialog will be displayed again. Therefore, we must process the WM_SETTINGETTINGE message of the dialog box.

First, we need to join the function declaration in cxxxdlg.h:

AFX_MSG ONSETTINGECIGE ();

Follow, we have to join the function in cxxxdlg.cpp:

INT cxxxdlg :: oversettingchange ()

{

Return 1;

}

This function is not dry, just return 1.

Finally, ON_WM_SETTINGCHANGE () is added to the message table.

Ok, now you can run your dialog program again, what? Did you solve your problem? If you have any questions, then email contact: 19776655@163.com.

转载请注明原文地址:https://www.9cbs.com/read-31123.html

New Post(0)