
JonnyThunder
Active Members-
Posts
106 -
Joined
-
Last visited
Everything posted by JonnyThunder
-
Getting selected row in ListView
JonnyThunder replied to JonnyThunder's topic in AutoIt General Help and Support
Thanks guys - got it. :-) -
Hello, I've been struggling with this one all morning. I've got a ListView on my form and a delete button. I want to be able to click a row, then click the delete button. How can I get the index of the row which is currently selected when I click my button? Cheers, JT
-
Possible ListView Item Copy bug
JonnyThunder replied to JonnyThunder's topic in AutoIt General Help and Support
Okay cool. Thanks again for your help guys. -
Possible ListView Item Copy bug
JonnyThunder replied to JonnyThunder's topic in AutoIt General Help and Support
Thanks very much for your time and effort guys. The post that KaFu made does seem to work - but I don't fully understand why the original example I posted only worked in one direction but not both? Just for completeness, can you fill in the missing details for me? Thanks again though. I'm up and running with drag'n'drop goodness! :-) Oh, thanks for the pointer about sleeping my loop. Am I mistaken, but I also seem to remember something in a previous version history which said that tight loops like this were more CPU friendly now than in older versions of AutoIT? p.s. Should I now close the bug ticket? Or is there still an issue here? -
You should read here
-
Possible ListView Item Copy bug
JonnyThunder replied to JonnyThunder's topic in AutoIt General Help and Support
I've now posted a bug report about this issue. Fairly sure it's not down to bad programming! You can view the bug ticket here. -
Hello, I've been doing some fairly hefty exploration with listviews and no matter what I try, I can't get this copy to work. Attached is a chunk of code. When you run it, you'll notice that you can drag items from the left to the right. However, when you drag items from right to left - it copies them but doesn't remove them. Is this an AutoIT bug? I'm using version 3.3.2.0. If this isn't a bug, I'd sure appreciate it if someone could tell me what I'm doing wrong here. Cheers, JT UPDATE: I've just tried it with v3.3.6.0 and it's the same! ; Includes first! Must must must! #include <GUIConstantsEx.au3> #include <ListViewConstants.au3> #Include <GuiListView.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <Array.au3> #include <Misc.au3> ; Switch on the 'onEvent' notifications Opt ("GUIOnEventMode", 1) ; Generate the GUI! Ahoy there. Global $MainForm, $list_source, $list_target $MainForm = GUICreate(" TEST! ", 517, 178) ; Source list box $list_source = GUICtrlCreateListView("Title|Details", 13, 16, 240, 136, BitOR($LVS_REPORT,$LVS_SHOWSELALWAYS,$LVS_SORTASCENDING)) ; Target list box $list_target = GUICtrlCreateListView("Title|Details", 261, 16, 240, 136, BitOR($LVS_REPORT,$LVS_SHOWSELALWAYS,$LVS_SORTASCENDING)) ; Populate box with some test stuff For $x = 1 to 6 GUICtrlCreateListViewItem( _makeJunkName() & "|" & _makeJunkName(), $list_source) Next ; Handle GUI events GUISetOnEvent($GUI_EVENT_PRIMARYDOWN, "_dragHandler") GUISetOnEvent($GUI_EVENT_CLOSE, "_formEvents") GUISetOnEvent($GUI_EVENT_MINIMIZE, "_formEvents") GUISetOnEvent($GUI_EVENT_RESTORE, "_formEvents") ; Show the form GUISetState(@SW_SHOW) ; Main program loop While 1 ; Don't really do much in here at all... WEnd ; Create a junk name for testing Func _makeJunkName() Local $labelout = '' For $i = 1 to 10 $labelout &= chr(Random(65,90,1)) Next Return $labelout EndFunc ; Function to handle drag and drop Func _dragHandler() ; Define some stuff Local $source, $desc Local $cinfo = GUIGetCursorInfo (WinGetHandle($MainForm)) Local $direction = 0 ; Check we are dragging from one or the other boxes If $cinfo[4] = $list_source OR $cinfo[4] = $list_target Then ; Are we moving from source to destination If $cinfo[4] = $list_source Then $direction = 1 EndIf ; Or are we moving from destination to source If $cinfo[4] = $list_target Then $direction = 2 EndIf ; Doublecheck we're pressing mouse button If _IsPressed(1) Then if $direction = 1 Then $selecteditems = _GUICtrlListView_GetSelectedCount($list_source); Else $selecteditems = _GUICtrlListView_GetSelectedCount($list_target); EndIf ; Check we actually have selected an item If $selecteditems >= 1 Then ; Wait for keypress! While _IsPressed(1) WEnd ; Get new position Local $newcinfo = GUIGetCursorInfo (WinGetHandle($MainForm)) ; If we were moving from source to destination and we ARE in the destination box If $direction = 1 And $newcinfo[4] = $list_target Then ConsoleWrite("Moved " & $selecteditems & " items from source to destination" & @CRLF) _GUICtrlListView_CopyItems ($list_source, $list_target, 1) EndIf ; If we are moving from destination to source and we ARE in source box If $direction = 2 And $newcinfo[4] = $list_source Then ConsoleWrite("Moved " & $selecteditems & " items from destination to source" & @CRLF) _GUICtrlListView_CopyItems ($list_target, $list_source, 1) EndIf EndIf EndIf EndIf EndFunc ; Function to handle other form events Func _formEvents() Select Case @GUI_CtrlId = $GUI_EVENT_CLOSE Exit EndSelect EndFunc
-
That's quite odd - we have 6000 or so users and it works fine for me. Water : nice one, I'll keep an eye on this page for updates!
-
It's still hugely impressive - many thanks to you and Jonathan Clelland for all the work. I've just been raking through the list of examples and they all work beautifully. I've got a big project away to start which will require a lot of AD integration and querying so this just saved me a huge chunk of time. Nice one fella.
-
You've done a brilliant job on this sir, thanks for the effort!
-
Run a script as a service
JonnyThunder replied to JonnyThunder's topic in AutoIt General Help and Support
Yes, when I try to start the service I get the error above. I get it whether I use the UDF posted earlier or from the command line using SC.EXE. Or even if I try to start the service from the Services list. -
Run a script as a service
JonnyThunder replied to JonnyThunder's topic in AutoIt General Help and Support
Sadly it isn't that easy. The command I posted originally DOES install the service but it doesn't actually start. -
Run a script as a service
JonnyThunder replied to JonnyThunder's topic in AutoIt General Help and Support
Thanks, I'd already read that earlier on - but I was trying to make use of SC.EXE which is 'meant' to be able to do this. I already tested the script with RunAsSvc and it works fine with that too. Just seems to be SC.EXE which is a problem, though I can't think why. -
Hello, I've read various topics on here about running the script as a service but can't get it to work. Here is the test script I'm running.... #NoTrayIcon While 1=1 Beep(4000, 200) Sleep(400) WEnd Then I create a service with this.... sc.exe create "MyService" binpath= "C:\MyScript.exe" type= own type= interact start= auto DisplayName= "MyService" The service is created fine. However, when I try to start the service with this.... sc.exe start "MyService" ... I get the following message... Can anyone show me how to actually do this? Cheers, JT
-
Ah cool, thanks for that.
-
Hello, In release v3.3.2.0 of AutoIT, it states in the help file change log that "GUI without title bar (no $WS_CAPTION) can be moved with the mouse". I wrote this test script but cannot move the window. #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Form1", 209, 146, 192, 114, BitOR($WS_SIZEBOX,$WS_THICKFRAME,$WS_POPUP,$WS_CLIPSIBLINGS)) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Is this a bug or am I doing it wrong? Thanks, JT
-
Prevent script process ending
JonnyThunder replied to JonnyThunder's topic in AutoIt General Help and Support
Thanks for the replies! I'd considered running as a service already but can't really do this because the app requires some user specific information to run. I'll take these ideas onboard though and have a look at them for sure. Thanks again, JT -
Hello, Does anyone know of a way to run a script without the ability to kill the process as a user? The background is, we have a power management script which runs on all of our computers. The problem is that the script is run on login and has user permissions. Some of the users don't like the script running, but it's now mandatory that it runs for everyone. These users are killing the process for the script. We need to find a way to stop them doing that. Any ideas anyone??
-
Actually I totally agree with lostbit. It's helpful to know that a SPECIFIC problem has been resolved with a SPECIFIC answer. Some of the largest forums on the web have this feature, so that someone can chase a problem and find an answer without duplication of posts, or having to search threads which end with no resolution or practical information. There's really no need to mock the idea - it's a perfectly valid and useful idea. EDIT: It's also not the same as using the search tool. You can search for any amount of topics - but you can't know they have resolved an issue without reading through them all.
-
Running in tray on server
JonnyThunder replied to JonnyThunder's topic in AutoIt General Help and Support
Yes, the client which runs in the system tray also uses a SQLite database for incoming / outgoing messages from the server. But it's not a problem giving rights to all files required on the server. -
Running in tray on server
JonnyThunder replied to JonnyThunder's topic in AutoIt General Help and Support
p.s. That IS a very good point. Thankfully I'm not one of them. I just thought the whole way of using an autoit program as a service is messy (read it in the FAQ). Wondered if there was a cleaner way to do it. -
Running in tray on server
JonnyThunder replied to JonnyThunder's topic in AutoIt General Help and Support
Lol.... okay okay. Lets start again. Is there any way to do this WITHOUT a service. Or are services the only way that apps can be run between various users without reloading them? -
Running in tray on server
JonnyThunder replied to JonnyThunder's topic in AutoIt General Help and Support
Not helpful. Would I be posting on a help forum if I hadn't already had a scan through the help file? Plus, posting comments like that assumes that a person knows what to search for in the documentation which is usually half the battle. That's kind of like telling me to look up the meaning for a word in the dictionary, when I don't know what the word is that I'm looking for. I can't see mention anywhere in the documents regarding server use of AutoIt. I can see lots of documentation about the tray icon, and none (that I have found) mentions multiple users on a server. -
Running in tray on server
JonnyThunder replied to JonnyThunder's topic in AutoIt General Help and Support
Thanks for the reply. Sadly, that's what I have done. But on a server, if I log in using my account and start up the application, other users cannot see it when they log in. I need it to be persistent for all users. (there is no GUI at all - only a tray icon with some tray options).