Schlumpf Posted April 3, 2007 Share Posted April 3, 2007 @PaulIA: Your AVI-Finctions are very intersting. But how can I display an AVI on a tab? [CENTER]Sorry for my bad English... ;)[/CENTER] Link to comment Share on other sites More sharing options...
PaulIA Posted April 3, 2007 Author Share Posted April 3, 2007 PaulIA, I am getting the error bellow on performing rightclick mouse on the nodes. I ran the example "Tree View 1.au3". What is wrong? C:\PROGRA~1\AutoIt3\beta\Include\A3LStructs.au3 (54) : ==> Subscript used with non-Array variable.: Local $iElement = Eval($aTag[0] & $sElement) Local $iElement = Eval($aTag^ ERROR ThanksThere is a bug in _TreeView_HitTestNode that was previously identified and has been fixed for the next release. Until then, just change _TreeView_HitTestNode to this: Func _TreeView_HitTestNode($hWnd, $iX, $iY) Local $tHitTest $tHitTest = _TreeView_HitTestEx($hWnd, $iX, $iY) Return _tagGetData($tHitTest, "Item") EndFunc Auto3Lib: A library of over 1200 functions for AutoIt Link to comment Share on other sites More sharing options...
lsakizada Posted April 3, 2007 Share Posted April 3, 2007 There is a bug in _TreeView_HitTestNode that was previously identified and has been fixed for the next release. Until then, just change _TreeView_HitTestNode to this: Func _TreeView_HitTestNode($hWnd, $iX, $iY) Local $tHitTest $tHitTest = _TreeView_HitTestEx($hWnd, $iX, $iY) Return _tagGetData($tHitTest, "Item") EndFunc Thanks for the quick response. I am about to spend much more time on yours library because I think it is cover areas that Autoit library lack of them. I think you have done a very long way for Autoit. Have a good one. Be Green Now or Never (BGNN)! Link to comment Share on other sites More sharing options...
PaulIA Posted April 3, 2007 Author Share Posted April 3, 2007 @PaulIA: Your AVI-Finctions are very intersting. But how can I display an AVI on a tab?In order to do this, you'd need to be able to get the window handle of the AutoIt tab item. I have not found a way to do this, but if you figure it out, let me know. Auto3Lib: A library of over 1200 functions for AutoIt Link to comment Share on other sites More sharing options...
mlazovjp Posted April 3, 2007 Share Posted April 3, 2007 I have the same issue as the guy who posted this message.That is, I am trying to uncheck "Client for Microsoft Networks" and "File and Printer Sharing for Microsoft Networks" in the "Local Area Connection Properties" of my NIC in Windows XP.Using the built-in AutoIt 3 functions, I can get it to move to and then highlight the right item(s) in the SysListView321 control. However, I cannot figure out how to make it check or uncheck the item.Here is the AutoIt v3 native code:Dim $index, $items, $text, $state Dim $MSSharingName = 'File and Printer Sharing for Microsoft Networks' $index = ControlListView ( 'Local Area Connection Properties', 'Connect using:', 'SysListView321', 'FindItem', $MSSharingName ) ControlListView ( 'Local Area Connection Properties', 'Connect using:', 'SysListView321', 'Select', $index )I saw that GAFrost responded to the other guy and told him to use Auto3Lib.So I downloaded it and extracted all of the files in the Include dir into my AutoIt 3 Include dir (hope that was what I was supposed to do).Now ... what function do I use to check off the selected item??Thanks in adavance. Link to comment Share on other sites More sharing options...
PaulIA Posted April 3, 2007 Author Share Posted April 3, 2007 That is, I am trying to uncheck "Client for Microsoft Networks" and "File and Printer Sharing for Microsoft Networks" in the "Local Area Connection Properties" of my NIC in Windows XP.Something like this: CODEexpandcollapse popup#include <A3LListView.au3> #include <A3LMenu.au3> Global $hList, $iIndex ; Run the "Network and Dialup Connections" dialog Run("RunDll32.exe shell32.dll,Control_RunDLL ncpa.cpl") _Lib_WinWaitActive("Network Connections") ; Get the "Network Connections" ListView handle $hList = ControlGetHandle("Network Connections", "", "SysListView321") if @Error then _Lib_ShowError("Unable to get Network Connections ListView handle") ; Find the Local Area Connections item $iIndex = _ListView_FindText($hList, "Local Area Connection") if $iIndex = -1 then _Lib_ShowError("Unable to get Local Area Connections") endif ; Right click on the item _ListView_ClickItem($hList, $iIndex, "right", False, 1, 1, True) ; Select the "Properties" menu item from the popup menu _Menu_ClickPopupAccel("r") _Lib_WinWaitActive("Local Area Connection Properties") ; Get the "Network Connection Properties" ListView handle $hList = ControlGetHandle("Local Area Connection Properties", "", "SysListView321") if @Error then _Lib_ShowError("Unable to get Local Area Connection Properties ListView handle") ; Uncheck "Client for Microsoft Networks" $iIndex = _ListView_FindText($hList, "Client for Microsoft Networks") _SetChecked($hList, $iIndex, False) ; Uncheck "File and Printer Sharing for Microsoft Networks" $iIndex = _ListView_FindText($hList, "File and Printer Sharing for Microsoft Networks") _SetChecked($hList, $iIndex, False) Func _GetChecked($hWnd, $iIndex) Return _ListView_GetItemStateImage($hWnd, $iIndex) = 2 EndFunc Func _SetChecked($hWnd, $iIndex, $fCheck) if _GetChecked($hWnd, $iIndex) <> $fCheck then _ListView_ClickItem($hWnd, $iIndex) Send("{SPACE}") endif EndFuncThis code was adapted from the NetCon.au3 demo in the Auto3Lib Misc folder. The GetChecked/SetChecked functions are in the next release, which should be in a few days. Auto3Lib: A library of over 1200 functions for AutoIt Link to comment Share on other sites More sharing options...
sherkas Posted April 4, 2007 Share Posted April 4, 2007 Question: Does _API_ReadProcessMemory allow you to read any programs memory like say a games? Also is there any place that has examples of alot of this api functions? Sometimes I draw blanks on some of them and its nice if there was a example script or something... Link to comment Share on other sites More sharing options...
mlazovjp Posted April 4, 2007 Share Posted April 4, 2007 (edited) Thank you, that is EXACTLY what I was looking for! I've been using a much less elegant solution for years now. I am VERY happy that I can interact with the controls directly now. Thank you very much! One minor thing though. When I tried to use the sample code you provided, AutoIt gave me an error during compile. It had to do with _ListView_GetItemStateImage($hWnd, $iIndex, $iImage) The Function shows the three parameters, but it only describes two of them (and you only included two in the sample code). I looked at _ListView_SetItemStateImage and saw the "missing" parameter was $iImage. I guessed (hopefully correctly) that all I had to do was add a value of '1' as the last parameter. It seems to work OK now. CODE Func _GetChecked($hWnd, $iIndex) Return _ListView_GetItemStateImage($hWnd, $iIndex) = 2 EndFunc Edited April 4, 2007 by mlazovjp Link to comment Share on other sites More sharing options...
PaulIA Posted April 4, 2007 Author Share Posted April 4, 2007 Question: Does _API_ReadProcessMemory allow you to read any programs memory like say a games?It can be used for this, but there are other memory UDFs here on the forum that are specifically designed for hacking games that you might want to look at first.Also is there any place that has examples of alot of this api functions? Sometimes I draw blanks on some of them and its nice if there was a example script or something...You might want to check out the MSDN site. It has a lot of examples of the API calls. Auto3Lib: A library of over 1200 functions for AutoIt Link to comment Share on other sites More sharing options...
PaulIA Posted April 4, 2007 Author Share Posted April 4, 2007 One minor thing though. When I tried to use the sample code you provided, AutoIt gave me an error during compile. It had to do with _ListView_GetItemStateImage($hWnd, $iIndex, $iImage)My mistake. I'm working with the new release and it's hard to transpose from one release to the other. That should be fixed now Auto3Lib: A library of over 1200 functions for AutoIt Link to comment Share on other sites More sharing options...
PaulIA Posted April 4, 2007 Author Share Posted April 4, 2007 This release includes an installer so that the files get put in the correct place. The installer copies the Auto3Lib include files to the AutoIt Include folder and then creates an Auto3Lib folder under the AutoIt folder which contains the examples and help file. I was going to wait to upgrade to the new Struct and DllStruct changes, but after using them a little I decided to switch the whole library over. The new DllStruct changes are an absolute gem for me as I no longer have to have the _tag functions anymore. Big two thumbs up to the AutoIt development team! Several minor modifications have been made to the library in regards to making sure that all of the API functions are fully implemented. I have also added a new function to the ListView module that allows you to bulk load ListView items. I have updated the help file with corrections/examples up to the Memory module. I will continue to update the help file over the next few releases. All of the bugs that have been reported have been fixed in this release. Auto3Lib: A library of over 1200 functions for AutoIt Link to comment Share on other sites More sharing options...
perrin_goldeneyes Posted April 4, 2007 Share Posted April 4, 2007 Hi Paul, First of all, thank you for your library, it's been very helpfull so far. Secondly, I believe there is still a bug in the new TreeView library (the one you uploaded just a moment ago), since I get this error message when I try to use it: >"C:\Program Files\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "D:\scripted demo files\scenario.au3" C:\Program Files\AutoIt3\Include\A3LTreeView.au3 (1504) : ==> Variable must be of type "Object".: $tItem.Mask = $TVIF_STATE $tItem^ ERROR >Exit code: 0 Time: 4.711 Any help on what I should change in the A3LTreeView file? The error is in relation to this method: Func _TreeView_GetState($hWnd, $hNode) Local $tItem $tItem = DllStructCreate($tagTVITEMEX) $tItem.Mask = $TVIF_STATE $tItem.hItem = $hNode _TreeView_GetItem($hWnd, $tItem) Return $tItem.State EndFunc Thanks in advance! Link to comment Share on other sites More sharing options...
Zedna Posted April 4, 2007 Share Posted April 4, 2007 Hi Paul,Secondly, I believe there is still a bug in the new TreeView library (the one you uploaded just a moment ago), since I get this error message when I try to use it:I'm here so I can answer to you quicker than PaulIA:You must use latest beta version of AutoIt. Resources UDF Â ResourcesEx UDF Â AutoIt Forum Search Link to comment Share on other sites More sharing options...
mlazovjp Posted April 4, 2007 Share Posted April 4, 2007 All of the bugs that have been reported have been fixed in this release. I have a new one for ya I ran your installer on my computer. When I try to compile a script which includes "A3LListView.au3" and "A3LMenu.au3", I get the following: C:\PROGRA~1\AutoIt3\Include\A3LListView.au3(610,23) : ERROR: _tagPOINT(): undefined function. $tPoint = _tagPOINT() ~~~~~~~~~~~~~~~~~~~~~~^ C:\PROGRA~1\AutoIt3\Include\A3LListView.au3(611,99) : ERROR: _tagGetPtr(): undefined function. $aDrag[0] = "0x" & Hex(_API_SendMessage($hWnd, $LVM_CREATEDRAGIMAGE, $iIndex, _tagGetPtr($tPoint) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\PROGRA~1\AutoIt3\Include\A3LListView.au3(612,39) : ERROR: _tagGetData(): undefined function. $aDrag[1] = _tagGetData($tPoint, "X") ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\PROGRA~1\AutoIt3\Include\A3LListView.au3(772,38) : ERROR: _tagCHARARRAY(): undefined function. $tBuffer = _tagCHARARRAY($iBuffer) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\PROGRA~1\AutoIt3\Include\A3LListView.au3(775,34) : ERROR: _tagSetData(): undefined function. _tagSetData($tBuffer, 1, $sText) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ Link to comment Share on other sites More sharing options...
PaulIA Posted April 4, 2007 Author Share Posted April 4, 2007 (edited) I have a new one for ya I ran your installer on my computer. When I try to compile a script which includes "A3LListView.au3" and "A3LMenu.au3", I get the following: C:\PROGRA~1\AutoIt3\Include\A3LListView.au3(610,23) : ERROR: _tagPOINT(): undefined function. $tPoint = _tagPOINT() ~~~~~~~~~~~~~~~~~~~~~~^ C:\PROGRA~1\AutoIt3\Include\A3LListView.au3(611,99) : ERROR: _tagGetPtr(): undefined function. $aDrag[0] = "0x" & Hex(_API_SendMessage($hWnd, $LVM_CREATEDRAGIMAGE, $iIndex, _tagGetPtr($tPoint) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\PROGRA~1\AutoIt3\Include\A3LListView.au3(612,39) : ERROR: _tagGetData(): undefined function. $aDrag[1] = _tagGetData($tPoint, "X") ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\PROGRA~1\AutoIt3\Include\A3LListView.au3(772,38) : ERROR: _tagCHARARRAY(): undefined function. $tBuffer = _tagCHARARRAY($iBuffer) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ C:\PROGRA~1\AutoIt3\Include\A3LListView.au3(775,34) : ERROR: _tagSetData(): undefined function. _tagSetData($tBuffer, 1, $sText) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^Before you run the installer, delete all of the A3L*.* files from your AutoIt Include folder. You're using files from the last release. Edited April 4, 2007 by PaulIA Auto3Lib: A library of over 1200 functions for AutoIt Link to comment Share on other sites More sharing options...
bobneumann Posted April 4, 2007 Share Posted April 4, 2007 what do you think of including something like this in your library. It could come in handy in a lot of ways...http://www.autoitscript.com/forum/index.php?showtopic=43214Thanks! If you have any suggestions for other enhancements, drop me a note. Link to comment Share on other sites More sharing options...
PaulIA Posted April 5, 2007 Author Share Posted April 5, 2007 what do you think of including something like this in your library. It could come in handy in a lot of ways...http://www.autoitscript.com/forum/index.php?showtopic=43214I've got to admit, that's really interesting. It never ceases to amaze me what you can do with AutoIt. Developing widgets is probably not something that I will tackle in the near future, but maybe something to think about down the road. Auto3Lib: A library of over 1200 functions for AutoIt Link to comment Share on other sites More sharing options...
florisch Posted April 5, 2007 Share Posted April 5, 2007 I dont get it. Am I missing something here? I tried lots of things with the _ListView_, but this does not work out as expected. expandcollapse popup#include <A3LListview.au3> #include <array.au3> #Include <GuiListView.au3> Global $hGUI, $hHeader, $iMemo, $listview, $hlistview, $aTemp Global $Form1 = GUICreate("Test _ListView_", 695, 710, 195, 118, $WS_SIZEBOX + $WS_SYSMENU ) Global $ListView = _ListView_Create($Form1, 16,170,530,460,BitOR($LVS_REPORT,$LVS_NOSORTHEADER,$LVS_SHOWSELALWAYS)) ; $WS_EX_CLIENTEDGE does not work on init, but behaves as expected after manually resizing a column header. _ListView_SetExtendedListViewStyle($ListView, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_BORDERSELECT, $WS_EX_CLIENTEDGE)) GUICtrlSetResizing ($ListView, $GUI_DOCKBORDERS) ; does not work with _ListView_Create created Listviews _GUICtrlListViewInsertColumn($ListView, 0, "Status", 0, 25) _GUICtrlListViewInsertColumn($ListView, 1, "configuration", 0, 50) _GUICtrlListViewSetColumnWidth($Listview, 0, $LVSCW_AUTOSIZE_USEHEADER) _GUICtrlListViewSetColumnWidth($Listview, 1, $LVSCW_AUTOSIZE_USEHEADER) _GUICtrlListViewInsertColumn($ListView, 2, "Sources", 2, 0) ; hidden columns _GUICtrlListViewInsertColumn($ListView, 3, "Copies", 2, 0) GUISetState() ; ---- trying a lot of things, experiencing strange behaviour --- ; uncomment one of the following lines. I do not understand this. ;_GUICtrlListViewInsertColumn($ListView, 0, "Test2", 0, 50) ;_ListView_InsertColumn($ListView, 0, "Test1", 50) ; uncommenting this gives strange results ;_ListView_AddItem($ListView, "item1") ;_GUICtrlListViewInsertItem($ListView, 1, "item 2") ; no item text seen, dragging this empty item crashes autoit ; these two lines change a lot more than just displaying something $aTemp = _ListView_GetColumn($ListView, 1) _ArrayDisplay($aTemp, "Test") ;_GUICtrlListViewSetColumnHeaderText($ListView, 0, "changed") ;_GUICtrlListViewSetColumnHeaderText($ListView, 1, "changed too") ;_ListView_SetColumn($ListView, 0, "changed by _ListView_", 100) ; Loop until user exits do until GUIGetMsg() = $GUI_EVENT_CLOSE Try and uncomment each one of those lines. I really want to use this great library, but up to now, i just cannot use it, I will go coding workarounds for functions that are there but do not work as expected. Link to comment Share on other sites More sharing options...
PaulIA Posted April 5, 2007 Author Share Posted April 5, 2007 I dont get it. Am I missing something here? I tried lots of things with the _ListView_, but this does not work out as expected. expandcollapse popup#include <A3LListview.au3> #include <array.au3> #Include <GuiListView.au3> Global $hGUI, $hHeader, $iMemo, $listview, $hlistview, $aTemp Global $Form1 = GUICreate("Test _ListView_", 695, 710, 195, 118, $WS_SIZEBOX + $WS_SYSMENU ) Global $ListView = _ListView_Create($Form1, 16,170,530,460,BitOR($LVS_REPORT,$LVS_NOSORTHEADER,$LVS_SHOWSELALWAYS)) ; $WS_EX_CLIENTEDGE does not work on init, but behaves as expected after manually resizing a column header. _ListView_SetExtendedListViewStyle($ListView, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_BORDERSELECT, $WS_EX_CLIENTEDGE)) GUICtrlSetResizing ($ListView, $GUI_DOCKBORDERS) ; does not work with _ListView_Create created Listviews _GUICtrlListViewInsertColumn($ListView, 0, "Status", 0, 25) _GUICtrlListViewInsertColumn($ListView, 1, "configuration", 0, 50) _GUICtrlListViewSetColumnWidth($Listview, 0, $LVSCW_AUTOSIZE_USEHEADER) _GUICtrlListViewSetColumnWidth($Listview, 1, $LVSCW_AUTOSIZE_USEHEADER) _GUICtrlListViewInsertColumn($ListView, 2, "Sources", 2, 0) ; hidden columns _GUICtrlListViewInsertColumn($ListView, 3, "Copies", 2, 0) GUISetState() ; ---- trying a lot of things, experiencing strange behaviour --- ; uncomment one of the following lines. I do not understand this. ;_GUICtrlListViewInsertColumn($ListView, 0, "Test2", 0, 50) ;_ListView_InsertColumn($ListView, 0, "Test1", 50) ; uncommenting this gives strange results ;_ListView_AddItem($ListView, "item1") ;_GUICtrlListViewInsertItem($ListView, 1, "item 2") ; no item text seen, dragging this empty item crashes autoit ; these two lines change a lot more than just displaying something $aTemp = _ListView_GetColumn($ListView, 1) _ArrayDisplay($aTemp, "Test") ;_GUICtrlListViewSetColumnHeaderText($ListView, 0, "changed") ;_GUICtrlListViewSetColumnHeaderText($ListView, 1, "changed too") ;_ListView_SetColumn($ListView, 0, "changed by _ListView_", 100) ; Loop until user exits do until GUIGetMsg() = $GUI_EVENT_CLOSE Try and uncomment each one of those lines. I really want to use this great library, but up to now, i just cannot use it, I will go coding workarounds for functions that are there but do not work as expected.You can not mix ListView calls between AutoIt and Auto3Lib. When AutoIt creates a ListView control, it does a bunch of stuff to it to make it compatiable with the standard AutoIt functions. In doing so, the ListView no longer works with many of the Windows ListView API calls. Auto3Lib creates a "native" Windows ListView control which allows you to use all of the Windows ListView API calls. What you are attempting to do (add/modify the ListView columns) is already included in the Auto3Lib ListView library. Take a look at the _ListView_InsertColumn and _ListView_SetColumnWidth UDFs (and especially the ListView demos in the Examples folder). Auto3Lib: A library of over 1200 functions for AutoIt Link to comment Share on other sites More sharing options...
decypher Posted April 6, 2007 Share Posted April 6, 2007 Hello! I try to run an example from the auto3lib manual and everytime i get error message: ------------------------------------- Line 124 (File "C:\Program Files\AutoIt3\Include\A3LListbox.au3"): $tBuffer.Text = $sText $tBuffer^ERROR Error: Variable must be of type "Object" -------------------------------------- What is wrong here? Link to comment Share on other sites More sharing options...
Recommended Posts