Jump to content

Search the Community

Showing results for tags 'catch'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Location


WWW


Interests

Found 2 results

  1. Hi, I wrote a small script that displays a web page within autoit GUI. Is there a way to "catch" the clicks on the links on that web page? The web page is customizable, so I can define the link in any way I want... Tnx
  2. Is there a way to catch errors in AutoIt? SImilar to java's "Try-Catch" methods? My program keeps on throwing errors and I need them to just go away, my program works fine, other than these errors. Here's my code: #NoTrayIcon #include #include #include #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker #Obfuscator_Parameters=/cs /cf #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** ;Opt("TrayMenuMode",1) ;$menu = TrayCreateItem("DriveLocker") ;$menu2 = TrayCreateItem("") ;$menuLock = TrayCreateItem("Lock Drive") ;TraySetState() HotKeySet("{F9}", "_LockDrive") HotKeySet("{PAUSE}", "_Switch") $running = True While 1 While ($running) $letter = DriveGetDrive("REMOVABLE") If IsArray($letter) Then For $i = 1 to $letter[0] _Check($letter[$i]) Next EndIf $time = TimerInit() While TimerDiff($time) < 10000 If IsArray($letter) Then For $i = 1 to $letter[0] _Check($letter[$i]) Next EndIf Sleep(100) WEnd WEnd Sleep(10*1000) WEnd Func _Switch() If ($running) Then $running = False Else $running = True EndIf EndFunc Func _Check($strDriveLetter) If ($running) Then If FileExists($strDriveLetter & "\AutoIt3\Locker\IAmLocked") Then _Unlock($strDriveLetter) ElseIf FileExists($strDriveLetter & "\lock.txt") Then _Unlock($strDriveLetter) EndIf EndIf EndFunc Func _Unlock($strDriveLetter) If ($running) Then $strPassword = InputBox("Security Check", "Enter your password.", "", "*", "", "", @DesktopWidth/2, @DesktopHeight/2,8, "passwordBox") ToolTip("Enter Password NOW.") _MouseTrap(@DesktopWidth, @DesktopHeight-100) If ($strPassword = "PASSWORD") Then _MouseTrap() ToolTip("") FileDelete($strDriveLetter & "\AutoIt3\Locker\IAmLocked") FileDelete($strDriveLetter & "\lock.txt") _ReAnimate($strDriveLetter) ElseIf ($strPassword = "PASSWORDFAILSAFE") Then _MouseTrap() ToolTip("") FileDelete($strDriveLetter & "\AutoIt3\Locker\IAmLocked") FileDelete($strDriveLetter & "\lock.txt") _ReAnimate($strDriveLetter) Else EjectVolume($strDriveLetter) ToolTip("") _MouseTrap() EndIf EndIf EndFunc Func _ReAnimate($strDriveLetter) ;Run(StringUpper($letter[$i]) & "\") ;Run(StringUpper($letter[$i]) & "\new.txt.lnk") ;Run(StringUpper($letter[$i]) & "\you.lnk") ;WinClose("AutoPlay") ;ProcessClose("mcagent.exe") EndFunc Func _LockDrive() $letter = DriveGetDrive("REMOVABLE") If IsArray($letter) Then For $i = 1 To $letter[0] If MsgBox(36,"Lock This Drive?","Do you wish to lock the " & StringUpper($letter[$i]) & " drive?") = 6 Then FileWrite($letter[$i] & "\AutoIt3\Locker\IAmLocked","Locked") _FileCreate($letter[$i] & "\lock.txt") ;EjectVolume($letter[$i]) EndIf Next EndIf EndFunc
×
×
  • Create New...