Jump to content
Sign in to follow this  
Misha

While Problem

Recommended Posts

Func AutoPicker ()
    GuiCtrlSetData( $AutoPickerButton, "Stop Picking")
    $PickerWhile = 0
    $AutoPicker = 1
    While $PickerWhile = 0
        GuiCtrlSetOnEvent( $AutoPickerButton, "ExitPicker")
        sleep($Slide)
        WinActivate ("Classname=Shell_TrayWnd")
        Send(" ",1)
        WinActivate ("Classname=Shell_TrayWnd")
        Send("{BACKSPACE}")
    WEnd
EndFunc



Func ExitPicker ()
    $PickerWhile = 1
    GuiCtrlSetData( $AutoPickerButton, "Start Picking")
    GuiCtrlSetOnEvent( $AutoPickerButton, "AutoPicker")
EndFunc

Edited by Misha

Share this post


Link to post
Share on other sites

this will so the trick

#include <GUIConstants.au3>
Opt("GUIOnEventMode", 1)

Dim $Slide = 100, $PickerWhile

GUICreate("MY GUI")

$AutoPickerButton = GUICtrlCreateButton("Start Picking", 150, 150, 150, 20)
GUICtrlSetOnEvent($AutoPickerButton, "AutoPicker")

GUISetState()

While 1
    Sleep(10)
    While $PickerWhile = 0
        sleep($Slide)
        WinActivate ("Classname=Shell_TrayWnd")
        Send(" ",1)
        WinActivate ("Classname=Shell_TrayWnd")
        Send("{BACKSPACE}")
    WEnd
WEnd


Func AutoPicker ()
    GuiCtrlSetData( $AutoPickerButton, "Stop Picking")
    GuiCtrlSetOnEvent( $AutoPickerButton, "ExitPicker")
    $PickerWhile = 0
    $AutoPicker = 1
EndFunc



Func ExitPicker ()
    $PickerWhile = 1
    GuiCtrlSetData( $AutoPickerButton, "Start Picking")
    GuiCtrlSetOnEvent( $AutoPickerButton, "AutoPicker")
EndFunc

@gafrost... i saw the other post and helped before

8)


NEWHeader1.png

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...