dickep Posted February 18, 2008 Share Posted February 18, 2008 OK, I have gotten one part of my autoit script working. But in doing that, I now can't get the main form to accept the input into the input box. Code is below. The code is the complete app I have been trying to do. The line " $mTiming = GUICtrlCreateInput("", 272, 30, 60, 21) " is where the issue is. Thanks in advance. E expandcollapse popup;=========================================================================== ; ; INCLUDE SECTION ; ;=========================================================================== #include <GUIConstants.au3> #include <CompInfo.au3> #include <Date.au3> ;============================================================================ ; ; GLOBAL CONSTANTS AND VARIBLES ; ;=========================================================================== #region Global Variables and Constants Global $ChildGUI, $killbutton Global $radeks[1] Global $list[100][50], $CB[42] Global $i,$sProcessNameList HotKeySet("{ESC}", "_HotKeyQuit") #endregion Global Variables and Constants #region Variable declarations Dim $Processes, $i Dim $mDisplayHeight, $mDisplayWidth, $mDispCtrW, $mDispCtrH, $mMenuWidth, $mMenuHeight, $tTempMins, $tTempSecs Dim $tTriggerTime, $tNewHour, $tNewMin, $tNewSec, $tOldHour, $tOldMin, $tOldSec dim $fLogFile1 = @DesktopDir & "\log.txt" ;Dim $ChildCB[100] Dim $fHandle1 Dim $mHeader[42] = ["Name","Command Line","Creation Class Name","Creation Date","Description","CS Creation Class Name","CS Name","Executable Path","Execution State","Handle","Handle Count","Kernel Mode Time","Maximum Working Set Size","Minimum Working Set Size","OS Creation Class Name","OS Name","Other Operation Count","Other Transfer Count","Page Faults","Page File Usage","Parent Process ID","Peak Page File Usage","Peak Virtual Size","Peak Working Set Size","Priority","Private Page Count","Process ID","Quota Non Paged Pool Usage","Quota Paged Pool Usage","Quota Peak Non Paged Pool Usage","Quota Peak Paged Pool Usage","Read Operation Count","Read Transfer Count","Session ID","Status","Thread Count","User Mode Time","Virtual Size","Windows Version","Working Set Size","Write Operation Count","Write Transfer Count"] Dim $CBchecked[42] Dim $fTemp, $mTemp, $a Dim $mWaitMsg = "Waiting.." Dim $iLimit = 5000000, $cnt dim $sOld, $sTotal, $sStringLen $mDisplayHeight = @DesktopHeight $mDisplayWidth = @DesktopWidth $mDispCtrW = Int($mDisplayWidth/2) $mDispCtrH = Int($mDisplayHeight/2) $mMenuWidth = 448 $mMenuHeight = 634 #endregion Variable declarations ;============================================================================ ; ; MAIN ; ;=========================================================================== ;=========================================== ; ; create a WAIT window for use later ; ;========================================== $mWaitWin = GUICreate("Working....",300,100,45,75) ;$mWaitLabel1 = GUICtrlCreateLabel($mWaitMsg,25,75,100) ;$mT1 = GUICtrlCreateLabel("Now time: " & _DateTimeFormat(_nowcalc(), 3) & @CRLF & "Trigger Time " & _DateTimeFormat($tNewTime,3), 25, 90, 150, 50) _ComputerGetProcesses($Processes) ; Make the first user input GUI Opt("GUIOnEventMode", 1) #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Learning Processes Test Tool", $mMenuHeight, $mMenuWidth, ($mDispCtrW - (int(633/2))), ($mDispCtrH - (448/2))) GUISetOnEvent($GUI_EVENT_CLOSE, "_Quit") GUISetFont(10, 700) $Label1 = GUICtrlCreateLabel("Enter time for each read (in seconds)", 32, 32, 267, 17) $Label2 = GUICtrlCreateLabel("Check each item you wish to log for each Process", 50, 56, 350, 25) $mTiming = GUICtrlCreateInput("", 272, 30, 60, 21) ;$Label3 = GUICtrlCreateLabel("Process: ", 365, 56, 100, 17) ;$ProcessInput = GUICtrlCreateInput("",425,58,150,25) $Label3 = GUICtrlCreateLabel("Number of processes running: " & $Processes[0][0],375, 32, 300, 25 ) GUISetFont(8.5, 400) $CB[0] = GUICtrlCreateCheckbox("Name", 40, 84, 150, 17) $CB[1] = GUICtrlCreateCheckbox("Command Line", 40, 104, 150, 17) $CB[2] = GUICtrlCreateCheckbox("Creation Class Name", 40, 124, 150, 17) $CB[3] = GUICtrlCreateCheckbox("Creation Date", 40, 144, 150, 17) $CB[4] = GUICtrlCreateCheckbox("Description", 40, 164, 150, 17) $CB[5] = GUICtrlCreateCheckbox("CS Creation Class Name", 40, 184, 150, 17) $CB[6] = GUICtrlCreateCheckbox("CS Name", 40, 204, 150, 17) $CB[7] = GUICtrlCreateCheckbox("Executable Path", 40, 224, 150, 17) $CB[8] = GUICtrlCreateCheckbox("Execution State", 40, 244, 150, 17) $CB[9] = GUICtrlCreateCheckbox("Handle", 40, 264, 150, 17) $CB[10] = GUICtrlCreateCheckbox("Handle Count", 40, 284, 150, 17) $CB[11] = GUICtrlCreateCheckbox("Kernel Mode Time", 40, 304, 150, 17) $CB[12] = GUICtrlCreateCheckbox("Maximum Working Set Size", 40, 324, 150, 17) $CB[13] = GUICtrlCreateCheckbox("Minimum Working Set Size", 40, 344, 150, 17) $CB[14] = GUICtrlCreateCheckbox("OS Creation Class Name", 40, 364, 150, 17) $CB[15] = GUICtrlCreateCheckbox("OS Name", 240, 84, 150, 17) $CB[16] = GUICtrlCreateCheckbox("Other Operation Count", 240, 104, 150, 17) $CB[17] = GUICtrlCreateCheckbox("Other Transfer Count", 240, 124, 150, 17) $CB[18] = GUICtrlCreateCheckbox("Page Faults", 240, 144, 150, 17) $CB[19] = GUICtrlCreateCheckbox("Page File Usage", 240, 164, 150, 17) $CB[20] = GUICtrlCreateCheckbox("Parent Process ID", 240, 184, 150, 17) $CB[21] = GUICtrlCreateCheckbox("Peak Page File Usage", 240, 204, 150, 17) $CB[22] = GUICtrlCreateCheckbox(" Peak Virtual Size", 240, 224, 150, 17) $CB[23] = GUICtrlCreateCheckbox(" Peak Working Set Size", 240, 244, 150, 17) $CB[24] = GUICtrlCreateCheckbox(" Priority", 240, 264, 150, 17) $CB[25] = GUICtrlCreateCheckbox("Private Page Count", 240, 284, 150, 17) $CB[26] = GUICtrlCreateCheckbox("Process ID", 240, 304, 150, 17) $CB[27] = GUICtrlCreateCheckbox("Quota Non Paged Pool Usage", 240, 324, 180, 17) $CB[28] = GUICtrlCreateCheckbox("Quota Paged Pool Usage", 240, 344, 150, 17) $CB[29] = GUICtrlCreateCheckbox("Quota Peak Non Paged Pool Usage", 240, 364, 200, 17) $CB[30] = GUICtrlCreateCheckbox("Quota Peak Paged Pool Usage", 440, 84, 180, 17) $CB[31] = GUICtrlCreateCheckbox("Read Operation Count", 440, 104, 150, 17) $CB[32] = GUICtrlCreateCheckbox("Read Transfer Count", 440, 124, 150, 17) $CB[33] = GUICtrlCreateCheckbox("Session ID", 440, 144, 150, 17) $CB[34] = GUICtrlCreateCheckbox("Status", 440, 164, 150, 17) $CB[35] = GUICtrlCreateCheckbox("Thread Count", 440, 184, 150, 17) $CB[36] = GUICtrlCreateCheckbox("User Mode Time", 440, 204, 150, 17) $CB[37] = GUICtrlCreateCheckbox("Virtual Size", 440, 224, 150, 17) $CB[38] = GUICtrlCreateCheckbox("Windows Version", 440, 244, 150, 17) $CB[39] = GUICtrlCreateCheckbox("Working Set Size", 440, 264, 150, 17) $CB[40] = GUICtrlCreateCheckbox("Write Operation Count", 440, 284, 150, 17) $CB[41] = GUICtrlCreateCheckbox("Write Transfer Count", 440, 304, 150, 17) GUISetFont(10, 700) $PGUI = GUICtrlCreateCheckbox("Select Processes",440, 344, 150, 17) GUISetFont(8.5,400) GUICtrlSetOnEvent($PGUI, "_ShowProcessChildWindow") $Button1 = GUICtrlCreateButton("OK", 192, 400, 75, 25, 0) GUICtrlSetOnEvent(-1,"_Main") $Button2 = GUICtrlCreateButton("Cancel", 352, 400, 75, 25, 0) GUICtrlSetOnEvent(-1,"_Quit") GUISetState(@SW_SHOW, $Form1) GUISwitch($Form1) #EndRegion ### END Koda GUI section ### ;$tTriggerTime = GUICtrlRead($mTiming) _CreateChild() While 1 Sleep(100); So we don't kill the CPU WEnd ;============================================================================================== ; ; FUNCTION AREA ; ;============================================================================================= Func _Main() MsgBox(0,"OK BUTTON RESULTS","Names: " & @crlf & $sProcessNameList) _Quit() EndFunc Func _ShowProcessChildWindow() GUISetState(@SW_SHOW, $ChildGUI) EndFunc Func _CreateChild() $ChildGUI = GUICreate("Main:Processes", 350, 260, 100, 100, -1, -1, $Form1) GUISetOnEvent($GUI_EVENT_CLOSE, "_CloseChildGUI") GUICtrlCreateGroup(" All Processes Running ", 10, 10, 220, 228) GUIStartGroup() $treeproces = GUICtrlCreateTreeView(20, 30, 200, 192, $TVS_CHECKBOXES) $list = ProcessList() ReDim $radeks[$list[0][0] + 1] $radeks[1] = GUICtrlCreateTreeViewItem("All Processes", $treeproces) For $i = 2 To $list[0][0] $radeks[$i] = GUICtrlCreateTreeViewItem($list[$i][0], $treeproces) ;GuiCtrlSetOnEvent(-1, '_Test') Next GUICtrlCreateLabel(" Number of running processes : ", 20, 230, 140, 15) GUICtrlCreateLabel($list[0][0], 160, 230, 20, 15) $killbutton = GUICtrlCreateButton("Submit", 260, 20, 60, 25) GUICtrlSetOnEvent($killbutton, "_CloseChildGUI") GUISetState(@SW_HIDE, $ChildGUI) EndFunc Func _CloseChildGUI() Local $i $sProcessNameList ="" For $i = 1 to $list[0][0] If GUICtrlRead($radeks[$i]) = 1 OR GUICtrlRead($radeks[$i]) = 257 Then $sProcessNameList = $list[$i][0] & "," & $sProcessNameList ; MsgBox(1,"",$list[$i][0] & " is checked ") EndIf Next $sProcessNameList = StringLeft($sProcessNameList,stringlen($sProcessNameList) - 1) MsgBox(0,"","Names: " & @crlf & $sProcessNameList) GUISetState(@SW_HIDE) EndFunc ;==>_CloseChildGUI Func _HotKeyQuit() msgbox(0,"User Termination","Application has been requested to terminate" & @crlf & "Terminating in 10 seconds....",10) _Quit() EndFunc Func _Quit() ;msgbox(0,"User Termination","Application has been requested to terminate" & @crlf & "Terminating in 10 seconds....",10) Exit EndFunc Func _Test() EndFunc Link to comment Share on other sites More sharing options...
dickep Posted February 18, 2008 Author Share Posted February 18, 2008 Think I "solved it?? I made the input variable Global and now it is "working". More to check out but for now all is going well. E Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now