Leaderboard
Popular Content
Showing content with the highest reputation on 06/29/2016 in all areas
-
Yeah this error will be fixed in the next update!2 points
-
Hi! Today I want to show you my current AutoIt project: The ISN AutoIt Studio. The ISN AutoIt Studio is a complete IDE made with AutoIt, for AutoIt! It includes a GUI designer, a code editor (with syntax highlighting, auto complete & intelisense), a file viewer, a backup system, trophies and a lot more features!! Here are some screenshots: Here some higlights: -> easy to create/manage/public your AutoIt-projects! ->integrated GUI-Editor (ISN Form Studio 2) ->integrated - file & projectmanager ->auto backupfunction for your Projects ->extendable with plugins! ->available in several languages ->trophies ->Syntax highlighting /Autocomplete / Intelisense ->Dynamic Script ->detailed overview of the project (total working hours, total size...) And much more!!! -> -> Click here to download ISN AutoIt Studio <- <- Here is the link to the german autoit forum where I posted ISN AutoIt Studio the first time: http://autoit.de/index.php?page=Thread&threadID=29742&pageNo=1 For more information visit my Homepage: https://www.isnetwork.at So….have fun with ISN AutoIt Studio! PS: Sorry for my bad English! ^^1 point
-
Assign the return of the function to the array!1 point
-
Hi, @mLipok, long time ago I tried to beat the AutoIt-String-Functions with ASM-Scripts, and fortunately ( ! ) it´s not worth the work....i worked with strings up to 100MB size, the shorter the string, the (relative) bigger the overhead of the DllCallAddress().....the shorter the string, the faster the internal (string!-)functions! The stringfunctions in AutoIt are VERY fast, thanks to all the programmers in the last 30 years to optimize their code and (used by AutoIt) C-librarys! If you have an ANSI-String (one Byte=one Letter), you should absolutely use the StringReverse()-function with flag=1! But some hints if you want to play with ASM or other compiler-languages or dlls. We could call the ASM-code within 2 scenarios: (1) DllCallAddress("str:cdecl", $codestructptr, "str*", $ansistring) where $codestructptr is the address of the ASM-code, $ansistring is the string to reverse and $ansistringlen is.....the stringlen. This forces the Assemblercode to work with a pointer to the pointer of the string. Remember that, if you ever want to play with AutoIt, Assembler and strings. By the "str*" you get the pointer to the pointer....Btw. "str:cdecl" returns the processed string back to Autoit! Because of AutoIt´s internal structure, this is the worst way to call a string-related function, because $ansistring got copied before we can work with it. The internal functions first have to reserve memory and copy the string into the memory, this is very "expensive" (in terms of Assembler). But it looks very professional to work with pointers to a string....Only to mention, time to "copy" the 100MB-string takes 1000ms while exchange the letters (reversestring) with ASM-code takes 150ms (on my machine) But we could do the "stringcopy" by hand, reserve memory with dllstructcreate() and copy the string into this memory with dllstructsetdata(). And we call our code like this (2) DllCallAddress("none:cdecl", $codestructptr, "ptr", $ansistringptr) This function returns "nothing" because the processed string is in the memory (dllstruct) and can be get by dllstructgetdata() This makes sense, if we want to work with string(s) in a way that is not supported by native AutoIt-Stringfunctions.... Here a simple code which demonstrates the difference of the mentioned above... $string = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" ;make a 109MB long string For $i = 1 To 22 $string &= $string Next $stringlen = StringLen($string) ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $stringlen = ' & $stringlen & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console $ptr2string = 123456 ;a "pointer", doesn't matter anything...only for example $struct = DllStructCreate("Byte") ;reserve memory $ptr = DllStructGetPtr($struct) ;pointer to memory DllStructSetData($struct, 1, 0xC3) ;write RET(urn) assembler opcode ;now we test a call with pointer(to anything) vs call of string $t = TimerInit() DllCallAddress("none:cdecl", $ptr, "str", $ptr2string) ;pointer $m = TimerDiff($t) ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $m = ' & $m & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console $t = TimerInit() DllCallAddress("none:cdecl", $ptr, "str*", $string) ;string $m2 = TimerDiff($t) ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $m2 = ' & $m2 & @CRLF & '>Error code: ' & @error & @CRLF) ;### Debug Console The time of running a whichever function doing something with a string is wasted if "str*" is used... If you want do do anything with a string with AutoIt ( HLL/ASM/DLL...), try to get a pointer to that string!1 point
-
In this particular case YES. But If you want in future use configure.au3 you will always need include also variable.au3 just before configure.au3. For this you can add inside configure.au3 #include-once #include "variable.au3" and this will look like this: I think @Melba23 was said the same but in diferent way. I hope my answer will be also handy. mLipok1 point
-
You mean something like this here? #include <Constants.au3> #include <GDIPlus.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Global Const $STM_SETIMAGE = 0x0172 Global $sPathKey = "HKLM64\SOFTWARE\AutoIt v3\AutoIt\" If @OSArch = "x64" Then $sPathKey = "HKLM\SOFTWARE\Wow6432Node\AutoIt v3\AutoIt\" Global $sImage = RegRead($sPathKey, "InstallDir") & "\Examples\GUI\logo4.gif" _GDIPlus_Startup() Global $hBmp = _GDIPlus_BitmapCreateFromFile($sImage) Global $iW = _GDIPlus_ImageGetWidth($hBmp), $iH = _GDIPlus_ImageGetHeight($hBmp) Global $hGUI = GUICreate("Test", 235, 112, -1, -1, BitOR($GUI_SS_DEFAULT_GUI, $WS_SIZEBOX, $WS_THICKFRAME), $WS_EX_COMPOSITED) Global $idPic = GUICtrlCreatePic("", 32, 16, $iW, $iH) GUICtrlSetResizing(-1, $GUI_DOCKVCENTER + $GUI_DOCKHCENTER) Global $hHBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBmp) Global $hB = GUICtrlSendMsg($idPic, $STM_SETIMAGE, $IMAGE_BITMAP, $hHBitmap) If $hB Then _WinAPI_DeleteObject($hB) GUISetState(@SW_SHOW) GUIRegisterMsg($WM_SIZE, "WM_SIZE") While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE GUIRegisterMsg($WM_SIZE, "") _WinAPI_DeleteObject($hHBitmap) _GDIPlus_BitmapDispose($hBmp) _GDIPlus_Shutdown() GUIDelete() Exit EndSwitch WEnd Func WM_SIZE($hWnd, $Msg, $wParam, $lParam) #forceref $Msg, $wParam, $lParam Local $aSize = ControlGetPos($hWnd, "", $idPic) Local $hBitmap = _GDIPlus_BitmapCreateFromScan0($aSize[2], $aSize[3]) Local $hContext = _GDIPlus_ImageGetGraphicsContext($hBitmap) _GDIPlus_GraphicsSetInterpolationMode($hContext, 5) _GDIPlus_GraphicsDrawImageRect($hContext, $hBmp, 0, 0, $aSize[2], $aSize[3]) _GDIPlus_GraphicsDispose($hContext) Local $hHBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap) Local $hB = GUICtrlSendMsg($idPic, $STM_SETIMAGE, $IMAGE_BITMAP, $hHBitmap) If $hB Then _WinAPI_DeleteObject($hB) _WinAPI_DeleteObject($hHBitmap) _GDIPlus_BitmapDispose($hBitmap) Return "GUI_RUNDEFMSG" EndFunc1 point
-
faustf, You are correct, but make sure you include the file containing the declaration before you try to reference it elsewhere. M231 point
-
Hello. lol I forgot to tell you that. Saludos1 point
-
@Danyfirex , I have edited the au3 file and successfully set the path to my dedicated directory. Thanks. At first, i didn't noticed the path in ShellExecute function. Now, it is ok.1 point
-
Uninstalling programs through windows GUI?
Quinch reacted to JLogan3o13 for a topic
Yes, you can do a RegRead on the uninstall value in the key, and then shellexecute that. For WMI, you would do something like this: #include <MsgBoxConstants.au3> $sName = InputBox("Uninstall Wizard", "Please type the first few letters of the application name to search") $oWMI = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\" & @ComputerName & "\root\cimv2") $aProducts = $oWMI.ExecQuery("Select * from Win32_Product Where Name LIKE '%" & $sName & "%'") For $app in $aProducts $popup = MsgBox($MB_YESNOCANCEL, "Uninstall Wizard", "Would you like to uninstall " & $app.Name & "?") If $popup = $IDYES Then $app.Uninstall() ElseIf $popup = $IDCANCEL Then ExitLoop EndIf Next1 point -
@Salo, welcome to AutoIt and to the forum. first, retract your check for $iOKButton, so the if parts happen after someone pressed the OK button. then, you can search the array to find the index match for $sName, and use it to assign the matching value to $CD. something like this: Switch GUIGetMsg() Case $iOKButton For $i = 0 To UBound($ac) - 1 If $ac[$i][0] = $sName Then $CD = $ac[$i][1] * snip * EndIf Next EndSwitch1 point
-
@Quinch, in WMI, the Win32_Product object has a method called "uninstall". call it to... well... uninstall the product. in the registry, each installed program has the value "UninstallString", which is the command line you need to run to uninstall the product. installed products may or may not register themselves in various locations. you may need to incorporate both methods (and accommodate for x86 and x64, as stated).1 point
-
Uninstalling programs through windows GUI?
Quinch reacted to JLogan3o13 for a topic
@Quinch I service a lot of customers that have home-grown or "dodgy" applications, and use a combination of Registry Reads and WMI to search for installed applications. As the Add/Remove Programs GUI is just pulling information from these sources, if it is there it will either be in the registry or WMI. Below are the two ways to do so: WMI: #AutoIt3Wrapper_Au3Check_Parameters=-q -d -w 1 -w 2 -w 3 -w- 4 -w 5 -w 6 -w- 7 ;====Get Installed Applications Local $sPC, $oWMI, $aSystem $sPC = "<machine name>" If Ping($sPC) Then $oWMI = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\" & $sPC & "\root\cimv2") If IsObj($oWMI) Then $aSystem = $oWMI.ExecQuery("Select * from Win32_Product") For $sApp In $aSystem ConsoleWrite("Application: " & $sApp.Name & " Version: " & $sApp.Version & @CRLF) Next Else ConsoleWrite("Unable to connect to WMI on " & $sPC & @CRLF) EndIf Else ConsoleWrite("Unable to Ping " & $sPC & @CRLF) EndIf And Registry, something like this (slight tweaking if you're mixing x86 and x64 machines): Local $sKey, $sKey64, $sSubKey $sKey = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" For $a = 1 To 200 $sSubKey = RegEnumKey($sKey, $a) If @error Then ExitLoop ConsoleWrite(RegRead($sKey & $sSubKey, "DisplayName") & @CRLF) Next1 point -
GUIListViewEx - BugFix Version 6 Apr 24
232showtime reacted to Melba23 for a topic
Hi all, After the recent additions and fixes, here is another Beta for testing: Quick summary of the changes - you can find various example scripts in the earlier posts of this thread: Option to disable header resizing. Custom editing a column using a user-defined function Custom sorting a column using a user-defined function Option for an "auto dropdown" option when using combo/DTP to edit Option for an updown in a text input M231 point -
GUIListViewEx - BugFix Version 6 Apr 24
232showtime reacted to Melba23 for a topic
232showtime, I have found a problem with the loading code - so thanks for the report. I am now working on how to fix it. M231 point -
It's also possible without RegisterMsg using GUIGetCursorInfo(): #include <GUIConstantsEx.au3> #include <Array.au3> Opt("GUIOnEventMode", 1) Opt('MustDeclareVars', 1) Global $aBtnIds[10][2] Global $hGui = GUICreate('Buttontest', 105, 145) Global $msg, $Handle, $aPos For $i = 0 To 8 $aBtnIds[$i][0] = GUICtrlCreateButton($i + 1, 10 + Mod($i, 3) * 30, 10 + Int($i / 3) * 30, 25, 25) GUICtrlSetOnEvent(-1, '_Click') GUICtrlSetBkColor(-1, 0x12345678) $aBtnIds[$i][1] = 'leer' Next $aBtnIds[9][0] = GUICtrlCreateButton('OK', 10, 110, 90, 25) GUICtrlSetOnEvent(-1, '_Colors') ConsoleWrite('OK: ' & $aBtnIds[$i][0] & @CRLF) GUISetOnEvent($GUI_EVENT_CLOSE,'_Exit') GUISetOnEvent($GUI_EVENT_SECONDARYUP,'_RightClick') GUISetState() While 1 Sleep(10000) WEnd Func _SetColor($iBtn, $bPrimary=False) Local $sButton ConsoleWrite('_SetColor: ' & $iBtn & @TAB&$bPrimary&@CRLF) If $bPrimary Then $sButton = 'Primary' If $aBtnIds[$iBtn][1]='leer' Then GUICtrlSetBkColor($aBtnIds[$iBtn][0], 0x990000) $aBtnIds[$iBtn][1]='rot' Else $sButton = 'Secondary' If $aBtnIds[$iBtn][1]='leer' Then GUICtrlSetBkColor($aBtnIds[$iBtn][0], 0x059122) $aBtnIds[$iBtn][1]='grün' EndIf MsgBox(0, $sButton & ' Buttonclick', 'Button with ID ' & $aBtnIds[$iBtn][0] & ' was clicked.' & @CRLF & 'The text of the button is: ' & ControlGetText('Buttontest', '', $aBtnIds[$iBtn][0]) & @CRLF, 5, $hGui) ConsoleWrite(GUICtrlRead($aBtnIds[$iBtn][0]) & @CRLF) EndFunc ;==>_Click Func _Click() Local $iBtn = @GUI_CtrlId - $aBtnIds[0][0] ConsoleWrite('_Click: ' & $iBtn & @CRLF) _SetColor($iBtn,True) EndFunc ;==>_Click Func _RightClick() $aPos = GUIGetCursorInfo() Local $iBtn=$aPos[4] - $aBtnIds[0][0] ConsoleWrite('_RightClick: '&$iBtn&@TAB&GUICtrlRead($iBtn)&@CRLF) _SetColor($iBtn) EndFunc Func _Colors() Local $sText = '', $aBtns For $i = 0 To 8 $sText &= $aBtnIds[$i][1] If $i < 8 Then $sText &= '|' Next ConsoleWrite($sText & @CRLF) $aBtns = StringSplit($sText, '|') $aBtns[0] = UBound($aBtns) - 1 _ArrayDisplay($aBtns, 'Farben', '', 32) EndFunc ;==>_Colors Func _exit() Exit EndFunc1 point
-
1 point