Jump to content

cappy2112

Active Members
  • Posts

    168
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

cappy2112's Achievements

Prodigy

Prodigy (4/7)

0

Reputation

  1. Well, I don't see anything move other than tht Mouse Arrow pointer, it's just pivoting left & right, but only a small amount. My monitors are 24 inches wide, so the desktop size is probably 1980 & 1600 (or close to that). Are video attachments allowed? Can I attach a small video from my phone to show you? Noone has answered my question- What is supposed to move? The mouse arrow pointer, or the I-Beam cursor?
  2. So that I can see the movement. I know the coordinate unites are very small (in pixels ??), I wanted to verify that I could see some movement, so I repeated the same mousemove() call many times.
  3. Do you not see the two calls to MouseMove() with different x coordinates?
  4. Is MouseMove() supposed to move the Mouse pointer (the arrow) or the text cursor (the I beam) ? What units are the X & Y coordinates for the mouse ? When I run the following code (copied from the examples directory, and put into a loop) The mouse pointer just wiggles a very small amount. I can't seem to make it move from the right side of the screen to the left Local $loopCount = 0 Local $maxLoops = 10 While $loopCount < $maxLoops MouseMove(10, 100,0) ; Move the mouse cursor to the x, y position of 10, 100. Sleep(400) MouseMove(10000, 100, 0) ; Move the mouse cursor to the x, y position of 700, 700 and move instantly. $loopCount = $loopCount + 1 Sleep(400) WEnd Thanks
  5. Previous reply In the URL above, JLogan3013 posted some code to create a listview. This has been quite helpful. I've been trying to add a second column into the ListView, so that I can provide a mechanism for the user to paste in a path, for each of the items in the first column. See the attached screenshot of what I'm trying to do- using AutoIt. Column0 is contains a list of Windows found by WinList() Column1 will contain a path- that the user provides. I've been going back and forth between _GUICtrlListView_AddSubItem(), _GUICtrlListView_InsertColumn, and _GUICtrlListView_AddSubItem(), trying to get a second column, but it's not going well. The examples I've been reading in the AutoIt help file for those APIs (and others) did not do what I was expecting. My code is now a mess of comments, but it started as a working a example from JLogan3013. Which function should I use to add the second column? Func ShowListView($WindowList) Const $Centered = -1 Local $aList, $hGUI Local $HWinSize = 900 Local $VWinSize = 600 Local $ListboxColWidth Local $i Local $WindowCount If IsArray($WindowList) Then $hGUI = GUICreate("Window Instances", 900, 300, $Centered, $Centered) $ListboxColWidth = $HWinSize - 20 $hListView = GUICtrlCreateListView("", 10, 10, $ListboxColWidth, 200) _GUICtrlListView_SetColumnWidth($hListView, 1, $ListboxColWidth) ;_GUICtrlListView_InsertColumn($hListView, 2, "Column 1", 100) $btnDone = GUICtrlCreateButton("DONE", ($HWinSize / 2) - 20, 235, 55, 45) $WindowCount = $WindowList[0][0] GUICtrlCreateListViewItem($WindowList[1][0], $hListView) For $i = 1 To $WindowCount ;GUICtrlCreateListViewItem($hListView, $WindowList[$i][0],) _GUICtrlListView_AddItem($hListView, $WindowList[$i][0], $i) ;_GUICtrlListView_AddItem($idListview, "Row 1: Col 1", 0) ;_GUICtrlListView_AddSubItem($hListView, 0, "Z:\NetworkPath\Hawk5\KVM1", $i) Next If ($WindowCount > 1) Then EndIf GUIRegisterMsg($WM_NOTIFY, "_WM_NOTIFY") GUISetState(@SW_SHOW) While 1 $aTemp = _GUICtrlListView_GetItemTextArray($hListView) Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $btnDone If ($aTemp[0] = 0) Then _ArrayDisplay($aTemp) MsgBox($MB_OK, "", "Please select a window first") Else _ArrayDisplay($aTemp) MsgBox($MB_OK, "", "You selected " & $aTemp[1]) EndIf EndSwitch WEnd GUIDelete() Else MsgBox($MB_ICONWARNING, "IsArray()", "LIST VIEW is not an array") EndIf EndFunc ;==>ShowListView Func _WM_NOTIFY($nWnd, $iMsg = "", $wParam = "", $lParam = "") Local $tStruct = DllStructCreate("hwnd;uint_ptr;int_ptr;int;int", $lParam) If BitAND(DllStructGetData($tStruct, 3), 0xFFFFFFFF) = $NM_CLICK Then ; Code $hCurrListView = DllStructGetData($tStruct, 1) ; ListView handle EndIf EndFunc ;==>_WM_NOTIFY
  6. Thanks. StringReplace() requires that you know what the contents are. I am looking for a function to initialize the contents of an array to a known value. I know a for loop would work, and that I can easily wrap that in my own function, and pass in the array and the size. If that functionality can be replaced by a builtin function that is written in C (or C++, whichever language AutoIt is written in), that's what I would use.
  7. Thanks. I've found some of the examples in the Examples directory, and started with something very similar. I see your example handles the issue I was struggling with though, creating dynamic list entries on the fly. Your approach makes sense- I knew there has to be some way to do this, I was just looking for an example of a dynamic GUI. BTW- Does AutoIt have the equivalent (~workalike) of C's memset()? Thanks!!
  8. When I call Winlist(), the first entry in the array is typically between 500-600, and it obviously will fluctuate. However, I don't have that many programs working, so where are all of these windows? I know that many processes are running in the background, but having looked at Task Manager many times, I'd say that 100 or less processes are typically running. From the AutoIt Help file: Given that the term "Window" can mean different things to different people, I generally associate this with the "frame" of a top level Window, that is clearly visible, either maximized or minimized. I don't know how AutoIt defines 'Window" nor if it modifies the OS's definition of "Window". To some, Window could also refer to every Button and other clickable items visible, and if so, that could account for the numbers ff "Windows" being returned from WinList(). What are your thoughts on this...?
  9. I've used WinList() to give me a list of all the windows it finds on the system. I then search through that list to find a few windows which match a title string. Now I want to present that smaller list of Title/strings to the user, so that they can select ONE of them. Which widget would be best for this operation? Ideally, the widget should return the index of the item selected, and if possible only allow the user to select 1 item. I don't expect there will be more than 10 Windows running on the systems I'm working with. In all practicality, I've only seen 4 at the max. Thanks
  10. Thank you- that's what I was hoping for. The less I need to write, the better. BTW- What is the preferred directory to install the UDFs, so the compiler finds them without having to fiddle with the path?
  11. Thank you. The cobwebs are slowly melting ;-)
  12. ReDim $WindowsDupe[(UBound($AllWindows))  -1][2] Why? All of the examples I've seen- including in the help file, always show UBound(Array) +1. Isn't dimension [2] out of bounds, for a 2D array?? ReDim $WindowsDupe[$TitleMatchCount + 1][2] Please explain dimension [2], since this is a 2D array. Do array indices start at 0 or 1, in AutoIT?
  13. The MsgBox() function is fine if your messages are very short. What are the AutoI alternatives if you need to display larger messages? Is there a lager dialog available, or do I need to write something from scratch? Thanks
  14. Hi, It's been a while since I've used AutoIt, but I'm having fun with it again. I'm running on Windows 7 Pro, 64_bit. with AutoIt 3.3.14.2+ In my program, I've called Winlist(), so that I can get a list of all windows on the system. I then iterate through the titles, and attempt to copy the title & handle of Windows I'm specifically interested in. While this seems to be a very easy task, I'm having a strange problem copying the title & handle of the two windows that I'm interested in. In the For loop: For $i = 1 To $AllWindowsCount ConsoleWrite() displays the expected Title & handle, from the WindowsDupe array, so it appears that the copy from the $AllWindows array works as expected. However, when _ArrayDisplay($WindowsDupe) is called after the for loop, $WindowsDupe is empty. I wasn't able to find any functions in the help file, for copying entire arrays or certain elements, so I thought I would just copy them manually, as seen in the for loop. What am I doing wrong with the WindowsDupe array? Thanks Thanks My code is attached. ListWindows2.au3
×
×
  • Create New...