I've got an MFC app on Windows 10 that has the maximize button disabled as it wasn't designed to be resized. If the program is run not as administrator/elevated then the user can minimize the window to the taskbar and then restore/maximize it like normal. However, if the app is run as administrator/elevated privileges then the window can be minimized to the taskbar but never restored/maximized.
Things I've tried:
This is the log of the successful (non-admin) minimize then maximize where the maximize attempt happened around ID 290: https://pastebin.com/kRT4ABrC
This is the log of the unsuccessful (admin) minimize then maximize where the maximize attempt happened around ID 176: https://pastebin.com/nAiXUa8p
Anyone have any ideas what is wrong? It does look like the unsuccessful log is missing a bunch of WM_ACTIVATEAPP messages, but I'm not sure what else looks off.
"code" necessary for pastebin link posts
Found the issue! I searched our code for "WM" and found a few custom message handlers including one for ON_WM_MOVE (See for more info.). I still don't understand why it causes an issue, but removing it gives us the desired effect. Below is the code that was causing the issue for anyone curious. The positionPages method is custom code that may be the culprit:
void CMyDlg::OnMove(int x, int y)
{
CDialogEx::OnMove(x, y);
positionPages(false); // This keeps the page being displayed in the right location
}