QA: How to remove smart minimize (X) button from the taskbar?

Vassili Philippov (vasja@spbteam.com), March 05, 2001.

Question

All Pocket PC 2002 applications contain either OK or X button on the right side of the taskbar. I want to remove them both. How can I do it?

Answer

Pocket PC 2002 shell adds smart minimize (X) button to the applications that do not have OK button. To add/remove OK button use SHDoneButton function. To remove smart minimize (X) button you should add WS_NONAVDONEBUTTON to the style.

Source code

Here is eVC++ code that removes smart minimize (X) button:

ModifyStyle(0, WS_NONAVDONEBUTTON, SWP_NOSIZE);

If you want to create a dialog without neither OK nor smart minimize (X) buttons you can add the following code in the OnInitDialog method of your dialog:

SHDoneButton(m_hWnd, SHDB_HIDE); ModifyStyle(0, WS_NONAVDONEBUTTON, SWP_NOSIZE);

Related resources: