Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/26/2023 in all areas

  1. I've got to make a number of nasty forum and websites updates in order to support the next forum software version. Expect a lot of downtime / broken features in the next week or so!
    4 points
  2. Plan: Upgrade wordpress main site to WP 6 Upgrade forum to 4.6.10 Upgrade Mediawiki to 1.38.5 (PHP 7.4 / MariaDB 10.1) Upgrade PHP to 8.0 (Media wiki may have some issues as requires 1.39 for full PHP 8 support) Upgrade forum to 4.7.8 Upgrade MariaDB to 10.3 or later Forum looks ok at 4.6.10 Mediawiki looks ok at 1.38.5 but forum login integration is not working PHP 8.0 running and working with forum syntax highlighting. Will leave running for a while before next stage. Forum updated to 4.7.8 MariaDB upgraded to 10.3
    3 points
  3. Latest update just released. See below for change log.
    2 points
  4. if you want to move it, you can use a Label as a grab point look at the GUICtrlCreateLabel ( "text", left, top [, width [, height [, style = -1 [, exStyle = -1]]]] ) for the The extended style $GUI_WS_EX_PARENTDRAG can be used to allow the dragging of the parent window for windows that don't have a titlebar (no $WS_CAPTION style in GUICreate()). if you want to go deeper 209723-change-titlebar-colors-of-autoit-gui I did something similar to transparence recently if you find something, here as an idea to follow another window without needing to move this GhostGui
    2 points
  5. You also need to specify that you want to use x64 of AutoIt
    1 point
  6. If you are currently using FileInstall() to initially deploy the file, then why don't you just conditionally do another FileInstall() to overwrite the file if/when you determine that the file has been modified? You are aware that FileInstall() adds a copy of the file to your compiled script already, right? If your issue is how can you determine if the file has been modified, then one quick way is to create and store a cryptographic hash for the template file in your script and compare that hash to a hash generated from the deployed file. If they aren't the same, then the file has been modified. If <condition> Then FileInstall(...)
    1 point
  7. 1 point
  8. in the video it looks like "WindowsForms10.COMBOBOX.app.0.297b065_r69_ad11; f" pay attention, it doesn't want a space after ; "WindowsForms10.COMBOBOX.app.0.297b065_r69_ad11;f"
    1 point
  9. above the enter (line 163) , we set it to send a for Aply ; Apply ControlSend($hGPOedit, "", "WindowsForms10.Window.8.app.0.125ada7_r69_ad16", "a") at a glance, without checking the parameters, to run the script in this form C:\Users\autotest\Desktop\autoit_test>_GroupPolicy2.au3 "\Computer Configuration\Administrative Templates\Windows Components\Connect" "Require pin for pairing" "1" "WindowsForms10.COMBOBOX.app.0.297b065_r69_ad11; f" It doesn't work. You will compile it into an executable exe or using the interpreter look in your help for Command Line Parameters Run a script using the interpreter: AutoIt3.exe [/ErrorStdOut] [/AutoIt3ExecuteScript] filename [params ...] Execute the AutoIt3 script 'filename' with optional parameters At its simplest: AutoIt3.exe myScript.au3 will run a standard AutoIt script 'myScript.au3' with no parameters. Run a compiled script: Compiled.exe [/ErrorStdOut] [params ...] Execute a compiled AutoIt3 Script File produced with Aut2Exe.
    1 point
  10. Dan_555

    Dan's misc. Scripts

    Ini file, limit tester. This script is mostly useless. The only purpose that it has: is to test if the 64kb limit on the ini files still exists. It will create an ini file (if you click on the "Create ini file" button) after it, you can test if the lines were written. There are two test, one which will show every difference (by using a slightly different test phrase) and the other which will display only the real differences (for e.g. if you manually edit some of the entries in the ini file). You can change the testing phrase and the number of ini sections which will be created. (from 1 to 100000) #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Ini file limit testing", 463, 240, 192, 124, BitOR($WS_SIZEBOX, $WS_SYSMENU)) Global $Edit1 = GUICtrlCreateEdit("", 3, 49, 455, 163) GUICtrlSetData(-1, "") GUICtrlSetLimit(-1, 50000000) GUICtrlSetResizing(-1, 1) Global $input = GUICtrlCreateInput("", 3, 29, 395, 18) GUICtrlSetTip(-1, "Search Phrase") Global $input2 = GUICtrlCreateInput("2000", 408, 29, 50, 18, $ES_NUMBER) GUICtrlSetTip(-1, "Ini sections to create/check" & @CRLF & "Range 1-100000") $Button1 = GUICtrlCreateButton("Test different", 9, 5, 118, 21) GUICtrlSetTip(-1, "Search phrase is different") $Button2 = GUICtrlCreateButton("Test Exact", 269, 5, 118, 21) GUICtrlSetTip(-1, "Search phrase is exact") $Button3 = GUICtrlCreateButton("Create Ini file", 139, 5, 118, 21) GUICtrlSetTip(-1, "Create the ini file") Global $bStop = GUICtrlCreateButton("STOP", 395, 5, 64, 21) GUISetState(@SW_SHOW) GUICtrlSetState($bStop, $GUI_HIDE) #EndRegion ### END Koda GUI section ### Global $test = GUICtrlRead($input2) If $test < 1 Or $test > 100000 Then $test = 100 EndIf Global $inifile = @ScriptDir & "\test.ini" Local $quote = IniRead($inifile, "setting", "quote", " :To Infinity and Beyond!") GUICtrlSetData($input, $quote) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button3 GUICtrlSetState($bStop, $GUI_Show) $quote = GUICtrlRead($input) $test = GUICtrlRead($input2) If $test < 1 Or $test > 100000 Then $test = 100 GUICtrlSetData($input2, $test) EndIf For $x = 1 To $test WinSetTitle($Form1, "", "Writing section: " & $x & "/" & $test) IniWrite($inifile, $x & "testing", "1", $x & " " & $quote) $nMsg = GUIGetMsg() Switch $nMsg Case $bStop ExitLoop EndSwitch Next GUICtrlSetState($bStop, $GUI_HIDE) Case $Button2 $quote = GUICtrlRead($input) memowrite("", 1) IniTestRead($quote) Case $Button1 $quote = GUICtrlRead($input) memowrite("", 1) IniTestRead($quote & "!!") EndSwitch WEnd Func IniTestRead($quote) GUICtrlSetState($bStop, $GUI_Show) For $x = 1 To $test WinSetTitle($Form1, "", "Testing please wait: " & $x & "/" & $test) $tmptxt = IniRead($inifile, $x & "testing", "1", "-1") If $tmptxt = -1 Then memowrite($x & " line does not exist") Else If $tmptxt <> ($x & " " & $quote) Then memowrite($x & " line does not match") memowrite($tmptxt & " /vs/ " & $x & $quote) EndIf EndIf $nMsg = GUIGetMsg() Switch $nMsg Case $bStop ExitLoop EndSwitch Next WinSetTitle($Form1, "", "Testing is Done ") GUICtrlSetState($bStop, $GUI_HIDE) EndFunc ;==>IniTestRead Func memowrite($txt, $cls = 0) If $cls = 0 Then GUICtrlSetData($Edit1, $txt & @CRLF, 1) Else GUICtrlSetData($Edit1, "") EndIf EndFunc ;==>memowrite (p.s. it creates 1 section and 1 entry per section, it does not test how many entries are possible per section, although, it can be modified to do that ) (p.p.s.: I have planed to save the phrase and the count of sections to the ini file, but haven't done it (yet))
    1 point
  11. you are welcome
    1 point
  12. I modified it according to the new requirements save it with the name _GroupPolicy2.au3 #RequireAdmin #AutoIt3Wrapper_UseX64=y #include <Constants.au3> #include <Array.au3> #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include <GuiButton.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <MsgBoxConstants.au3> Opt("TrayIconDebug", 1) ;0=no info, 1=debug line info ;============================================================== ; FUNCTION: _Example ; DESCRIPTION: This function opens the Group Policy Object Editor, ; navigates to the specified policy setting, and changes its value ; to the specified setting. ; PARAMETERS: ; $CmdLine[1] - The path of nodes to navigate. ; $CmdLine[2] - The name of the policy setting to be changed. ; $CmdLine[3] - The value of the policy setting to be changed 0=Disabled, 1=Enabled, 2=Configured ; $CmdLine[4] - Options in form "ClassnameNN;SendKey" ;============================================================== ; "\Computer Configuration\Administrative Templates\Windows Components\Microsoft Edge", "Allow Adobe Flash", 0 If Not $CmdLine[0] Then Global $CmdLine[5] = [4, "\Computer Configuration\Administrative Templates\Windows Components\Microsoft Edge", "Allow Adobe Flash", 0, ""] EndIf Global $iMsgBoxAnswer = "The setting" & @CRLF $iMsgBoxAnswer &= $CmdLine[1] & @CRLF $iMsgBoxAnswer &= $CmdLine[2] & @CRLF $iMsgBoxAnswer &= "will be set to " & $CmdLine[3] & @CRLF $iMsgBoxAnswer = MsgBox(4097, "This Msgbox will time out in 3 seconds", $iMsgBoxAnswer, 3) Select Case $iMsgBoxAnswer = 1 ;OK ;nothing Case $iMsgBoxAnswer = 2 ;Cancel Exit EndSelect ConsoleWrite("$CmdLine[0]=" & $CmdLine[0] & @CRLF) If $CmdLine[0] = 4 Then _GroupPolicy($CmdLine[1], $CmdLine[2], $CmdLine[3], $CmdLine[4]) ElseIf $CmdLine[0] = 3 Then _GroupPolicy($CmdLine[1], $CmdLine[2], $CmdLine[3]) Else $iMsgBoxAnswer = MsgBox(4096, "incorect number of parameters", $CmdLine[0]) EndIf Exit ; #FUNCTION# ;--------------------------------------------------------------------------- ; Name...........: _GroupPolicy() ; Description ...: Opens and uses the Group Policy Editor to configure the given settings ; Syntax.........: _GroupPolicy($sPolicyPath, $sPolicyItem, $iSetting [, $sOption = ""]) ; Parameters ....: $sPolicyPath - The path of nodes to navigate ; $sPolicyItem - The Item/option to navigate/edit ; $iSetting - 0=Disabled, 1=Enabled, 2=Configured ; $sOption - Options in form "ClassnameNN;SendKey" ;---------------------------------------------------------------------------------------- Func _GroupPolicy($sPolicyPath, $sPolicyItem, $iSetting, $sOption = "") If Not WinExists("Local Group Policy Editor") Then Run("c:\Windows\system32\mmc.exe " & "C:\share\open_close_gpedit\gpedit_v1.msc /a") WinWait("Local Group Policy Editor", '', 5) EndIf ;Retrieves the 'Local Group Policy Editor' window handle Local $hGPO = WinActivate("Local Group Policy Editor") ConsoleWrite("$hGPO=" & $hGPO & @CRLF) ;Retrieves the SysTreeView321 control handle Local $hTreeView_1 = ControlGetHandle($hGPO, "", "SysTreeView321") ;Sets the focus to $hTreeView_1 ControlFocus($hGPO, "", $hTreeView_1) Sleep(50) $sPolicyPath = "Local Computer Policy" & $sPolicyPath ConsoleWrite("$sPolicyPath=" & $sPolicyPath & @CRLF) ConsoleWrite("$sPolicyItem=" & $sPolicyItem & @CRLF) Local $aPath = StringSplit($sPolicyPath, "\", 1) Local $tmpPath = "" ;ConsoleWrite("" & @CRLF) For $i = 1 To $aPath[0] $tmpPath &= $aPath[$i] & "|" ;ConsoleWrite("$tmpPath=" & StringTrimRight($tmpPath, 1) & @CRLF) ControlTreeView($hGPO, "", $hTreeView_1, "Expand", StringTrimRight($tmpPath, 1)) ControlTreeView($hGPO, "", $hTreeView_1, "Select", StringTrimRight($tmpPath, 1)) Sleep(50) Next ;at the bottom tabs we go right to the standard tab ControlFocus($hGPO, "", "AMCCustomTab1") ControlSend($hGPO, "", "AMCCustomTab1", "{RIGHT}") Sleep(50) ;Retrieves the SysListView321 control handle Local $hListView = ControlGetHandle($hGPO, "", "SysListView321") ;Sets the focus to SysListView321 ControlFocus($hGPO, "", $hListView) Sleep(50) ;find the item Local $FindItem = ControlListView($hGPO, "", $hListView, "FindItem", $sPolicyItem) Sleep(500) ConsoleWrite("$FindItem=" & $FindItem & @CRLF) ;If not found then Return Error If $FindItem = -1 Then ConsoleWrite("not found the entry:'" & $sPolicyItem & "'" & @CRLF) Return SetError(1, 0, "") EndIf ;select the found item ControlListView($hGPO, "", $hListView, "Select", $FindItem) Sleep(50) ;and send enter to open it ControlSend($hGPO, '', $hListView, '{ENTER}') ;--------------------------------------------------------------- Local $hGPOedit $hGPOedit = WinWait("[CLASS:WindowsForms10.Window.8.app.0.125ada7_r69_ad1]", "", 1) ConsoleWrite("$hGPOedit=" & $hGPOedit & @CRLF) If WinExists($hGPOedit) Then ; normal ConsoleWrite("$hGPOedit=normal" & @CRLF) ControlFocus($hGPOedit, "", "WindowsForms10.Window.8.app.0.125ada7_r69_ad16") Switch $iSetting Case 0 ;Disabled ControlSend($hGPOedit, "", "WindowsForms10.Window.8.app.0.125ada7_r69_ad16", "d") ConsoleWrite("$iSetting=Disabled" & @CRLF) Case 1 ;Enabled ControlSend($hGPOedit, "", "WindowsForms10.Window.8.app.0.125ada7_r69_ad16", "e") ConsoleWrite("$iSetting=Enabled" & @CRLF) If StringLen($sOption) > 0 Then ConsoleWrite("$sOption=" & $sOption & @CRLF) Local $aOpt = StringSplit($sOption, ";", 1) ControlSend($hGPOedit, "", $aOpt[1], $aOpt[2]) EndIf Case 2 ;Configured ControlSend($hGPOedit, "", "WindowsForms10.Window.8.app.0.125ada7_r69_ad16", "c") ConsoleWrite("$iSetting=Configured" & @CRLF) EndSwitch Sleep(50) ControlSend($hGPOedit, "", "WindowsForms10.Window.8.app.0.125ada7_r69_ad16", "{ENTER}") Else ; special $hGPOedit = WinWait("[CLASS:#32770]", "", 1) ; Retrieve the window text of the active window. Local $sText = WinGetText($hGPOedit) ConsoleWrite($sText & @CRLF) If StringLeft($sText, 22) = "Local Security Setting" Then ConsoleWrite("$hGPOedit=special" & @CRLF) Switch $iSetting Case 0 ;Disabled ControlSend($hGPOedit, "", "Button3", "s") ConsoleWrite("$iSetting=Disabled" & @CRLF) Case 1 ;Enabled ControlSend($hGPOedit, "", "Button2", "e") ConsoleWrite("$iSetting=Enabled" & @CRLF) EndSwitch ControlSend($hGPOedit, "", "SysTabControl321", "{ENTER}") Sleep(50) EndIf EndIf ;--------------------------------------------------------------- ;~ Exit ; <-- **************************************************** ControlFocus($hGPO, "", $hTreeView_1) Sleep(50) ControlSend($hGPO, "", $hTreeView_1, "{ALT down}{F4}{ALT up}") $hGPO = WinWait("Microsoft Management Console") ControlSend($hGPO, "", "Static2", "{N}") Return $sPolicyItem EndFunc ;==>_GroupPolicy ;---------------------------------------------------------------------------------------- put the in the same folder, the example with the name Call_GroupPolicy2.au3 #RequireAdmin #AutoIt3Wrapper_UseX64=y ; "\Computer Configuration\Windows Settings\Security Settings\Local Policies\Security Options", "Accounts: Administrator account status", 0 ; "\Computer Configuration\Windows Settings\Security Settings\Local Policies\Security Options", "Microsoft network client: Digitally sign communications (always)", 1 ; "\Computer Configuration\Administrative Templates\Windows Components\Connect", "Require pin for pairing", 1, "WindowsForms10.COMBOBOX.app.0.297b065_r69_ad11;f" _GroupPolicy("\Computer Configuration\Windows Settings\Security Settings\Local Policies\Security Options", "Accounts: Administrator account status", 0) _GroupPolicy("\Computer Configuration\Windows Settings\Security Settings\Local Policies\Security Options", "Microsoft network client: Digitally sign communications (always)", 1) _GroupPolicy("\Computer Configuration\Administrative Templates\Windows Components\Connect", "Require pin for pairing", 1, "WindowsForms10.COMBOBOX.app.0.297b065_r69_ad11;f") ;---------------------------------------------------------------------------------------- Func _GroupPolicy($sPolicyPath, $sPolicyItem, $iSetting, $sOption = "") Local $FilePath = @ScriptDir & "\_GroupPolicy2.au3" Local $Param = '"' & $sPolicyPath & '" "' & $sPolicyItem & '" "' & $iSetting & '" "' & $sOption & '"' RunWait(FileGetShortName(@AutoItExe) & " " & FileGetShortName($FilePath) & " " & $Param) EndFunc ;==>_GroupPolicy ;---------------------------------------------------------------------------------------- and run it
    1 point
  13. Hey, my bad @argumentumThat was a bit harsh of me, I should have commented with more taste. Been thinking about it. EDIT: I did end up starting a new thread. Again, sorry. This doesn't make it any better, but I was frustrated by then. Thats all that was.
    1 point
  14. Of course there is. Don't forget the 4th parameter of the SRE function #include <array.au3> $str = "0x03f477ffa50245" Local $aArray = StringRegExp(StringRegExpReplace ($str, "\w{2}", "0x$0"), "\w{4}", 3, 5) _ArrayDisplay($aArray) Edit It could (should ?) also be done using the correct syntax Local $aArray = StringRegExp(StringRegExpReplace ($str, "[[:xdigit:]]{2}", "0x$0"), ".{4}", 3, 3)
    1 point
  15. Hi guys, All works fine 🙂 The reason is just a matter of telling the application where to look for the DLL. Solution : I found the it here : https://www.codeproject.com/Tips/5287858/WebView2-Edge-Browser-in-MFC-Cplusplus-Application What to do, if Build is successful and when you run, it fails. Open the project in the file system, there is one debug folder (which is created once the build is successful). In the debug folder, there are three different folders - arm64, x64, x86 and each one contains the file "WebView2Loader.dll". So based on your environment, copy the "WebView2Loader.dll" file and paste where your .exe is located. Root cause : When you run the script in SciTE, it does not find the DLL because it is ran from the AutoIT folder... When you compile the script and put is in the .EXE same folder as the DLL all runs fine ... Check : Once you have ran it, it will create a new folder and a bunch of sub folders and files : Main Folder is called : WebView2.exe.WebView2 Great job LarsJ 👌
    1 point
  16. Getting started example step 3: WebView window First AutoIt implementation. Tested on Windows 10/7, 32/64 bit. Execute WebView2.au3: #AutoIt3Wrapper_Au3Check_Parameters=-d -w- 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 #AutoIt3Wrapper_UseX64=y Opt( "MustDeclareVars", 1 ) #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <WinAPICom.au3> #include <WinAPI.au3> Global $hGui, $oCoreWebView2Environment, $oCoreWebView2Controller #include "..\Includes\WV2Interfaces.au3" WebView2() Func WebView2() $hGui = GUICreate( "WebView2 Sample", 1200, 900, -1, -1, $WS_OVERLAPPEDWINDOW ) _WinAPI_CoInitialize( $COINIT_APARTMENTTHREADED ) CoreWebView2CreateCoreWebView2EnvironmentCompletedHandlerCreate() ConsoleWrite( "$pCoreWebView2CreateCoreWebView2EnvironmentCompletedHandler = " & $pCoreWebView2CreateCoreWebView2EnvironmentCompletedHandler & @CRLF & @CRLF ) CoreWebView2CreateCoreWebView2ControllerCompletedHandlerCreate() ConsoleWrite( "$pCoreWebView2CreateCoreWebView2ControllerCompletedHandler = " & $pCoreWebView2CreateCoreWebView2ControllerCompletedHandler & @CRLF & @CRLF ) Local $hWebView2Loader = DllOpen( @AutoItX64 ? "WebView2Loader-x64.dll" : "WebView2Loader-x86.dll" ) Local $aRet = DllCall( $hWebView2Loader, "long", "CreateCoreWebView2EnvironmentWithOptions", "wstr", "", "wstr", "", _ "ptr", NULL, "ptr", $pCoreWebView2CreateCoreWebView2EnvironmentCompletedHandler ) If @error Or $aRet[0] Then Return ConsoleWrite( "CreateCoreWebView2EnvironmentWithOptions ERR" & @CRLF ) ConsoleWrite( "CreateCoreWebView2EnvironmentWithOptions OK" & @CRLF & @CRLF ) GUISetState( @SW_SHOW ) While 1 Switch GUIGetMsg() Case $GUI_EVENT_MAXIMIZE, $GUI_EVENT_RESIZED Local $tRect = _WinAPI_GetClientRect( $hGui ) $oCoreWebView2Controller.put_Bounds( $tRect ) Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd CoreWebView2CreateCoreWebView2ControllerCompletedHandlerDelete() CoreWebView2CreateCoreWebView2EnvironmentCompletedHandlerDelete() DllClose( $hWebView2Loader ) EndFunc Func CoreWebView2CreateCoreWebView2EnvironmentCompletedHandler_Invoke( $pSelf, $long, $ptr ) ; Ret: long Par: long;ptr* ConsoleWrite( "CoreWebView2CreateCoreWebView2EnvironmentCompletedHandler_Invoke" & @CRLF ) $oCoreWebView2Environment = ObjCreateInterface( $ptr, $sIID_ICoreWebView2Environment, $dtag_ICoreWebView2Environment ) ConsoleWrite( "IsObj( $oCoreWebView2Environment ) = " & IsObj( $oCoreWebView2Environment ) & @CRLF & @CRLF ) $oCoreWebView2Environment.CreateCoreWebView2Controller( $hGui, $pCoreWebView2CreateCoreWebView2ControllerCompletedHandler ) Return 0 #forceref $pSelf, $long EndFunc Func CoreWebView2CreateCoreWebView2ControllerCompletedHandler_Invoke( $pSelf, $long, $ptr ) ; Ret: long Par: long;ptr* ConsoleWrite( "CoreWebView2CreateCoreWebView2ControllerCompletedHandler_Invoke" & @CRLF ) $oCoreWebView2Controller = ObjCreateInterface( $ptr, $sIID_ICoreWebView2Controller, $dtag_ICoreWebView2Controller ) ConsoleWrite( "IsObj( $oCoreWebView2Controller ) = " & IsObj( $oCoreWebView2Controller ) & @CRLF ) $oCoreWebView2Controller.AddRef() $oCoreWebView2Controller.get_CoreWebView2( $pCoreWebView2 ) $oCoreWebView2 = ObjCreateInterface( $pCoreWebView2, $sIID_ICoreWebView2, $dtag_ICoreWebView2 ) ConsoleWrite( "IsObj( $oCoreWebView2 ) = " & IsObj( $oCoreWebView2 ) & @CRLF & @CRLF ) Local $tRect = _WinAPI_GetClientRect( $hGui ) $oCoreWebView2Controller.put_Bounds( $tRect ) $oCoreWebView2.Navigate( "https://www.bing.com/" ) Return 0 #forceref $pSelf, $long EndFunc The code is translated to AutoIt from the C++ code in the Getting started example step 3 and from the AutoHotkey code in WebView2.ahk. A slightly updated example is included in WebView2-1.au3 in the 7z-file at bottom of this post.
    1 point
  17. What I'm trying to say is simply that the entire WebView project is based on techniques and code that are so complicated that AutoIt programmers will not find it attractive and therefore will not use it. We run the risk that a UDF as a result of the project will simply not be used.
    0 points
×
×
  • Create New...