Jump to content

mLipok

MVPs
  • Posts

    11,763
  • Joined

  • Last visited

  • Days Won

    66

mLipok last won the day on March 29

mLipok had the most liked content!

About mLipok

  • Birthday 07/19/1978

Profile Information

  • Member Title
    Sometimes... even usually I'm nitpicky.
  • Location
    Europe, Poland, Upper Silesia, Zabrze
  • Interests
    ¯\_(ツ)_/¯

Recent Profile Visitors

29,477 profile views

mLipok's Achievements

  1. more complex example: #include <AutoItConstants.au3> Global $oCOM_ErrorHandler = ObjEvent("AutoIt.Error", _ComErrorHandler) Global $oMAP_object[] Global $oTestObject1_Shell = ObjCreate("shell.application") Global $oTestObject2_Map[] Global $_WatchPoint = @ScriptLineNumber #Region ; testing FIX https://www.autoitscript.com/trac/autoit/ticket/3167 $_WatchPoint = @ScriptLineNumber ;~ $oTestObject1_Shell.Explore(@ScriptDir) ; works $_WatchPoint = @ScriptLineNumber $oTestObject1_Shell.Windows().Item(666).bzzzzzzz ; _ComErrorHandler() IS FIRED and AutoIt PROPERLY continue processing next line - due COM ERROR HANDLER was used and FIXED in #3167 $_WatchPoint = @ScriptLineNumber $oTestObject1_Shell.Windows().Item(666).bzzzzzzz = 1 ; _ComErrorHandler() IS FIRED and AutoIt PROPERLY continue processing next line - due COM ERROR HANDLER was used and FIXED in #3167 #EndRegion ; testing https://www.autoitscript.com/trac/autoit/ticket/3167 $_WatchPoint = @ScriptLineNumber $oMAP_object.Shell = $oTestObject1_Shell $_WatchPoint = @ScriptLineNumber $oMAP_object.Shell.Explore(@ScriptDir) ; works $_WatchPoint = @ScriptLineNumber MsgBox(0, @ScriptLineNumber & " : $oMAP_object.Shell", VarGetType($oMAP_object.Shell)) $_WatchPoint = @ScriptLineNumber ; _ComErrorHandler() IS FIRED and AutoIt PROPERLY continue processing next line - due COM ERROR HANDLER was used and FIXED in #3167 $oMAP_object.Shell.Fake1(@ScriptDir) MsgBox(0, @ScriptLineNumber & " : $oMAP_object.Shell.Fake1(@ScriptDir)", '') $_WatchPoint = @ScriptLineNumber ; _ComErrorHandler() IS FIRED and AutoIt PROPERLY continue processing next line - due COM ERROR HANDLER was used and FIXED in #3167 $oMAP_object.Shell.Fake2 = 2 MsgBox(0, @ScriptLineNumber & " : $oMAP_object.Shell.Fake2 = 2", '') $_WatchPoint = @ScriptLineNumber ; _ComErrorHandler() IS FIRED and AutoIt PROPERLY continue processing next line - due COM ERROR HANDLER was used and FIXED in #3167 MsgBox(0, @ScriptLineNumber & " : $oMAP_object.Shell.Fake3", $oMAP_object.Shell.Fake3) $_WatchPoint = @ScriptLineNumber $oMAP_object.TestObject2_Map = $oTestObject2_Map MsgBox(0, @ScriptLineNumber & " : $oMAP_object.TestObject2_Map", VarGetType($oMAP_object.TestObject2_Map)) $_WatchPoint = @ScriptLineNumber $oMAP_object.TestObject2_Map.Check1 = 1 ; create MAP element called "Check1" with value = 1 $_WatchPoint = @ScriptLineNumber MsgBox(0, @ScriptLineNumber & " : $oMAP_object.TestObject2_Map.Check1", $oMAP_object.TestObject2_Map.Check1) $_WatchPoint = @ScriptLineNumber MsgBox(0, @ScriptLineNumber & " : $oTestObject2_Map.Check1", $oTestObject2_Map.Check1) $_WatchPoint = @ScriptLineNumber MsgBox(0, @ScriptLineNumber & " : $oMAP_object.TestObject2_Map.Check1", $oMAP_object.TestObject2_Map.Check1) $_WatchPoint = @ScriptLineNumber $oMAP_object.FakeObject1 = 1 ; create MAP element called "FakeObject" with value = 1 $_WatchPoint = @ScriptLineNumber ; in the following line _ComErrorHandler() IS NOT FIRED although it has already been fixed in https://www.autoitscript.com/trac/autoit/ticket/3167 = IMHO this is AutoIt issue ; ... but maybe it is intentional to not FIRE _ComErrorHandler() as $oMAP_object.FakeObject1 is treated as MAP ELEMENT thus Check2 is also treated as MAP element and thus can be created on the fly MsgBox(0, @ScriptLineNumber & " : $oMAP_object.FakeObject1.Check2", "Result=" & $oMAP_object.FakeObject1.Check2) $_WatchPoint = @ScriptLineNumber ; _ComErrorHandler() IS FIRED and AutoIt PROPERLY continue processing next line - due COM ERROR HANDLER was used and FIXED in #3167 MsgBox(0, @ScriptLineNumber & " : $oCOM_ErrorHandler.FakeObject1.Check3", $oCOM_ErrorHandler.FakeObject1.Check3) $_WatchPoint = @ScriptLineNumber ; in the following line _ComErrorHandler() IS FIRED but AutoIt ends with (Variable must be of type "Object") = IMHO this is AutoIt issue ; ... this is the case @donnyh13 reported at the begining = IMHO this is AutoIt issue $oCOM_ErrorHandler.FakeObject2.Check4 = 1 MsgBox(0, @ScriptLineNumber & " : $oCOM_ErrorHandler.FakeObject2.Check4", "") $_WatchPoint = @ScriptLineNumber ; _ComErrorHandler() IS FIRED and AutoIt PROPERLY continue processing next line - due COM ERROR HANDLER was used and FIXED in #3167 MsgBox(0, @ScriptLineNumber & " : $oMAP_object.FakeObject3.Check5", $oMAP_object.FakeObject3.Check5) $_WatchPoint = @ScriptLineNumber ; in the following line _ComErrorHandler() IS NOT FIRED and AutoIt ends with (Variable must be of type "Object") = IMHO this is AutoIt issue ; ... this is the case @donnyh13 reported at the begining = IMHO this is AutoIt issue $oMAP_object.FakeMapElement.Check6 = 1 MsgBox(0, @ScriptLineNumber & " : $oMAP_object.FakeMapElement.Check6", "") Func _ComErrorHandler(ByRef $oError) #forceref $oError ConsoleWrite("! We intercepted a COM Error : Last @ScriptLineNumber (WatchPoint) =" & $_WatchPoint & @CRLF) EndFunc ;==>_ComErrorHandler #REMARK => .Check2 needs To be explained #REMARK => both .Check4 and .Check6 should fires _ComErrorHandler() and show the console message also AutoIt should not ends With: Variable must be of type "Object"
  2. just changed the example a little: Global $oCOM_ErrorHandler = ObjEvent("AutoIt.Error", _ComErrorHandler) Global $oFake[] Global $oTestObject[] $oFake.TestObject = $oTestObject $oFake.TestObject.Check1 = 1 $oFake.FakeObject = 1 ; in the following line _ComErrorHandler() is not fired even this was already fixed in https://www.autoitscript.com/trac/autoit/ticket/3167 MsgBox(0, "$oFake.FakeObject.Check2", "Result=" & $oFake.FakeObject.Check2) ; in the following line _ComErrorHandler() is not fired and AutoIt ends with "Variable must be of type "Object"" $oFake.FakeObject.Check3 = 1 Func _ComErrorHandler(ByRef $oError) #forceref $oError ConsoleWrite("! We intercepted a COM Error" & @CRLF) EndFunc ;==>_ComErrorHandler # both .Check2 and .Check3 should fires _ComErrorHandler() and show the console message
  3. Did you check my modified code from the ticket? Global $oCOM_ErrorHandler = ObjEvent("AutoIt.Error", _ComErrorHandler) Global $oFake[] Global $oTestObject[] $oFake.TestObject = $oTestObject $oFake.TestObject.Check1 = 1 $oFake.FakeObject = 1 ConsoleWrite($oFake.FakeObject.Check2 & @CRLF) ; _ComErrorHandler() is not fired even this was already fixed in https://www.autoitscript.com/trac/autoit/ticket/3167 $oFake.FakeObject.Check3 = 1 ; _ComErrorHandler() is not fired and AutoIt ends with "Variable must be of type "Object"" Func _ComErrorHandler(ByRef $oError) #forceref $oError ConsoleWrite("! We intercepted a COM Error" & @CRLF) EndFunc ;==>_ComErrorHandler # both .Check2 and .Check3 should fires _ComErrorHandler() and show the console message
  4. https://www.autoitscript.com/trac/autoit/ticket/4083
  5. Do you want to open a ticket yourself or should I do it for you?
  6. here you have better example: Global $oCOM_ErrorHandler = ObjEvent("AutoIt.Error", _ComErrorHandler) Global $oFake[] Global $oTestObject[] $oFake.TestObject = $oTestObject $oFake.TestObject.Check1 = 1 $oFake.FakeObject = 1 $oFake.FakeObject.Check2 = 1 Func _ComErrorHandler(ByRef $oError) #forceref $oError ConsoleWrite("! We intercepted a COM Error" & @CRLF) EndFunc ;==>_ComErrorHandler
  7. so I modify yours example: Global $oCOM_ErrorHandler = ObjEvent("AutoIt.Error", _ComErrorHandler) Global $oFake[] $oFake.Fake1 = 1 $oFake.Fake1.Fake2 = 1 Func _ComErrorHandler(ByRef $oError) #forceref $oError ConsoleWrite("! We intercepted a COM Error" & @CRLF) EndFunc ;==>_ComErrorHandler and yes you caught a malicious imp Please feel free to open ticket: https://www.autoitscript.com/trac/autoit
  8. this ; Initialize COM error handler $oErrorHandler = ObjEvent("AutoIt.Error", _ErrFunc) Func _ErrFunc($oError) ConsoleWrite("!ERROR caught" & @CRLF) EndFunc ; Create shell object $oObj = ObjCreate("shell.application") ;The following line should trigger COM error handler (at the last dot). $oObj.Windows().Item(666).bzzzzzzz = 2 still works. checking yours.
  9. Take a look here: https://www.autoitscript.com/trac/autoit/ticket/3167 I think this was fixed in 2021 > 3.3.16.0 (March 06, 2022) (Release) I even tested the example in ticket #3167 and modified them by adding report from 3.3.18.0
  10. I'm little confused. Do you mean that this issue occurs on Au3.3.18.0 ?
  11. hm... as for now I found that ListView can use $WS_EX_LEFTSCROLLBAR : #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include <WindowsStylesConstants.au3> Example() Func Example() GUICreate("listview items", 220, 250, 100, 200, -1) GUISetBkColor(0x00E0FFFF) ; will change background color Local $idListview = GUICtrlCreateListView("col1 |col2|col3 ", 10, 10, 200, 150, -1, $WS_EX_LEFTSCROLLBAR) Local $idButton = GUICtrlCreateButton("Value?", 75, 170, 70, 20) For $i = 1 To 20 GUICtrlCreateListViewItem($i & "_1|" & $i & "_2|" & $i & "_2", $idListview) Next GUISetState(@SW_SHOW) ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $idButton MsgBox($MB_SYSTEMMODAL, "listview item", GUICtrlRead(GUICtrlRead($idListview)), 2) EndSwitch WEnd EndFunc ;==>Example
  12. I would like kindly ask about example for ListView with own ScrollBar using WM_VSCROLL and WM_HSCROLL. Or just point me out to giving me a fishing rod. What's the goal? I'd like to have a standard ListView (LTR Layout ), but with a separate vertical Scroll control on the left of the ListView and, with a separate horizontal Scroll control at the top of the ListView.
  13. I was working with LV justification. Here is my modified _GUICtrlListView_JustifyColumn.au3 : #include <GUIConstantsEx.au3> #include <GuiListView.au3> #include <MsgBoxConstants.au3> #include <ListViewConstants.au3> #include <WindowsStylesConstants.au3> Example() Func Example() GUICreate("ListView Justify (v" & @AutoItVersion & ")", 400, 300) Local $idListview If $IDNO = MsgBox($MB_YESNO + $MB_TOPMOST + $MB_ICONQUESTION + $MB_DEFBUTTON2, "Question", _ "Right to Left Text (RTL Layout) ?") Then $idListview = GUICtrlCreateListView("", 2, 2, 394, 268) Else $idListview = GUICtrlCreateListView("", 2, 2, 394, 268, BitOR($LVS_SHOWSELALWAYS, $LVS_SINGLESEL), $WS_EX_LAYOUTRTL) EndIf GUISetState(@SW_SHOW) ; Set ANSI format ;~ _GUICtrlListView_SetUnicodeFormat($idListview, False) ; Add columns _GUICtrlListView_AddColumn($idListview, "Column 1", 100) _GUICtrlListView_AddColumn($idListview, "Column 2", 100) _GUICtrlListView_AddColumn($idListview, "Column 3", 100) ; Change column Local $aInfo, $sInformation = '' For $i = 0 To 2 $aInfo = _GUICtrlListView_GetColumn($idListview, $i) $sInformation &= "Column " & $i & " justification: " & $aInfo[0] & @CRLF Next MsgBox($MB_SYSTEMMODAL, "Information before justification", $sInformation) $sInformation = '' _GUICtrlListView_JustifyColumn($idListview, 0, 0) _GUICtrlListView_JustifyColumn($idListview, 1, 1) _GUICtrlListView_JustifyColumn($idListview, 2, 2) For $i = 0 To 2 $aInfo = _GUICtrlListView_GetColumn($idListview, $i) $sInformation &= "Column " & $i & " justification: " & $aInfo[0] & @CRLF Next MsgBox($MB_SYSTEMMODAL, "Information after justification", $sInformation) ; Loop until the user exits. Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete() EndFunc ;==>Example Help file says: $iAlign [optional] Alignment of the column header and the subitem text in the column: 0 - Text is left aligned 1 - Text is right aligned 2 - Text is centered But the description is only correct for the LTR layout, and if you're using the RTL layout, the description seems misleading. Any ideas on how to improve the description? maybe just: $iAlign [optional] Alignment of the column header and the subitem text in the column: 0 - Text is left aligned for LTR Layout, and right aligned for RTL Layout 1 - Text is right aligned for LTR Layout, and left aligned for RTL Layout 2 - Text is centered
×
×
  • Create New...