BOOL FlashWindow( BOOL bInvert );Return ValueNonzero if the window was active before the call to the FlashWindow member function; otherwise 0.ParametersbInvertSpecifies whether the CWnd is to be flashed or returned to its original state. The CWnd is flashed from one state to the other if bInvert is TRUE. If bInvert is FALSE, the window is returned to its original state (either active or inactive).
BOOL FlashWindow( HWND hWnd, // handle to window BOOL bInvert // flash status ); hWnd:[in] Handle to the window to be flashed. The window can be either open or minimized. bInvert:[in] Specifies whether the window is to be flashed or returned to its original state. The window is flashed from one state to the other if this parameter is TRUE. If it is FALSE, the window is returned to its original state (either active or inactive). When an application is minimized, if this parameter is TRUE, the taskbar window button flashes active/inactive. If it is FALSE, the taskbar window button flashes inactive, meaning that it does not change colors. It flashes, as if it were being redraw, but it does not provide the visual invert clue to the user.
HWND hWnd, // handle to window
BOOL bInvert // flash status
);
hWnd:[in] Handle to the window to be flashed. The window can be either open or minimized.
bInvert:[in] Specifies whether the window is to be flashed or returned to its original state. The window is flashed from one state to the other if this parameter is TRUE. If it is FALSE, the window is returned to its original state (either active or inactive). When an application is minimized, if this parameter is TRUE, the taskbar window button flashes active/inactive. If it is FALSE, the taskbar window button flashes inactive, meaning that it does not change colors. It flashes, as if it were being redraw, but it does not provide the visual invert clue to the user.
for(n=0;n<=6;n++)
{
FlashWindow(n%2);
Sleep(500);
}
其实也不是完全不行,有时候变蓝之后,我点击它就会恢复,但有时候却怎么点击它还是显蓝色,这似乎毫无道理啊!