PPC - Screen rotation

From YYpBD's MediaWiki

Jump to: navigation, search

LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
    switch (message)
     {
         // The code for handling other Windows messages has been omitted for clarity.
         // ...
        case WM_SIZE:
            {
                INT nWidth = LOWORD(lParam);
                HWND hEditBox = GetDlgItem(hWnd, IDC_EDIT);
                HWND hEnterButton = GetDlgItem(hWnd, IDC_BUTTON);

                MoveWindow(hEditBox, 8, 4, nWidth - 70, 20, TRUE);
                MoveWindow(hEnterButton, nWidth - 57, 4, 50, 20, TRUE);
            }
            break;
    }
}



LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
    switch (message)
    {
         // The code for handling other Windows messages has been omitted for clarity.
         // ...
        case WM_SETTINGCHANGE:
            {
                if (wParam == SETTINGCHANGE_RESET)
                {
                    // The processing done here can include
                    // resizing full-screen child windows
                    // and calling the Windows CE MoveWindow function
                    // on top-level windows.
                    INT nWidth = GetSystemMetrics(SM_CXSCREEN);
                    HWND hEditBox = GetDlgItem(hWnd, IDC_EDIT);
                    HWND hEnterButton = GetDlgItem(hWnd, IDC_BUTTON);

                    MoveWindow(hEditBox, 8, 4, nWidth - 0, 20, TRUE);
                    MoveWindow(hEnterButton, nWidth - 57, 4, 50, 20, TRUE);
                }
            }
            break;
    }
}

맞춤검색