
4Fun
Members-
Posts
17 -
Joined
-
Last visited
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
4Fun's Achievements

Seeker (1/7)
0
Reputation
-
Hi Gibbo - Looks useful, I would post it in the Example Scripts area and provide some examples - Good luck!
-
Gary, Thanks for the help! Is it possible to do this in OnEvent mode? If so can point me in the right direction. Your the best, Tim
-
Hi Gary, I used this in my project and it worked fine until I added a combo box. If I add the combo box to yours I get the same issue. The issue is once I edit the the item and press enter, it loops back to edit mode->enter->edit mode->enter ect. Here the code I added: $Property_Selection_Combobox = GUICtrlCreateCombo("New .....", 11, 704, 136, 25) Any idea how to fix this? 4Fun CODE #include <GuiConstants.au3> #include <GuiListview.au3> Global Const $DebugIt = 1 Global Const $WM_NOTIFY = 0x004E Global Const $NM_FIRST = 0 Global Const $NM_CLICK = ($NM_FIRST - 2) Global Const $NM_DBLCLK = ($NM_FIRST - 3) Global $ListView = -999 Global $Gui, $editFlag Global $editCtrl = "Edit1";name of the Edit control that pops up when edit a listitem.... _Main() Func _Main() Local $dll Local $Gui = GUICreate("Double Click Demo", 417, 356, 192, 125) $ListView = GUICtrlCreateListView("Items", 10, 10, 300, 200, $LVS_EDITLABELS);Important Style!!! $Property_Selection_Combobox = GUICtrlCreateCombo("New .....", 11, 704, 136, 25) GUICtrlSendMsg($ListView, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_GRIDLINES, $LVS_EX_GRIDLINES) ; Populate list and make it wide enough to see For $i = 1 To 10 GUICtrlCreateListViewItem("DoubleClick or press F2, then press Enter", $ListView) Next GUICtrlSendMsg($ListView, 0x101E, 0, -1);$listview, LVM_SETCOLUMNWIDTH, 0, resize to widest value GUISetState(@SW_SHOW) ;Register WM_NOTIFY events GUIRegisterMsg($WM_NOTIFY, "WM_Notify_Events") $dll = DllOpen("user32.dll") While 1 $msg = GUIGetMsg() _MonitorEditState($Gui, $editCtrl, $editFlag, $ListView, $dll) Select Case $msg = $GUI_EVENT_CLOSE ExitLoop ;Case $msg = $GUI_EVENT_PRIMARYDOWN ;CancelEdit($ListView) Case Else ;;;;;;; EndSelect WEnd DllClose($dll) EndFunc ;==>_Main Func ListView_Click() ;---------------------------------------------------------------------------------------------- If $DebugIt Then ConsoleWrite (_DebugHeader("$NM_CLICK")) ;---------------------------------------------------------------------------------------------- If ControlCommand($Gui, "", $editCtrl, "IsVisible", "") Then CancelEdit($ListView) $editFlag = 0 EndIf EndFunc ;==>ListView_Click Func ListView_DoubleClick() ;---------------------------------------------------------------------------------------------- If $DebugIt Then ConsoleWrite (_DebugHeader("$NM_DBLCLK")) ;---------------------------------------------------------------------------------------------- Rename($ListView) EndFunc ;==>ListView_DoubleClick ; WM_NOTIFY event handler Func WM_Notify_Events($hWndGUI, $MsgID, $wParam, $lParam) #forceref $hWndGUI, $MsgID, $wParam Local $tagNMHDR, $event $tagNMHDR = DllStructCreate("int;int;int", $lParam);NMHDR (hwndFrom, idFrom, code) If @error Then Return $event = DllStructGetData($tagNMHDR, 3) Select Case $wParam = $ListView Select Case $event = $NM_CLICK ListView_Click() Case $event = $NM_DBLCLK ListView_DoubleClick() EndSelect EndSelect $tagNMHDR = 0 $event = 0 $lParam = 0 EndFunc ;==>WM_Notify_Events Func _DebugHeader($s_text) Return _ "!===========================================================" & @LF & _ "+===========================================================" & @LF & _ "-->" & $s_text & @LF & _ "+===========================================================" & @LF EndFunc ;==>_DebugHeader Func _MonitorEditState(ByRef $h_gui, ByRef $editCtrl, ByRef $editFlag, ByRef $ListView, ByRef $dll) Local $pressed = _IsPressedMod($dll) If $editFlag And $pressed = 13 Then; pressed enter Update($h_gui, $editCtrl, $ListView) ElseIf $editFlag And $pressed = 27 Then; pressed esc CancelEdit($ListView) $editFlag = 0 ElseIf Not $editFlag And $pressed = 113 Then; pressed f2 Rename($ListView) $editFlag = 1 EndIf Sleep(50) If ControlCommand($h_gui, "", $editCtrl, "IsVisible", "") Then If $editFlag = 0 Then $editFlag = 1 Rename($ListView) EndIf Else $editFlag = 0 EndIf EndFunc ;==>_MonitorEditState Func Rename(ByRef $ListView) Local $itemIndex = _GUICtrlListViewGetCurSel ($ListView) GUICtrlSendMsg($ListView, $LVM_EDITLABEL, $itemIndex, 0) HotKeySet("{Enter}", "Enter") EndFunc ;==>Rename Func Enter() ; just a dummy function EndFunc ;==>Enter Func Update(ByRef $h_gui, ByRef $editCtrl, ByRef $ListView) Local $newText = ControlGetText($h_gui, "", $editCtrl) Local $item = GUICtrlRead($ListView) GUICtrlSetData($item, $newText) HotKeySet("{Enter}") Send("{Enter}");quit edit mode $editFlag = 0 $update = 0 EndFunc ;==>Update Func CancelEdit(ByRef $ListView) GUICtrlSendMsg($ListView, $LVM_CANCELEDITLABEL, 0, 0) EndFunc ;==>CancelEdit Func _IsPressedMod($dll = "user32.dll") Local $aR, $bRv, $hexKey, $i For $i = 8 To 128 $hexKey = '0x' & Hex($i, 2) $aR = DllCall($dll, "int", "GetAsyncKeyState", "int", $hexKey) If $aR[0] <> 0 Then Return $i Next Return 0 EndFunc ;==>_IsPressedMod
-
For a project I am working on I would like to combine list and tree views. The Treeview expand/colapse ability with the listview row/column.
-
I created this so I push updates out on multiple systems at once. Extra useful when the systems are being used becuase it provides the user ability of running the update when it's convenient and has the force install timeout to make sure the update occurs within the defined timeframe. Edit the inifile with path and exe to run and provide some usefull information about the update. Just notepad for demo purposes. Hope it's usefull to someone Update_Message_Launch_box.zip
-
You might be able to using AnyGUI. Here is an example of buttons mounted on the desktop listview: http://www.autoitscript.com/forum/index.php?showtopic=34147 Look Here:AnyGUI By: quaizywabbit You might be able mount the buttons on the listview with the same spacing and indexing as the listview. Not an easy fix
-
@AutoIt Smith I like it. Very simular to the TCP Communicator (you created) and I modified as the base for the Client Commander I created. Did not think to use Autoit commands like that though, very cool! 4Fun
-
@AutoIt Smith, Thanks for helping @GioVit Hope you find this useful although it not completely functional yet.
-
Hey GioVit, The first thing you need to do is run the client on each of the computers you would like to connect to using the server. Using a minimum of the local computer will give you at least one computer to connect to. Any other computers you can add them to the $Hosts variable followed by a comma (computername1,computername2,). If you are doing that and still not able to connect then a firewall could be the culprit. Make sure it will allow both programs to run and that port 50911 is open. Hope that helps, 4Fun
-
Made a few updates to the Server and included a compiled version of both. Please comment, liked it , hated it, could use it if... Has anyone else made a simular tool? Thanks, 4Fun
-
This is cool, let's put it back at the top so other newbies like myself will see it.
-
I used code that many people posted and from the auto examples. That's how I learned to use AutoIt v3 and was the quickest way to get results. I would be honored if someone used code that I created (not likely to happen until I improve though) and I always try to give credit to those who helped me or whose code I used. If I use your code feel free to add you name to the header of the script. The end-user at my work wanted the GUI and will I be adding error logging that is why the file is used. I will also add cmdline parameters to it that will bypass the GUI and allow other script to utilize this one. Thanks for the feedback!
-
I Added a new button to connect to the clients on the server and fixed a bug with the close window case on the client. To use these scripts compile the Client and run on some computers on your network and/or the local system. Run the server and select All from the combobox and press connect. It should aleast conect to the local computer. Now select None and then Status=1 from the combobox and press Execute. It should show Connection OK. Now select Exec form the second combobox and press execute. It should run Notepad and return the PID. Now select Process Exists and enter the PID in place of notepad and press Exec. Now select Process Closse and enter the PID in place of notepad and press Exec, it should close Notepad. Note the PID will be different on each computer. For multiple computer use WindowExists and WindowClose commands for ease. Begining window will work but case sensitive. Enjoy and let me know what you think. If you find it usefull but could additional functions let me know I may be able to add it. I will be adding labels later.
-
Thanks for the feedback! I work on it over the weekend - Got to go for now.
-
I think I started with your TCP Communicator and used the text as the commands. Can't wait until I understand what I'm doing better and can't truely contribute.