<p>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.</p>

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

[{'answer_id': 74719, 'author': 'ageektrapped', 'author_id': 631, 'author_profile': 'https://Stackoverflow.com/users/631', 'pm_score': 0, 'selected': False, 'text': "<p>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</p>\n"}, {'answer_id': 74775, 'author': 'ctacke', 'author_id': 13154, 'author_profile': 'https://Stackoverflow.com/users/13154', 'pm_score': 2, 'selected': False, 'text': '<p>Take a look at <a href="http://msdn.microsoft.com/en-us/library/aa453682.aspx" rel="nofollow noreferrer">SHDoneButton</a> API.</p>\n'}, {'answer_id': 75346, 'author': 'Jack Snipes', 'author_id': 1382, 'author_profile': 'https://Stackoverflow.com/users/1382', 'pm_score': 3, 'selected': True, 'text': '<p>With Windows Mobile 5.0 and higher, using the CreateWindowEx function passing it WS_EX_CAPTIONOKBTN for the extended style works.</p>\n\n<p>@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.</p>\n'}]
['https://Stackoverflow.com/questions/74696', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/1382/']