PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Resolve some problems

After minimize and expand window in Win32 version flag m_bAppShouldMinimize always is TRUE

in GapiApplication.cpp find:

Code:
HRESULT CGapiApplication::MainLoop()
....
#ifdef _WIN32_WCE
// Check to see if the window should be minimized
if (m_bAppShouldMinimize)
{
::PostMessage(m_hWnd, WM_USER_MINIMIZE, 0, 0);
m_bAppShouldMinimize = FALSE;
}
#endif


replace with:

Code:
HRESULT CGapiApplication::MainLoop()
....
// Check to see if the window should be minimized
if (m_bAppShouldMinimize)
{
#ifdef _WIN32_WCE
::PostMessage(m_hWnd, WM_USER_MINIMIZE, 0, 0);
#endif
m_bAppShouldMinimize = FALSE;
}



Resolve problem on incoming call:
Code:

LRESULT CGapiApplication::WindowProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
.......
case WM_PAINT:
#ifdef WINCE
if (m_bActiveWindow && !m_bAppShouldMinimize)
#endif
m_pDisplay->Flip();
break;
Hey,

Digging up this old thread I see that your first example does not match the code in GapiDraw 3.6. GapiDraw 3.6b does not have any "#ifdef _WIN32_WC" encapsulating the if (m_bAppShouldMinimize).

Can you please elaborate this one?

Will not make it into 3.7, but can make a quick patch shortly if it's needed.

Cheers
Johan
Johan wrote:Hey,

Digging up this old thread I see that your first example does not match the code in GapiDraw 3.6. GapiDraw 3.6b does not have any "#ifdef _WIN32_WC" encapsulating the if (m_bAppShouldMinimize).

Can you please elaborate this one?

Will not make it into 3.7, but can make a quick patch shortly if it's needed.

Cheers
Johan


Sorry.
I was remove m_pDisplay->Flip(); from CGapiApplication::MainLoop(), and call Flip() when it need.
because screen not need to redraw at each iteration of MainLoop() (problem with ~100% CPU load).