Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/04/2013 in all areas

  1. Thank you so much i want to create directory in user profile i will use below code .. DirCreate(@UserProfileDir & "LotusNotesData" ,"",@SW_HIDE ) thanks u so much....u r the rock .......
    1 point
  2. seamonkeysproject, I think this script runs as you wish - the buttons toggle the various "Send" processes as you press them. Look in the SciTE console to see what is happening - i have slowed the whole thing down so that you can see each keypress and Send action as the script runs. Note that I have kept the loop in the main part of the script - that way all your buttons remain active and you do not have to break into the functions as each one just toggles a flag and returns to the main loop: #include <GUIConstantsEx.au3> ; Create some flags to show whether to run a certain process Global $fActivated = False Global $fSend1 = False Global $fSend2 = False HotKeySet("{F3}", "exitthescript") $Form2 = GUICreate("Form2", 405, 294, 391, 270) $Button1 = GUICtrlCreateButton("activate", 128, 64, 131, 25) $Button2 = GUICtrlCreateButton("send1", 136, 96, 115, 25) GUICtrlSetState($Button2, $GUI_DISABLE) ; Disable this button $Button3 = GUICtrlCreateButton("send2", 136, 136, 115, 25) GUICtrlSetState($Button3, $GUI_DISABLE) ; Disable this button $Button4 = GUICtrlCreateButton("pause", 120, 176, 147, 25) GUICtrlSetState($Button4, $GUI_DISABLE) ; Disable this button $Button5 = GUICtrlCreateButton("exit", 120, 224, 147, 25) GUISetState(@SW_SHOW) $iBegin = TimerInit() ; This is just for testing to slow down the process so you can see what is happening While 1 ; Here we look for button presses Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $Button5 ; Notice you can have more than 1 control per case exitthescript() Case $Button1 ; Change the button states GUICtrlSetState($Button1, $GUI_DISABLE) ; Disable this button GUICtrlSetState($Button2, $GUI_ENABLE) ; Enable the send1 button GUICtrlSetState($Button3, $GUI_ENABLE) ; Enable the send2 button GUICtrlSetState($Button4, $GUI_ENABLE) ; Enable the pause/resume button ContinueCase ; This means run the next case down - so we toggle the Main flag Case $Button4 pause_resume() ; Toggle the Main flag Case $Button2 send1() ; Toggle the Send1 flag Case $Button3 send2() ; Toggle the Send2 flag EndSwitch If TimerDiff($iBegin) > 1000 Then ; This is just for testing to slow down the process so you can see what is happening ; Here we see if the Mian process is activated If $fActivated Then ConsoleWrite("Main Send sending keys" & @CRLF) ; now check on the 2 Send processes If $fSend1 Then ConsoleWrite("Send1 sending keys" & @CRLF) EndIf If $fSend2 Then ConsoleWrite("Send2 sending keys" & @CRLF) EndIf EndIf $iBegin = TimerInit() ; This is just for testing to slow down the process so you can see what is happening EndIf ; This is just for testing to slow down the process so you can see what is happening WEnd Func send1() ; Toggle the Send1 flag $fSend1 = Not $fSend1 ; This is just for testing so that you can see what is happening If $fSend1 Then ConsoleWrite("+Send1 running" & @CRLF) Else ConsoleWrite("!Send1 paused" & @CRLF) EndIf EndFunc ;==>send1 Func send2() ; Toggle the Send2 flag $fSend2 = Not $fSend2 ; This is just for testing so that you can see what is happening If $fSend2 Then ConsoleWrite("+Send2 running" & @CRLF) Else ConsoleWrite("!Send2 paused" & @CRLF) EndIf EndFunc ;==>send2 Func pause_resume() ; Toggle the Main flag $fActivated = Not $fActivated ; We need this If structure to change the button text If $fActivated Then GUICtrlSetData($Button4, "Pause") ConsoleWrite("+Main process running" & @CRLF) ; But this is just for testing Else GUICtrlSetData($Button4, "Resume") ConsoleWrite("!Main process paused" & @CRLF) ; But this is just for testing EndIf EndFunc ;==>pause/resume Func exitthescript() Exit EndFunc ;==>exitthescriptI have changed a lot from your script. Read the comments carefully and ask if you do not understand what I have done or why I have done it. M23
    1 point
  3. SuitUp

    My many questions

    My questions are only asked, if i have searched for them first in the read. I couldn't manage to find anything to do with sleep in minutes, therefor i asked. Also I didn't ask for a explanation on how to multiply, i know that very well thank you. I would like to thank you for posting the function tho, i didn't know you could use * inside Sleep.
    1 point
  4. Glad I could help.
    1 point
  5. The -1 in the GUICtrlSetState function in your first example will set the last control created, which in your case happens to be that check box. It's always a good idea to use the controlID of the control to do this, so that you know which control you're referencing. In this example it would be $make_room that holds the control ID of the checkbox. If you're going to use -1 in control related items, you should always use it as close to the control creation command as possible so that you know which one you're referencing. Using it with -1 is useful so that you don't have to create unnecessary variables just so you can reference them once right after making it.
    1 point
×
×
  • Create New...