How to make the taskbar blink my application like Messenger does when a new message arrive?

后端 未结 5 1007
野的像风
野的像风 2020-12-05 08:01

Is there an API call in .NET or a native DLL that I can use to create similar behaviour as Windows Live Messenger when a response comes from someone I chat with?

5条回答
  •  南方客
    南方客 (楼主)
    2020-12-05 08:36

    HWND hHandle = FindWindow(NULL,"YourApplicationName");
    FLASHWINFO pf;
    pf.cbSize = sizeof(FLASHWINFO);
    pf.hwnd = hHandle;
    pf.dwFlags = FLASHW_TIMER|FLASHW_TRAY; // (or FLASHW_ALL to flash and if it is not minimized)
    pf.uCount = 8;
    pf.dwTimeout = 75;
    
    FlashWindowEx(&pf);
    

    Stolen from experts-exchange member gtokas.

    FlashWindowEx.

提交回复
热议问题