Jump to content

KBcool

Members
  • Posts

    4
  • Joined

  • Last visited

KBcool's Achievements

Seeker

Seeker (1/7)

1

Reputation

  1. OK, so here's the deal. I've been working on a utility that has an embedded explorer window in it. This window gets pointed to a shared folder and you should be able to launch applications by double clicking. Sounds simple enough right? The kicker is, the GUI locks up if I launch an app from the embedded browser (CPU shoots to max). Now I've done a ton of troubleshooting and narrowed it down to exactly what is interfering. If I have any other basic control in place (there are quite a few) it causes the issue. Remove them so that all that exists is the embedded browser and it works just fine. Here is a condensed version to show the issue: This doesn't work: #RequireAdmin #include <ButtonConstants.au3> #include <ComboConstants.au3> #include <GUIConstantsEx.au3> #include <GuiStatusBar.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <TabConstants.au3> #include <EditConstants.au3> #include <GUIEdit.au3> Opt("GUIOnEventMode", 1) $Form1 = GUICreate("Form1", 541, 450, -1, -1, BitOR($GUI_SS_DEFAULT_GUI,$WS_CLIPCHILDREN)) GUICtrlCreateLabel("Name:", 344, 232, 35, 17,"", $WS_EX_TRANSPARENT) GUISetState(@SW_SHOW) GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit") $Form2 = GUICreate("Form2", 297, 337, 16, 70, $WS_CHILD, "", $Form1) $TabGrp2 =GUICtrlCreateTab( 1,1,295,335) $Tab2 = GUICtrlCreateTabItem("test") $Tab3 = GUICtrlCreateTabItem("test2") $oIE = ObjCreate("Shell.Explorer") $oActiveX = GUICtrlCreateObj( $oIE, 5, 53 , 287 , 280 ) $oIE.navigate(ss) GUISetState(@SW_SHOW) While sleep(150) WEnd Func _Exit() GUIDelete($Form1) $oIE = "" Exit EndFunc This does work: #RequireAdmin #include <ButtonConstants.au3> #include <ComboConstants.au3> #include <GUIConstantsEx.au3> #include <GuiStatusBar.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <TabConstants.au3> #include <EditConstants.au3> #include <GUIEdit.au3> Opt("GUIOnEventMode", 1) $Form1 = GUICreate("Form1", 541, 450, -1, -1, BitOR($GUI_SS_DEFAULT_GUI,$WS_CLIPCHILDREN)) ;GUICtrlCreateLabel("Name:", 344, 232, 35, 17,"", $WS_EX_TRANSPARENT) GUISetState(@SW_SHOW) GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit") $Form2 = GUICreate("Form2", 297, 337, 16, 70, $WS_CHILD, "", $Form1) $TabGrp2 =GUICtrlCreateTab( 1,1,295,335) $Tab2 = GUICtrlCreateTabItem("test") $Tab3 = GUICtrlCreateTabItem("test2") $oIE = ObjCreate("Shell.Explorer") $oActiveX = GUICtrlCreateObj( $oIE, 5, 53 , 287 , 280 ) $oIE.navigate(ss) GUISetState(@SW_SHOW) While sleep(150) WEnd Func _Exit() GUIDelete($Form1) $oIE = "" Exit EndFunc Any help here would be much appreciated. I'm at my witts' end.
  2. I'm sure this is inconsequential but I recently tried to make an autoit script for monitoring a log file created by a program and found this thread extremely helpful (I had most of it down but I was having trouble with getting the editbox to accept the entire log file and this helped in that regard with the "GUICtrlSetLimit(-1, 0x7FFFFFFF)" function). I found that using the "@extended" macro helped in making sure I always had the correct position within the file I was monitoring. I have added/changed the script to work with the intended effect. I thought I would post here in case anyone else found themselves in need of monitoring a log file. ;Coded by UEZ Build 2010-06-30, tweaked by KaFu ;-), then again by KB. #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <File.au3> #include <GuiEdit.au3> Opt("GUIOnEventMode", 1) Global $iMemo, $new_line $width = 1024 $height = 600 $hGUI = GUICreate("Realtime Log Reader by UEZ & KaFu 2010", $width, $height, -1, -1, Default, $WS_EX_TOPMOST) $iMemo = GUICtrlCreateEdit("", 0, 0, $width, $height, $ES_AUTOVSCROLL + $WS_VSCROLL + $WS_HSCROLL + $ES_READONLY) GUICtrlSetLimit(-1, 0x7FFFFFFF) GUICtrlSetFont($iMemo, 8.5, 400, 0, "Lucida Console") GUISetState() If $CmdLine[0] > 0 And FileExists($CmdLine[1]) Then $file = $CmdLine[1] Else $file = @WindowsDir & "\WindowsUpdate.log" ;$file = @ScriptDir & "\WindowsUpdate.log" EndIf $hFile = _FileOpen_Wrapper($file) $txt = FileRead($hFile) $fs = FileGetSize($file) $OrigCount = @Extended FileClose($hFile) ConsoleWrite($txt) _GUICtrlEdit_SetText($iMemo, $txt) _GUICtrlEdit_LineScroll($iMemo, 0, 0xfffffff) GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit") While Sleep(1000) $fs_new = FileGetSize($file) If $fs < $fs_new Then $hFile = _FileOpen_Wrapper($file) If $hFile <> -1 Then FileSetPos($hFile, $OrigCount, 0) $new_line = FileRead($hFile) FileClose($hFile) $NewCount = @extended _GUICtrlEdit_AppendText($iMemo, $new_line) $OrigCount = $OrigCount + $NewCount $fs = $fs_new EndIf $new_line = "" EndIf WEnd Func _Exit() GUIDelete($hGUI) Exit EndFunc ;==>_Exit Func _FileOpen_Wrapper($file) $hFile = -1 $timer = TimerInit() While $hFile = -1 $hFile = FileOpen($file,128) If $hFile <> -1 Then ExitLoop Sleep(100) If TimerDiff($timer) > 5000 Then MsgBox(48, "Access Error", "File" & @CRLF & $file & @CRLF & "could not be opend in 5 seconds...") Exit EndIf WEnd Return $hFile EndFunc ;==>_FileOpen_Wrapper
  3. Actually I have done that now, but unfortunately it still closes prematurely even when there is a repair to be made.
  4. Hello, I have been working with AutoIt for a bit now (though I am the definition of "Beginner") and I have an issue with a script I am making. I have attempted to make a script that will run an aplication automatically. The application in question is a registry cleaner from Auslogics. Here is the script as such: opt("SendKeyDelay", 300) WinWaitActive("Auslogics Registry Cleaner") ControlSend("Auslogics Registry Cleaner", "Scan Now", "TAxCheckboxTreeView201", "{DOWN 14}{SPACE}") ControlSend("Auslogics Registry Cleaner","Scan Now","TAxDropDownButton201","{DOWN 3}{ENTER}") WinWait("Auslogics Registry Cleaner","< Back") ControlSend("Auslogics Registry Cleaner","< Back","TButton1","&{SPACE}") WinWait("Auslogics Registry Cleaner","Repair",200) $Repair = ControlSend("Auslogics Registry Cleaner","Repair","TButton1","&{SPACE}") If $Repair == 1 Then Opt("SendKeyDelay", 10000) Send("!{F4}") Else Opt("SendKeyDelay", 5) Send("!{F4}") EndIf The script was working fine until I got to the section where I create the $Repair variable. What I'm attempting is to make the script pause for 10 seconds if it successfully sends a keypress to the repair Control, to give the program enough time to complete. However if it does not exist it will exit immediately. As it stands it will exit immediatly even if it does find a button labeled "Repair". Any help would be greatly appreciated.
×
×
  • Create New...