Sign in to follow this  
Followers 0
Misha

While Problem

4 posts in this topic

#1 ·  Posted (edited)

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



is there a question in this somewhere?

if there is, you'll need to provide more info, like the problem/question and maybe even more script.


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

it enters the while but can not exit...I think it cant get to the guictrlsetonevent..

help :think:

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  
Followers 0