Custom Query (3927 matches)
Results (397 - 399 of 3927)
| Ticket | Resolution | Summary | Owner | Reporter |
|---|---|---|---|---|
| #1294 | Fixed | WinGetTitle freezes script when reading the title of a suspended/hanged process | ||
| Description |
Not really a bug, so it is a feature request... If an autoit script tries to do WinGetTitle on an existing window which is part of a suspended/hanged process then the autoit script freezes. The request is to have WinGetTitle return 0 or -1 if the targeted window/process doesn't respond, maybe with a time-out, instead of freezing the running script. Suspending a process requires a third party tool like Process Explorer, freeware from microsoft : http://download.sysinternals.com/Files/ProcessExplorer.zip Hanging a process is more difficult unless you have a buggy app. In the example below the process targeted with WinGetTitle (the second script) is also an autoit process (but could be any process). First, start both scripts, then suspend the second script with Process Explorer, the first autoit script will then freeze until the second is resumed or closed. The first autoit script : AutoItSetOption("MustDeclareVars", 1)
#include <GUIConstantsEx.au3>
Example()
Func Example()
Local $id_label, $myvar, $msg, $timer, $nowdiff, $lastupdatediff
Const $ms_update_interval = 100
GUICreate("My GUI")
$id_label = GUICtrlCreateLabel("text", 10, 10, 300, 20)
GUISetState()
$timer = TimerInit()
$lastupdatediff = 0
While 1
$msg = GUIGetMsg()
If $msg = $GUI_EVENT_CLOSE Then ExitLoop
$nowdiff = TimerDiff($timer)
$myvar = "Title GUI2:" & WinGetTitle("My GUI2") & " (" & Int($nowdiff / 1000) & "s)"
If ($nowdiff - $lastupdatediff >= $ms_update_interval) Then
If Not(GUICtrlRead($id_label) == $myvar) Then GUICtrlSetData($id_label, $myvar)
$lastupdatediff = $nowdiff
EndIf
WEnd
EndFunc
The targeted process to suspend manually : AutoItSetOption("MustDeclareVars", 1)
#include <GUIConstantsEx.au3>
Example()
Func Example()
Local $id_label, $myvar, $msg, $timer, $nowdiff, $lastupdatediff
Const $ms_update_interval = 100
GUICreate("My GUI2")
$id_label = GUICtrlCreateLabel("text", 10, 10, 100, 20)
GUISetState()
$timer = TimerInit()
$lastupdatediff = 0
While 1
$msg = GUIGetMsg()
If $msg = $GUI_EVENT_CLOSE Then ExitLoop
$nowdiff = TimerDiff($timer)
$myvar = Int($nowdiff / 1000) & "s"
If ($nowdiff - $lastupdatediff >= $ms_update_interval) Then
If Not(GUICtrlRead($id_label) == $myvar) Then GUICtrlSetData($id_label, $myvar)
$lastupdatediff = $nowdiff
EndIf
WEnd
EndFunc
Note : the problem doesn't occur if : the second script is started first, then is suspended, and then the first script is started. |
|||
| #1295 | Fixed | Crashed with fileread and filewrite on windows 7 X64 | ||
| Description |
Crashed with fileread and filewrite on windows 7 X64 And,if file is english,it's work. See attach file is some english text file is some chinse text autoit3.exe worked(english and chinse) AutoIt3_x64.exe Crashed(english is work) os:windows 7 x64 |
|||
| #1296 | Fixed | _GUICtrlTreeView_ClickItem fails with item text wider than TreeView | ||
| Description |
If a TreeView or Gui containing a TreeView is not wide enough to show the full text of a TreeView item, _GUICtrlTreeView_ClickItem will click outside of the treeview or parent window. Fails with both production 3.3.0.0 and beta 3.3.1.5 on XP Pro 32bit w/ SP3 Modified example from help file to demonstrate: #AutoIt3Wrapper_au3check_parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6
#include <GuiConstantsEx.au3>
#include <GuiTreeView.au3>
#include <GuiImageList.au3>
#include <WindowsConstants.au3>
Opt('MustDeclareVars', 1)
$Debug_TV = False ; Check ClassName being passed to functions, set to True and use a handle to another control to see it work
Global $hTreeView
_Main()
Func _Main()
Local $hItem[6], $hImage, $iImage, $gui, $sDesc
Local $iStyle = BitOR($TVS_EDITLABELS, $TVS_HASBUTTONS, $TVS_HASLINES, $TVS_LINESATROOT, $TVS_DISABLEDRAGDROP, $TVS_SHOWSELALWAYS, $TVS_CHECKBOXES)
$gui = GUICreate("TreeView Click Item", 400, 300)
$hTreeView = GUICtrlCreateTreeView(2, 2, 396, 268, $iStyle, $WS_EX_CLIENTEDGE)
GUISetState()
$hImage = _GUIImageList_Create(16, 16, 5, 3)
_GUIImageList_AddIcon($hImage, "shell32.dll", 110)
_GUIImageList_AddIcon($hImage, "shell32.dll", 131)
_GUIImageList_AddIcon($hImage, "shell32.dll", 165)
_GUIImageList_AddIcon($hImage, "shell32.dll", 168)
_GUIImageList_AddIcon($hImage, "shell32.dll", 137)
_GUIImageList_AddIcon($hImage, "shell32.dll", 146)
_GUICtrlTreeView_SetNormalImageList($hTreeView, $hImage)
_GUICtrlTreeView_BeginUpdate($hTreeView)
$sDesc = "A long Description"
For $x = 0 To _GUIImageList_GetImageCount($hImage) - 1
$hItem[$x] = _GUICtrlTreeView_Add($hTreeView, 0, StringFormat("[%02d] New Item with " & $sDesc, $x + 1), $x, $x)
$sDesc &= " " & $sDesc
Next
_GUICtrlTreeView_EndUpdate($hTreeView)
For $x = 0 To UBound($hItem) - 1
If Not WinActive($gui) then
MsgBox(4096,"OOPS","I'd be clicking outside of the treeview's window")
Else
_GUICtrlTreeView_ClickItem($hTreeView, $hItem[$x],"left", True)
EndIf
ConsoleWrite("Item: " & $x & @TAB & "Active Win = " & WinGetTitle("[ACTIVE]") & @CRLF)
Sleep(500)
Next
WinActivate($gui)
; Loop until user exits
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUIDelete()
EndFunc ;==>_Main
|
|||
