FlashWindow_() How to "unflash"?
FlashWindow_() How to "unflash"?
Hello, i am using FlashWindow_() and then after a couple of seconds i want it to go back to its original state. I tried "FlashWindowEx_() with #FLASHW_STOP which makes the window stop pulsing but how can i remove the orange highlight on the taskbar without giving the window focus?
Re: FlashWindow_() How to "unflash"?
Example:
But the window remains highlighted orange in the taskbar until it is activated. I want to undo the highlight without giving the window focus.
Code: Select all
EnableExplicit
Define Window.i, WindowEvent.i, Timer.i
Window = OpenWindow(#PB_Any, 0, 0, 500, 500, "Window", #PB_Window_MinimizeGadget | #PB_Window_ScreenCentered)
SetWindowState(Window, #PB_Window_Minimize)
FlashWindow_(WindowID(Window), #True)
Timer = ElapsedMilliseconds()
Repeat
WindowEvent = WaitWindowEvent(10)
If (Timer <> -1 And ElapsedMilliseconds() - Timer > 2000)
Timer = -1
FlashWindow_(WindowID(Window), #False) ; But window remains orange in taskbar
Debug "stop"
EndIf
ForEver
Re: FlashWindow_() How to "unflash"?
Adapt it for your needs
Using your example :
Code: Select all
#FLASHW_STOP = 0
#FLASHW_CAPTION = 1
#FLASHW_TRAY = 2
#FLASHW_ALL = 3
#FLASHW_TIMER = 4
#FLASHW_TIMERNOFG = 12
Procedure FlashWindow(hwnd,count,timeout,flags)
Info.FLASHWINFO
Info\cbSize = SizeOf(FLASHWINFO)
Info\hwnd = hwnd
Info\dwFlags= flags
Info\uCount = count
Info\dwTimeout = timeout
FlashWindowEx_(Info)
EndProcedure
hwnd = OpenWindow(0,0,0,200,200,"Flash Window",#PB_Window_ScreenCentered|#PB_Window_SystemMenu|#PB_Window_MinimizeGadget)
AddWindowTimer(0,125,100)
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
Quit = 1
Case #PB_Event_MinimizeWindow
FlashWindow(hwnd,10,100,#FLASHW_ALL)
Case #PB_Event_RestoreWindow
FlashWindow(hwnd,0,0,#FLASHW_STOP)
Case #PB_Event_Timer
; FlashWindow(hwnd,10,100,#FLASHW_ALL)
; Delay(5000)
; FlashWindow(hwnd,0,0,#FLASHW_STOP)
EndSelect
Until Quit = 1
Code: Select all
#FLASHW_STOP = 0
#FLASHW_CAPTION = 1
#FLASHW_TRAY = 2
#FLASHW_ALL = 3
#FLASHW_TIMER = 4
#FLASHW_TIMERNOFG = 12
Procedure FlashWindow(hwnd,count,timeout,flags)
Info.FLASHWINFO
Info\cbSize = SizeOf(FLASHWINFO)
Info\hwnd = hwnd
Info\dwFlags= flags
Info\uCount = count
Info\dwTimeout = timeout
FlashWindowEx_(Info)
EndProcedure
Define Window.i, WindowEvent.i, Timer.i
Window = OpenWindow(#PB_Any, 0, 0, 500, 500, "Window", #PB_Window_MinimizeGadget | #PB_Window_ScreenCentered)
SetWindowState(Window, #PB_Window_Minimize)
FlashWindow(WindowID(window),10,100,#FLASHW_ALL)
Timer = ElapsedMilliseconds()
Repeat
WindowEvent = WaitWindowEvent(10)
If (Timer <> -1 And ElapsedMilliseconds() - Timer > 2000)
Timer = -1
FlashWindow(WindowID(window),0,0,#FLASHW_STOP)
Debug "stop"
EndIf
ForEver
Egypt my love
Re: FlashWindow_() How to "unflash"?
Thanks but when i use your example nothing happens. It does not start to flash at all. I am using Windows 10.
Re: FlashWindow_() How to "unflash"?
Minimize the window to start the flashing.
Re: FlashWindow_() How to "unflash"?
I know, FlashWindow_() seems to work here but FlashWindowEX_() does nothing, i am not sure why.
I think i will use this instead to highlight / de-highlight the window in the taskbar, it's not exactly meant for it but it has 4 states with multiple colors (green, yellow, red) which makes it even better.
Re: FlashWindow_() How to "unflash"?
I don't have windows 10 anymore
But try the 2 example with
But try the 2 example with
Code: Select all
Window = OpenWindow(#PB_Any, 0, 0, 500, 500, "Window", #PB_Window_MinimizeGadget | #PB_Window_ScreenCentered)
SetWindowState(Window, #PB_Window_Minimize)
FlashWindow_(WindowID(Window), #True)
;FlashWindow(WindowID(window),10,100,#FLASHW_ALL)
Timer = ElapsedMilliseconds()
Egypt my love