Advertisement
Advertisement


On Windows Mobile device, what is the best way to display an OK button instead of the X button?


Question

I have a C++ program that when run, by default, displays the X in the upper right corner. Clicking X, minimizes the program. I've added code using the SHInitDialog function to change the X to OK, so that clicking OK exits the program.

My question: Is there a better method that applies to the window, since SHInitDialog works best with Dialog Boxes?

2008/09/16
1
2
9/16/2008 5:15:49 PM

Accepted Answer

With Windows Mobile 5.0 and higher, using the CreateWindowEx function passing it WS_EX_CAPTIONOKBTN for the extended style works.

@ctacke SHDoneButton may have also worked but I wanted to change the main window without handling it like a dialogbox, which is basically what SHInitDialog is doing.

2008/09/16
2
9/16/2008 6:18:32 PM


Not sure how it's done in C++, but in .NET if you set the MinimizeBox property to false, you get an OK button. Since .NET Windows code is fancy wrapper code, there should be a C++ equivalent

2008/09/16

Source: https://stackoverflow.com/questions/74696
Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Email: [email protected]