Jump to content
Sign in to follow this  
layer

Alert the user of error without msgbox

Recommended Posts

layer

Here is an alternate way to alert the user of something, or an error...

Func _WinFlash($hWnd, $OptDelay = 500, $OptFlashes = 2);Thanks to Larry and JdeB
   $Dll = DllOpen("user32.dll")
   For $x = 1 To $OptFlashes
      DllCall($Dll, "int", "FlashWindow", "hWnd", $hWnd, "int", 1)
      Sleep($OptDelay)
   Next
   DllClose($Dll)
EndFunc  ;==>_WinFlash

_WinFlash(WinGetHandle("Windows Media Player"), 100, 10)

Although, if the $OptDelay is too short, then you may not sere all the flashes, but that's not anything major...

Thanks Larry and JdeB for there support...

Enjoy :):D


FootbaG

Share this post


Link to post
Share on other sites
quaizywabbit

Cool!!


[u]Do more with pre-existing apps![/u]ANYGUIv2.8

Share this post


Link to post
Share on other sites
Wb-FreeKill

ehh, how can i see what it's doing?, lol :)

Share this post


Link to post
Share on other sites
zcoacoaz

how about this example...

Func _WinFlash($hWnd, $OptDelay = 500, $OptFlashes = 2);Thanks to Larry and JdeB
   $Dll = DllOpen("user32.dll")
   For $x = 1 To $OptFlashes
      DllCall($Dll, "int", "FlashWindow", "hWnd", $hWnd, "int", 1)
      Sleep($OptDelay)
   Next
   DllClose($Dll)
EndFunc ;==>_WinFlash

$GUI = GuiCreate ( "My Error GUI", 200, 200 )
GuiSetState ( )
_WinFlash($GUI, 100, 10)

[font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]

Share this post


Link to post
Share on other sites
layer

Even better:

Func _WinFlash($hWnd, $OptDelay = 500, $OptFlashes = 2);Thanks to Larry and JdeB
   $Dll = DllOpen("user32.dll")
   For $x = 1 To $OptFlashes
      DllCall($Dll, "int", "FlashWindow", "hWnd", $hWnd, "int", 1)
      Sleep($OptDelay)
   Next
   DllClose($Dll)
EndFunc;==>_WinFlash

$GUI = GuiCreate ( "My Error GUI", 200, 200 )
$blinkme = GUICtrlCreateButton("Click here to flash", 10, 10)
GuiSetState ( )
While 1 
    $get = GUIGetMsg()
    If $get = -3 then Exit
        If $get = $blinkme then _WinFlash($GUI, 100, 2)
        WEnd

Notice when you click the button, and on the TaskBar a tab is there for the GUI, notice how it flahses orange? That's whats supposed to happen... :)


FootbaG

Share this post


Link to post
Share on other sites
zcoacoaz

on windows 9x or winxp with clasic style it flashes blue


[font="Times"] If anyone remembers me, I am back. Maybe to stay, maybe not.----------------------------------------------------------------------------------------------------------[/font][font="Times"]Things I am proud of: Pong! in AutoIt | SearchbarMy website: F.R.I.E.S.A little website that is trying to get started: http://thepiratelounge.net/ (not mine)[/font][font="Times"] ----------------------------------------------------------------------------------------------------------[/font][font="Arial"]The newbies need to stop stealing avatars!!! It is confusing!![/font]

Share this post


Link to post
Share on other sites
layer

on windows 9x or winxp with clasic style it flashes blue

<{POST_SNAPBACK}>

Sick. What color is the Taskbar then...? :)

EDIT: Oops, grey :D

Edited by layer

FootbaG

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×