Jump to content

Alert the user of error without msgbox


layer
 Share

Recommended Posts

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
Link to comment
Share on other sites

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]

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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]

Link to comment
Share on other sites

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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...