Compartilhar via


WM_SIZE Code Example

Windows Mobile SupportedWindows Embedded CE Not Supported

9/8/2008

Use o WM_SIZE notificação para detecção rotações Tela para e executando processamento em todos os completo-Tela aplicativo Windows. O seguinte codificar é um exemplo de do uma janela WndProc função que inclui uma maiúsculas e minúsculas declaração para manipulação de WM_SIZE notificação.

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;
    }
}

See Also

Concepts

WM_SETTINGCHANGE Code Example

Other Resources

Screen Orientation Modes