WM_SHOWWINDOW
The WM_SHOWWINDOW message is sent to a window when the window is about to be hidden or shown. A window receives this message through its WindowProc function. LRESULT CALLBACK WindowProc(
  HWND hwnd,       // handle to window
  UINT uMsg,       // WM_SHOWWINDOW
  WPARAM wParam,   // show flag (BOOL)
  LPARAM lParam    // status flag
);

解决方案 »

  1.   

    你还是照WhiteWaterBlueSky(疯狂数码) 的办法做吧,毕竟跟WindowProc打交道不爽
      

  2.   

    WM_SIZE 响应的是窗口大小的改变。
    我想对最小化和恢复时分别做不同的反应。
    请问如何做到?
      

  3.   

    WM_SYSCOMMAND 
    uCmdType = wParam;        // type of system command requested 
    xPos = LOWORD(lParam);    // horizontal position, in screen coordinates 
    yPos = HIWORD(lParam);    // vertical position, in screen coordinates 
     
    Parameters
    uCmdType 
    Specifies the type of system command requested. This parameter can be one of the following values. Value Meaning 
    SC_CLOSE Closes the window. 
    SC_CONTEXTHELP Changes the cursor to a question  with a pointer. If the user then clicks a control in the dialog box, the control receives a WM_HELP message. 
    SC_DEFAULT Selects the default item; the user double-clicked the window menu. 
    SC_HOTKEY Activates the window associated with the application-specified hot key. The low-order word of lParam identifies the window to activate. 
    SC_HSCROLL Scrolls horizontally. 
    SC_KEYMENU Retrieves the window menu as a result of a keystroke. 
    SC_MAXIMIZE Maximizes the window. 
    SC_MINIMIZE Minimizes the window. 
    SC_MONITORPOWER   Sets the state of the display. This command supports devices that have power-saving features, such as a battery-powered personal computer.
    lParam can have the following values:1 means the display is going to low power.2 means the display is being shut off.
     
    SC_MOUSEMENU Retrieves the window menu as a result of a mouse click. 
    SC_MOVE Moves the window. 
    SC_NEXTWINDOW Moves to the next window. 
    SC_PREVWINDOW Moves to the previous window. 
    SC_RESTORE Restores the window to its normal position and size. 
    SC_SCREENSAVE Executes the screen saver application specified in the [boot] section of the SYSTEM.INI file. 
    SC_SIZE Sizes the window. 
    SC_TASKLIST Activates the Start menu. 
    SC_VSCROLL Scrolls vertically. 
    xPos 
    Specifies the horizontal position of the cursor, in screen coordinates, if a window menu command is chosen with the mouse. Otherwise, the xPos parameter is not used. 
    yPos 
    Specifies the vertical position of the cursor, in screen coordinates, if a window menu command is chosen with the mouse. This parameter is –1 if the command is chosen using a system accelerator, or zero if using a mnenomic. 
    Return Values