Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/29/2021 in all areas

  1. Yep, naming is important. But my humble advice is that error handling is what makes a difference. When you do not know that a statement has failed, how can you intervene to solve an unknown issue. One suggestion to all developers, better put more error handling than less. Your code may looks bigger but it will reduce making the wrong assumptions and solve a lot of unpredictable behaviors.
    1 point
  2. @CYCho: your last code doesn't work because of this line : GUICtrlGetHandle($idListView) #include <GUIConstantsEx.au3> #include <GuiListView.au3> #include <MsgBoxConstants.au3> #include <SendMessage.au3> #include <WindowsConstants.au3> Global $hListView, $idLabel, $iInc = 1 Global $aArray[3][3] = _ [["item1", "c_12", "c_13"], _ ["item2", "c_22", "c_23"], _ ["item3", "c_32", "c_33"]] Example() Func Example() $hGUI = GUICreate("listview items", 220, 200) $hListView = _GUICtrlListView_Create($hGUI, "col1 |col2|col3 ", 10, 10, 200, 150) Local $idButton = GUICtrlCreateButton("Click me", 25, 170, 70, 20) Create_Both() GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $idButton MsgBox($MB_SYSTEMMODAL, "id Label #" & $iInc & " = " & $idLabel, _ "Now deleting label & LV content, then recreating both") _SendMessage($hListView, $LVM_DELETEALLITEMS) Sleep(1000) ; just to show LV is empty on screen GUICtrlDelete($idLabel) $iInc += 1 Create_Both() EndSwitch WEnd EndFunc ;==>Example Func Create_Both() _GUICtrlListView_AddArray($hListView, $aArray) $idLabel = GUICtrlCreateLabel("Label #" & $iInc, 130, 173, 70, 20) EndFunc ;==>Create_Both _GUICtrlListView_Create() returns a handle, not a control id. So GUICtrlGetHandle($hListView) returns 0 and SendMessage fails. Edit: this little "how-to-name variables" issue is interesting and shows why it's important to give a good name to each variable. If the variables were named correctly in all these scripts, i.e. $idListview = GUICtrlCreateListView(...) or $hListView = _GUICtrlListView_Create(...) Then one could really be alerted when typing : GUICtrlGetHandle($hListView) ; did I just handled on handle ?
    1 point
  3. Hi jos, Have you considered adding -Administrator to the title when launched as .. (so we get to know the run-as state of the running instance of scite) Maybe it is even a better idea to have sessions saved separately based on the "run-as" state like that if we close the admin session fist and by mistake we know that it is saved no matter what .. Deye
    1 point
  4. popup CTRL-A works fine
    1 point
  5. Just to add precision of what I have previously said IF the control was created with native function (GUICtrlCreateListView), _GUICtrlListView_DeleteAllItems will try to delete the items one by one using native delete item as a first step. If not successful (because items were created by non-native functions), it will delete items using SendMessage. So for long ListView, it may take quite awhile to perform the deletion. In that particular situation where the list view is created natively and items non-natively, there would be a huge difference in speed. So first and last buttons (in my snippet) will not perform the exact same thing. I believe @CYCho, you already know that but I wanted to make that clarification for anyone reading this thread.
    1 point
  6. Liked ! Also the splash text, on some machines indeed can be slow to start. I updated with your advices, adapting to the fact that I can have no gui if launched with a parameter.
    1 point
  7. Hi Guys, I appriciate the love and I want to answer all the questions, however im working full time so I havent had the chance to make any updates to the IO project, when its vacation time i will probably be a little bit more active.
    1 point
  8. @Letraindusoir Not sure that you need _JQuerify to run that code. Did you try something like this? $lcJavscript = '$(function(){$("li").each(function(index,element){$(element).css("opacity",(index+1)/10);' $oIE.document.parentwindow.ExecuteScript($jcJavascript) If that doesn't work, then show us what you've tried thus far. 😉
    1 point
  9. lol, I'm a pain. I also added these. #NoTrayIcon ... ... Global Const $appname = "Computer Plucker", $Ver = "V.3.0.1 BETA" If WinExists("[TITLE:" & $appname & "(" & $Ver & ");CLASS:AutoIt v3;]") Then WinActivate("[TITLE:" & $appname & ";CLASS:AutoIt v3 GUI;]") Exit 3 ; as 1 and 2, I leave for internal AutoIt EndIf AutoItWinSetTitle($appname & "(" & $Ver & ") on PID: " & @AutoItPID) SplashTextOn($appname & " is loading...", "", 250, 0) If FileGetSize(StringTrimRight(@ScriptFullPath, 4) & ".ico") Then TraySetIcon(StringTrimRight(@ScriptFullPath, 4) & ".ico") TraySetState(1) ; $TRAY_ICONSTATE_SHOW (1) = Shows the tray icon (default) ... ... $MainGUI = GUICreate($appname & " - " & $Ver, 400, 455, -1, -1, 0x00CA0080, $WS_EX_ACCEPTFILES) DllCall('shell32.dll', 'long', 'SetCurrentProcessExplicitAppUserModelID', 'wstr', $appname & $Ver) ; look at _WinAPI_SetCurrentProcessExplicitAppUserModelID() If FileGetSize(StringTrimRight(@ScriptFullPath, 4) & ".ico") Then GUISetIcon(StringTrimRight(@ScriptFullPath, 4) & ".ico") ; http://www.rw-designer.com/icon-detail/4560 ... ... GUISetState(@SW_SHOW) SplashOff() TraySetState(2) ; $TRAY_ICONSTATE_HIDE (2) = Destroys/Hides the tray icon #EndRegion - Loading GUI with Infomation ;;; and if the above is true, then might as well Case $GUI_EVENT_CLOSE GUISetState(@SW_HIDE) funcExit() ... ... Case $ProcessList $PList = ProcessList() AdlibRegister("_ArrayDisplay_AddIcon", 100) GUICtrlSetState($ProcessList, $GUI_DISABLE) _ArrayDisplay($PList, "Running Processes", "", 0, "|", "Process|ID") GUICtrlSetState($ProcessList, $GUI_ENABLE) AdlibUnRegister("_ArrayDisplay_AddIcon") ; just in case "_ArrayDisplay_AddIcon()" failed ... ... Func _ArrayDisplay_AddIcon() If FileGetSize(StringTrimRight(@ScriptFullPath, 4) & ".ico") Then If WinExists("[TITLE:Running Processes;CLASS:AutoIt v3 GUI;]") Then AdlibUnRegister("_ArrayDisplay_AddIcon") GUISetIcon(StringTrimRight(@ScriptFullPath, 4) & ".ico", -1, WinGetHandle("[TITLE:Running Processes;CLASS:AutoIt v3 GUI;]")) EndIf Else AdlibUnRegister("_ArrayDisplay_AddIcon") EndIf EndFunc that gives the option of a custom icon and independence from other uncompiled scripts. Edit: ...and it may take some time while collecting data so the SplashTextOn() and also on exit "@SW_HIDE" it first and ... hope you like the ideas
    1 point
  10. What maybe would work too is to $nPing = ping() the server right before TCPConnect and setting this $nPing, if not unusally high, as the current tcptimeout. Then connect. And after success reseting the tcptimeout. maybe thats enough to fix any lag in the hope that tcpsend is not influenced by the timeout. if so then it maybe helps to have the ping for each socket stored. I will do some research and probably implement something into the framework to combat this.
    1 point
  11. I usually add to the ignore user without telling the user but this time, since I like you, I tell you. The why is all these questions.
    1 point
  12. Hi @tarretarretarre, i heaviely modified your SoketIO.au3 3.0.0 and also wrote a small framework around it. I removed the serilization UDF completly and added alot of safety and convenience features. Idk if you care for 3.0.0 anymore as you work on 4.0.0. However the Client can now Guess how much load is on the Server, this work vise versa. I call it Flood Prevention. It ensures that no packets get discarded because of $g__io_nMaxPacketSize Then i added packet validation. The packets now also get verified and discarded if corrupted. The next feature is a Safety feature where bad packets get resend. There are more little feature as for example a counter per socket for how much bytes got send and received.. etc. All of it can be toggled and if used with the framework both side even sync their configurations. Even tho i didnt optimise nor polished what i coded yet, i still think that it got much faster and safer. In this picture i have 10 Clients sending constantly packets of 2048 KB The server handling them so nice that each client can send up to 2 packets per second I try to make it much faster with certain other technics or by recoding more sections. As the Issue is less with the packet size but with the packet and socket count.
    1 point
  13. You could easiely _Io_Emit($socket, "privatemessage", $to_ip & '|' & $pm) and on the receiving func simply Func _On_privatemessage(Const $socket, $data) Local $arData = StringSplit($data, '|', 1) ; $arData[1] will hold the ip ; $arData[2] will hold the pm Endfunc
    1 point
  14. Hi All, I know many newbies search for this feature. I decided to share this piece of code with everyone. Basically its a "splash screen" that has a transparent image. In a nutshell - Gui with a transparent gif. Enjoy... Download attachment.... Splash Screen GUI.zip
    1 point
  15. Thank you very much! It works for my application! Run(@ComSpec & ' /c start "" "shell:Appsfolder\Microsoft.Messaging_8wekyb3d8bbwe!x27e26f40ye031y48a6yb130yd1f20388991ax"', '', @SW_HIDE) - Hit Win-R to open a "Run" input, and type "shell:Appsfolder" - When in that, hit F-10 to get a menu bar, and from that menu bar select "View / Choose Details" - Select the radio box for "AppUserModelID". That ID is what you are going to want to execute. - Select "Details" from the little "View" gadget" on the right hand side. "shell:Appsfolder\"+AppUserModelID found in the right column
    1 point
  16. UPDATE: With the addition of the ObjCreateInterface function and enhanced COM functionality by trancexxx, these interfaces are now accessible directly in AutoIt. I've rewritten the plugin as a native UDF which will work when compiled as x64 as well. I've attached the new UDF as well as updated plugin and UDF versions of my OSD Volume script. UDF Example: #include <_AudioEndpointVolume.au3> ; ## Get current volume levels $vol = _GetMasterVolumeLevel() ConsoleWrite("Get Vol Error: " & @error & @CRLF) ConsoleWrite("Volume: " & $vol & " (decibels)" & @CRLF) $vol = _GetMasterVolumeLevelScalar() ConsoleWrite("Get Vol Error: " & @error & @CRLF) ConsoleWrite("Volume: " & $vol & " (scalar)" & @CRLF) ; ## Set new volume levels ConsoleWrite("Set vol to -20db..." & @CRLF) _SetMasterVolumeLevel(-20) ConsoleWrite("Set Vol Error: " & @error & @CRLF) $vol = _GetMasterVolumeLevel() ConsoleWrite("Get Vol Error: " & @error & @CRLF) ConsoleWrite("Volume: " & $vol & " (decibels)" & @CRLF) ConsoleWrite("Set vol to scalar 30..." & @CRLF) _SetMasterVolumeLevelScalar(30) ConsoleWrite("Set Vol Error: " & @error & @CRLF) $vol = _GetMasterVolumeLevelScalar() ConsoleWrite("Get Vol Error: " & @error & @CRLF) ConsoleWrite("Volume: " & $vol & " (scalar)" & @CRLF) ; ## Get volume range information ConsoleWrite("Get range info..." & @CRLF) $aInfo = _GetVolumeRange() ConsoleWrite("Get Range Error: " & @error & @CRLF) ConsoleWrite("MinDB: " & $aInfo[0] & @CRLF) ConsoleWrite("MaxDB: " & $aInfo[1] & @CRLF) ConsoleWrite("Increment: " & $aInfo[2] & @CRLF) ; ## Set mute states ConsoleWrite("Set mute on..." & @CRLF) _SetMute(1) ConsoleWrite("Set Mute Error: " & @error & @CRLF) $mute = _GetMute() ConsoleWrite("Get Mute Error: " & @error & @CRLF) ConsoleWrite("Muted: " & $mute & @CRLF) Sleep(2000) ConsoleWrite("Set mute off..." & @CRLF) _SetMute(0) ConsoleWrite("Set Mute Error: " & @error & @CRLF) $mute = _GetMute() ConsoleWrite("Get Mute Error: " & @error & @CRLF) ConsoleWrite("Muted: " & $mute & @CRLF) ; ## Get volume step info ; ## Steps range from 0 to nStepCount - 1 ConsoleWrite("Get step info..." & @CRLF) $aInfo = _GetVolumeStepInfo() ConsoleWrite("Get Step Error: " & @error & @CRLF) ConsoleWrite("Current step: " & $aInfo[0] & @CRLF) ConsoleWrite("Total steps: 0 to " & $aInfo[1] - 1 & @CRLF) ConsoleWrite("Increase 5 steps..." & @CRLF) For $i = 1 To 5 _VolumeStepUp() Next $aInfo = _GetVolumeStepInfo() ConsoleWrite("Get Step Error: " & @error & @CRLF) ConsoleWrite("Current step: " & $aInfo[0] & @CRLF) ConsoleWrite("Decrease 2 steps..." & @CRLF) For $i = 1 To 2 _VolumeStepDown() Next $aInfo = _GetVolumeStepInfo() ConsoleWrite("Get Step Error: " & @error & @CRLF) ConsoleWrite("Current step: " & $aInfo[0] & @CRLF) OLD PLUGIN VERSION vista_vol_plugin.zip _AudioEndpointVolume.au3 VolumeOSD.zip VolumeOSD_plugin.zip
    1 point
  17. Ya, use it guicreate( "test" , 200 , 300 , default , default , $ws_popup+$ws_caption ) then the window will appear with no buttons in the right side... but you lose the icon so !
    1 point
  18. Various effects are achieved with the STYLE and EXTENDED STYLE parameters (see the help file under GuiCreate). This example uses the $DS_MODALFRAME style:#include <GuiConstants.au3> $hGui = GUICreate("Test", 300, 200, Default, Default, $DS_MODALFRAME) $Button = GUICtrlCreateButton("EXIT", 100, 130, 100, 30) GUISetState() Do Sleep(20) Until GUIGetMsg() = $Button
    1 point
×
×
  • Create New...