views:

55

answers:

1

Hi, I created a WinCE dialog based application. I want to add minimize option at the top right corner.

If i create an MFC dialog based application, a checkbox will be present for Minimize button asking whether minimize is required for the dialog being created.

But if i create MFC Application for SmartDevice, minimize checkbox will not be given at the time of creation of project. Also, Minimize property is not present in properties list of the Dialog.

Pls help me in solving the issue.

+3  A: 

This is becasue WIndows Mobile doesn't really have the concept of minimizing and app to the task bar (as there is no task bar).

WinMo has "smart minimize" meaning which means that the Windows doesn't close, but instead moves back in the Z-Order, yes is still subject to closing by the OS if memory pressure gets high.

If you set the WS_MINIMIZEBOX style bit, you will get an (X) in the upper right, which is the smart-minimize button. If that bit is not set you will get an (ok) button, which fully closes the window.

ctacke
@ctacke: I am working with a dialog based application. In that i am setting system menu property to true. In the resource editor, it shows X button. But when i run the application, dialog will not have X button. It will have ok button only. Pls let me know what went wrong
bjskishore123
@ctacke: Is WS_MINIMIZEBOX only for Single document application or it can be used for dialog based application as well ? If it can be used, how ?
bjskishore123
All WinMo/WinCE apps are dialog based because the OS doesn't support MDI. If you're using *modal* dialogs, you won't get a minimize option, but otherwise you can use WS_MINIMIZE for any dialog.
ctacke
@ctacke: Sorry, i am not getting how. Which function to call. Could you pls tell that ?
bjskishore123
I don't use MFC, so I don't specifically know an MFC way to do it. You could always use Win32 calls to Get/SetWindowLong with GWL_STYLE to add the bit.
ctacke