Note that there are some explanatory texts on larger screens.

plurals
  1. POScreen Rotation on Pocket PC
    primarykey
    data
    text
    <p>I am developing an application for pocket PC which should run in landscape mode.</p> <p>I wrote the function SetScreenOrientation(int angle), which rotates the screen. This function is called on application start and on application close. I want to change the screen orientation when I minimize/maximize orientation as well. To do this I edited the following function:</p> <pre><code>void CMainFrame::OnSize(UINT nType, int cx, int cy) { RECT r; GetWindowRect(&amp;r); RECT rstatus; rstatus.left = 0; rstatus.top = 0; rstatus.right = r.right; rstatus.bottom = TOOLBAR_HEIGHT; m_wndStatus.MoveWindow(&amp;rstatus, TRUE); RECT rcamera; rcamera.left = 0; rcamera.top = 0; rcamera.right = r.right; rcamera.bottom = r.bottom - TOOLBAR_HEIGHT; m_wndCameraView.MoveWindow(&amp;rcamera, TRUE); if(nType == SIZE_MAXIMIZED) { CScreenOrientation::SetScreenOrientation(270); } if(nType == SIZE_MINIMIZED) { CScreenOrientation::SetScreenOrientation(0); } } </code></pre> <p>The problem is that when I minimize the application the function is executed more than once so the screen first rotates back to 0 degrees and then it rotates to 270 degrees.</p> <p>While debugging I can see that the second time the function is executed the following piece of wincore code is executed:</p> <pre><code>BOOL CWnd::OnWndMsg(UINT message, WPARAM wParam, LPARAM lParam, LRESULT* pResult) { ... switch (lpEntry-&gt;nSig) { ... case AfxSig_v_u_ii: (this-&gt;*mmf.pfn_v_u_i_i)(static_cast&lt;UINT&gt;(wParam), LOWORD(lParam), HIWORD(lParam)); break; ... } } </code></pre> <p>Does anyone know any other way to set the screen orientation on application minimize/maximize or any trick that could prevent multiple function execution?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload