MoveWindow API causes the "A problem has occurred with gwes.exe" error for me
under the both PPC WM50 Emulator and real device. At the same time the
MoveWindow changes the target window size as it should to and it looks like
everything works ok except of the gwes error popped. The parameters passed to
the MoveWindow looks like correct. Below is a cut from source code:
-------------------------------------------------------------------------------------------
SHMENUBARINFO mbi;
RECT rc, rcMenuBar;
// Create the window
const TCHAR* name = _T("Dummy");
hwndMainFrame = CreateWindow((const TCHAR*)mainFrameClass.classAtom, name,
//WS_CAPTION | WS_SYSMENU | WS_THICKFRAME |
WS_MINIMIZEBOX,
WS_SYSMENU,
CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT,
NULL, NULL,
mainFrameClass.instance, this);
if (!hwndMainFrame)
{
throw rdr::SystemException("unable to create MainClient window
instance", GetLastError());
}
memset(&mbi, 0, sizeof(SHMENUBARINFO));
mbi.cbSize = sizeof(SHMENUBARINFO);
mbi.hwndParent = hwndMainFrame;
mbi.nToolBarId = IDR_MENU;
mbi.hInstRes = ::GetModuleHandle(NULL);
if (!::SHCreateMenuBar(&mbi))
{
throw rdr::SystemException("unable to create menu bar", GetLastError());
}
m_hMenu = mbi.hwndMB;
::ShowWindow(m_hMenu, SW_HIDE);
::ShowWindow(hwndMainFrame, SW_HIDE);
GetWindowRect(hwndMainFrame, &rc);
GetWindowRect(m_hMenu, &rcMenuBar);
rc.bottom -= (rcMenuBar.bottom - rcMenuBar.top);
// The following MoveWindow caused the gwes error !!!!!!!!!!!!!!!!!!!!
::MoveWindow(hwndMainFrame, rc.left, rc.top,
rc.right - rc.left,
rc.bottom - rc.top,
FALSE)
------------------------------------------------------------------------------------------
Once the MoveWindow is commented out everything works with no errors.
Visual Studio Debugger doesn't stop when the error is popping. The
Application Verifier gives nothing regarding the error.
Is there any way to fix the problem, please?
Many thanks.