Search the Community
Showing results for tags 'desktop'.
-
Saves the position of the icons, from the desktop, with the ability of restoring With command line parameters -save , it save the icons setting, with -restore , it restore the icons setting. Without command line parameters display a GUI with save , restore buttons DesktopIconSet.au3 ; https://www.autoitscript.com/forum/topic/210688-desktop-icons-save-and-restore/ ;---------------------------------------------------------------------------------------- ; Title...........: DesktopIconSet.au3 ; Description.....: Saves the position of the icons, from the desktop, with the ability of restoring ; AutoIt Version..: 3.3.16.1 Author: ioa747 ; Notes ..........: Tested on Windows 10 Version 22H2 ;---------------------------------------------------------------------------------------- #AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 #AutoIt3Wrapper_UseX64=y #include <GuiListView.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Global Const $g_sIniPath = @ScriptDir & "\Setting.ini" Global $g_hDesktop = _WinGetDesktopHandle() Global $g_hDeskCtrlListView = ControlGetHandle($g_hDesktop, "", "[CLASS:SysListView32;INSTANCE:1]") ConsoleWrite("$g_sIniPath=" & $g_sIniPath & @CRLF) ConsoleWrite("$g_hDesktop=" & $g_hDesktop & @CRLF) ConsoleWrite("$g_hDeskCtrlListView=" & $g_hDeskCtrlListView & @CRLF) Global $iParams = $CmdLine[0] ;Check if $CmdLine parameters If Not $iParams Then _CallGUI() Else $iParams = $CmdLine EndIf Switch $iParams[1] Case "-save" _SaveSetting() Case "-restore" _RestoreSetting() EndSwitch Exit ;_SetShortcutPos("Recycle Bin", 0, 0) ;---------------------------------------------------------------------------------------- Func _CallGUI() GUICreate(" DeskTop shortcuts", 170, 90, -1, -1, -1, BitOR($WS_EX_TOOLWINDOW, $WS_EX_TOPMOST)) Local $ButtonSave = GUICtrlCreateButton("Save Setting", 10, 10, 150, 30) GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif") Local $ButtonRestore = GUICtrlCreateButton("Restore Setting", 10, 50, 150, 30) GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif") GUISetState(@SW_SHOW) Local $nMsg While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE ExitLoop Case $ButtonSave _SaveSetting() ExitLoop Case $ButtonRestore _RestoreSetting() ExitLoop EndSwitch WEnd Exit EndFunc ;==>_CallGUI ;---------------------------------------------------------------------------------------- Func _SetShortcutPos($Name = "", $X = 0, $Y = 0) Local $iIndex = _GUICtrlListView_FindInText($g_hDeskCtrlListView, $Name) If $iIndex == -1 Then Return SetError(1, 0, "! Could not find icon: " & $Name) EndIf _GUICtrlListView_SetItemPosition($g_hDeskCtrlListView, $iIndex, $X, $Y) Return "- " & $Name & "=" & $X & "," & $Y EndFunc ;==>_SetShortcutPos ;---------------------------------------------------------------------------------------- Func _SaveSetting() Local $iItemCount, $sTxt, $aPos $iItemCount = _GUICtrlListView_GetItemCount($g_hDeskCtrlListView) ConsoleWrite("> Save Setting:" & @CRLF) ConsoleWrite("- Item Count:" & $iItemCount & @CRLF) $sTxt = "[Setting]" & @CRLF For $i = 0 To $iItemCount - 1 $sTxt &= _GUICtrlListView_GetItemText($g_hDeskCtrlListView, $i) $aPos = _GUICtrlListView_GetItemPosition($g_hDeskCtrlListView, $i) $sTxt &= "=" & $aPos[0] & "," & $aPos[1] & @CRLF Next ConsoleWrite($sTxt & @CRLF) Local $hFileOpen = FileOpen($g_sIniPath, $FO_OVERWRITE + $FO_CREATEPATH + $FO_UTF8_NOBOM) If $hFileOpen = -1 Then MsgBox($MB_SYSTEMMODAL, "", "An error occurred whilst writing the txt file.") Return False EndIf FileWrite($hFileOpen, $sTxt) EndFunc ;==>_SaveSetting ;---------------------------------------------------------------------------------------- Func _RestoreSetting() ConsoleWrite("> Restore Setting:" & @CRLF) Local $aPos ; Read the INI section labelled 'Setting'. This will return a 2 dimensional array. Local $aArray = IniReadSection($g_sIniPath, "Setting") If Not @error Then ; Enumerate through the array displaying the keys and their respective values. For $i = 1 To $aArray[0][0] $aPos = StringSplit($aArray[$i][1], ",") If $aPos[0] = 2 Then ConsoleWrite(_SetShortcutPos($aArray[$i][0], $aPos[1], $aPos[2]) & @CRLF) EndIf Next EndIf EndFunc ;==>_RestoreSetting ;---------------------------------------------------------------------------------------- ; https://www.autoitscript.com/forum/topic/119783-desktop-class-workerw/#comment-903081 ; <_WinGetDesktopHandle.au3> ; Function to get the Windows' Desktop Handle. ; Since this is no longer a simple '[CLASS:Progman]' on Aero-enabled desktops, this method uses a slightly ; more involved method to find the correct Desktop Handle. ; ; Author: Ascend4nt, credits to Valik for pointing out the Parent->Child relationship: Desktop->'SHELLDLL_DefView' ;---------------------------------------------------------------------------------------- Func _WinGetDesktopHandle() Local $i, $hDeskWin, $hSHELLDLL_DefView, $h_Listview_Configs, $aWinList ; The traditional Windows Classname for the Desktop, not always so on newer O/S's $hDeskWin = WinGetHandle("[CLASS:Progman]") ; Parent->Child relationship: Desktop->SHELLDLL_DefView $hSHELLDLL_DefView = ControlGetHandle($hDeskWin, '', '[CLASS:SHELLDLL_DefView; INSTANCE:1]') ; No luck with finding the Desktop and/or child? If $hDeskWin = '' Or $hSHELLDLL_DefView = '' Then ; Look through a list of WorkerW windows - one will be the Desktop on Windows 7+ O/S's $aWinList = WinList("[CLASS:WorkerW]") For $i = 1 To $aWinList[0][0] $hSHELLDLL_DefView = ControlGetHandle($aWinList[$i][1], '', '[CLASS:SHELLDLL_DefView; INSTANCE:1]') If $hSHELLDLL_DefView <> '' Then $hDeskWin = $aWinList[$i][1] ExitLoop EndIf Next EndIf ; Parent->Child relationship: Desktop->SHELDLL_DefView->SysListView32 $h_Listview_Configs = ControlGetHandle($hSHELLDLL_DefView, '', '[CLASS:SysListView32; INSTANCE:1]') If $h_Listview_Configs = '' Then Return SetError(-1, 0, '') Return SetExtended($h_Listview_Configs, $hDeskWin) EndFunc ;==>_WinGetDesktopHandle ;---------------------------------------------------------------------------------------- Please, leave your comments and experiences here. thank you very much !
-
I use: _WinAPI_CreateDesktop example: #include <MsgBoxConstants.au3> #include <WinAPIMem.au3> #include <WinAPIProc.au3> #include <WinAPISys.au3> ; Retrieve a handle to the current desktop and create a new desktop named "MyDesktop" Local $hPrev = _WinAPI_GetThreadDesktop(_WinAPI_GetCurrentThreadId()) Local $hDesktop = _WinAPI_CreateDesktop('MyDesktop', BitOR($DESKTOP_CREATEWINDOW, $DESKTOP_SWITCHDESKTOP)) If Not $hDesktop Then MsgBox(($MB_ICONERROR + $MB_SYSTEMMODAL), 'Error', 'Unable to create desktop.') Exit EndIf ; Switch to the newly created desktop _WinAPI_SwitchDesktop($hDesktop) ; Run "notepad.exe" on "MyDesktop" and wait until a process will not be closed by user Local $pText = _WinAPI_CreateString('MyDesktop') Local $tProcess = DllStructCreate($tagPROCESS_INFORMATION) Local $tStartup = DllStructCreate($tagSTARTUPINFO) DllStructSetData($tStartup, 'Size', DllStructGetSize($tStartup)) DllStructSetData($tStartup, 'Desktop', $pText) If _WinAPI_CreateProcess('', @SystemDir & '\notepad.exe', 0, 0, 0, $CREATE_NEW_PROCESS_GROUP, 0, 0, $tStartup, $tProcess) Then ProcessWaitClose(DllStructGetData($tProcess, 'ProcessID')) EndIf ; Switch to previous desktop and close "MyDesktop" _WinAPI_SwitchDesktop($hPrev) _WinAPI_CloseDesktop($hDesktop) ; Free memory allocated for a string _WinAPI_FreeMemory($pText) and also _WinAPI_EnumDesktops : #include <Array.au3> #include <WinAPISys.au3> Local $aData = _WinAPI_EnumDesktops(_WinAPI_GetProcessWindowStation()) _ArrayDisplay($aData, '_WinAPI_EnumDesktops') How this differ with: https://support.microsoft.com/en-us/windows/multiple-desktops-in-windows-36f52e38-5b4a-557b-2ff9-e1a60c976434 https://www.digitalcitizen.life/how-create-use-and-remove-desktops-windows-10/
-
Unfortunately, in Windows 11 the function to add a shortcut to the taskbar for quick access to desktop icons has been removed and since I relatively often need the desktop icons for daily work, I wrote a small tool to help me access the desktop icons faster which I want to share with you. The tool is written for Windows 11, so on older operating systems the result may differ. #pragma compile(FileVersion, 0.8.0.0) #pragma compile(ProductVersion, 3.3.16.1) #pragma compile(LegalCopyright, "UEZ 2022 - 2023") #pragma compile(CompanyName, "UEZ Software Development") #pragma compile(FileDescription, "Toolbar Desktop.exe - a simple toolbar menu app for Windows 11 to access desktop icons faster.") ;don't change because it is needed #pragma compile(Icon, Shell32_39.ico) ;~ #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 #AutoIt3Wrapper_Change2CUI=n #AutoIt3Wrapper_Version=p #AutoIt3Wrapper_UseX64=n #AutoIt3Wrapper_Res_HiDpi=n #AutoIt3Wrapper_Run_Au3Stripper=y #Au3Stripper_Parameters=/so /pe ;/rm ;~ #AutoIt3Wrapper_Run_After=del /f /q "%scriptdir%\%scriptfile%_stripped.au3" #Include <Array.au3> #Include <ButtonConstants.au3> #Include <File.au3> #Include <FontConstants.au3> #Include <GDIPlus.au3> #Include <GUIConstantsEx.au3> #Include <GuiImageList.au3> #Include <GuiListView.au3> #Include <GuiMenu.au3> #Include <GuiStatusBar.au3> #Include <Misc.au3> #Include <StaticConstants.au3> #Include <TrayConstants.au3> #Include <WinAPIShellEx.au3> #Include <WinAPISys.au3> #Include <WinAPIvkeysConstants.au3> #Include <WindowsConstants.au3> If @OSBuild < 7600 Then Exit MsgBox($MB_ICONERROR, "ERROR", "This app is using the Win7+ API which means that your operation system is not supported!", 10) If @OSBuild < 22000 Then MsgBox($MB_ICONWARNING, "WARNING", "This app is not designed for your operating system." & @CRLF & "The app may not work as intended!", 10) AutoItSetOption("TrayMenuMode", 3) AutoItSetOption("MustDeclareVars", 1) If (Not @Compiled) And (Not FileExists(@ScriptDir & "\_Shell32_39.ico")) Then _Shell32_39ico(True) Global Const $sScriptName = StringTrimRight(@ScriptName, 4) Global Const $sTitle = "Toolbar Desktop ", $sVer = "v0.80 build 2023-08-31 beta" Global $iPID = ProcessExists(@ScriptName) If Not _Singleton(@ScriptName, 1) Or ($iPID <> @AutoItPID And $iPID <> 0) Then Exit MsgBox(16, "ERROR", "An occurence of " & @ScriptName & " is already running", 20) _GDIPlus_Startup() #OnAutoItStartRegister "OnAutoItStart" Global $__Restart = False #Region DPI Global Enum $DPI_AWARENESS_INVALID = -1, $DPI_AWARENESS_UNAWARE = 0, $DPI_AWARENESS_SYSTEM_AWARE = 1, $DPI_AWARENESS_PER_MONITOR_AWARE = 2 Global Const $DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE = $DPI_AWARENESS_UNAWARE - 3 Global Const $DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 = $DPI_AWARENESS_UNAWARE - 4 Global Enum $MDT_EFFECTIVE_DPI = 0, $MDT_ANGULAR_DPI, $MDT_RAW_DPI Global Const $MDT_DEFAULT = $MDT_EFFECTIVE_DPI Global Const $WM_DPICHANGED = 0x02E0 Global $AWARENESS Switch @OSBuild Case 9200 To 13999 $AWARENESS = $DPI_AWARENESS_PER_MONITOR_AWARE Case @OSBuild > 13999 $AWARENESS = $DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 EndSwitch Global $iDPI = _WinAPI_SetDPIAwareness($AWARENESS), $iDPI_def = 96, $g_iDPI_ratio1, $g_iDPI_ratio2, $g_iDPI_Prev = $iDPI, $bSorted = 0 $g_iDPI_ratio1 = $iDPI / $iDPI_def $g_iDPI_ratio2 = $g_iDPI_ratio1 ^ - 1 #EndRegion #Region IUIAutomation MS framework Global Const $TreeScope_Children = 2, $UIA_ControlTypePropertyId = 30003, $UIA_NamePropertyId = 30005, $UIA_ButtonControlTypeId = 50000 Global Const $sCLSID_CUIAutomation = "{FF48DBA4-60EF-4201-AA87-54103EEF594E}" Global Const $sIID_IUIAutomationElement = "{D22108AA-8AC5-49A5-837B-37BBB3D7591E}" Global $dtagIUIAutomationElement = "SetFocus hresult();" & "GetRuntimeId hresult(ptr*);" & "FindFirst hresult(long;ptr;ptr*);" & "FindAll hresult(long;ptr;ptr*);" & "FindFirstBuildCache hresult(long;ptr;ptr;ptr*);" & "FindAllBuildCache hresult(long;ptr;ptr;ptr*);" & "BuildUpdatedCache hresult(ptr;ptr*);" & "GetCurrentPropertyValue hresult(int;variant*);" & "GetCurrentPropertyValueEx hresult(int;long;variant*);" & "GetCachedPropertyValue hresult(int;variant*);" & "GetCachedPropertyValueEx hresult(int;long;variant*);" & "GetCurrentPatternAs hresult(int;none;none*);" & "GetCachedPatternAs hresult(int;none;none*);" & "GetCurrentPattern hresult(int;ptr*);" & "GetCachedPattern hresult(int;ptr*);" & "GetCachedParent hresult(ptr*);" & "GetCachedChildren hresult(ptr*);" & "CurrentProcessId hresult(int*);" & "CurrentControlType hresult(int*);" & "CurrentLocalizedControlType hresult(bstr*);" & "CurrentName hresult(bstr*);" & "CurrentAcceleratorKey hresult(bstr*);" & "CurrentAccessKey hresult(bstr*);" & "CurrentHasKeyboardFocus hresult(long*);" & "CurrentIsKeyboardFocusable hresult(long*);" & "CurrentIsEnabled hresult(long*);" & "CurrentAutomationId hresult(bstr*);" & "CurrentClassName hresult(bstr*);" & "CurrentHelpText hresult(bstr*);" & "CurrentCulture hresult(int*);" & "CurrentIsControlElement hresult(long*);" & "CurrentIsContentElement hresult(long*);" & "CurrentIsPassword hresult(long*);" & "CurrentNativeWindowHandle hresult(hwnd*);" & "CurrentItemType hresult(bstr*);" & "CurrentIsOffscreen hresult(long*);" & "CurrentOrientation hresult(long*);" & "CurrentFrameworkId hresult(bstr*);" & "CurrentIsRequiredForForm hresult(long*);" & "CurrentItemStatus hresult(bstr*);" & "CurrentBoundingRectangle hresult(struct*);" & "CurrentLabeledBy hresult(ptr*);" & "CurrentAriaRole hresult(bstr*);" & "CurrentAriaProperties hresult(bstr*);" & "CurrentIsDataValidForForm hresult(long*);" & "CurrentControllerFor hresult(ptr*);" & "CurrentDescribedBy hresult(ptr*);" & "CurrentFlowsTo hresult(ptr*);" & "CurrentProviderDescription hresult(bstr*);" & "CachedProcessId hresult(int*);" & "CachedControlType hresult(int*);" & "CachedLocalizedControlType hresult(bstr*);" & "CachedName hresult(bstr*);" & "CachedAcceleratorKey hresult(bstr*);" & "CachedAccessKey hresult(bstr*);" & "CachedHasKeyboardFocus hresult(long*);" & "CachedIsKeyboardFocusable hresult(long*);" & "CachedIsEnabled hresult(long*);" & "CachedAutomationId hresult(bstr*);" & "CachedClassName hresult(bstr*);" & "CachedHelpText hresult(bstr*);" & "CachedCulture hresult(int*);" & "CachedIsControlElement hresult(long*);" & "CachedIsContentElement hresult(long*);" & "CachedIsPassword hresult(long*);" & "CachedNativeWindowHandle hresult(hwnd*);" & "CachedItemType hresult(bstr*);" & "CachedIsOffscreen hresult(long*);" & "CachedOrientation hresult(long*);" & "CachedFrameworkId hresult(bstr*);" & "CachedIsRequiredForForm hresult(long*);" & "CachedItemStatus hresult(bstr*);" & "CachedBoundingRectangle hresult(struct*);" & "CachedLabeledBy hresult(ptr*);" & "CachedAriaRole hresult(bstr*);" & "CachedAriaProperties hresult(bstr*);" & "CachedIsDataValidForForm hresult(long*);" & "CachedControllerFor hresult(ptr*);" & "CachedDescribedBy hresult(ptr*);" & "CachedFlowsTo hresult(ptr*);" & "CachedProviderDescription hresult(bstr*);" & "GetClickablePoint hresult(struct*;long*);" Global Const $sIID_IUIAutomationElementArray = "{14314595-B4BC-4055-95F2-58F2E42C9855}" Global $dtagIUIAutomationElementArray = "Length hresult(int*);" & "GetElement hresult(int;ptr*);" Global Const $sIID_IUIAutomationPropertyCondition = "{99EBF2CB-5578-4267-9AD4-AFD6EA77E94B}" Global $dtagIUIAutomationPropertyCondition = "propertyId hresult(int*);" & "PropertyValue hresult(variant*);" & "PropertyConditionFlags hresult(long*);" Global Const $sIID_IUIAutomation = "{30CBE57D-D9D0-452A-AB13-7AC5AC4825EE}" Global $dtagIUIAutomation = "CompareElements hresult(ptr;ptr;long*);" & "CompareRuntimeIds hresult(ptr;ptr;long*);" & "GetRootElement hresult(ptr*);" & "ElementFromHandle hresult(hwnd;ptr*);" & "ElementFromPoint hresult(struct;ptr*);" & "GetFocusedElement hresult(ptr*);" & "GetRootElementBuildCache hresult(ptr;ptr*);" & "ElementFromHandleBuildCache hresult(hwnd;ptr;ptr*);" & "ElementFromPointBuildCache hresult(struct;ptr;ptr*);" & "GetFocusedElementBuildCache hresult(ptr;ptr*);" & "CreateTreeWalker hresult(ptr;ptr*);" & "ControlViewWalker hresult(ptr*);" & "ContentViewWalker hresult(ptr*);" & "RawViewWalker hresult(ptr*);" & "RawViewCondition hresult(ptr*);" & "ControlViewCondition hresult(ptr*);" & "ContentViewCondition hresult(ptr*);" & "CreateCacheRequest hresult(ptr*);" & "CreateTrueCondition hresult(ptr*);" & "CreateFalseCondition hresult(ptr*);" & "CreatePropertyCondition hresult(int;variant;ptr*);" & "CreatePropertyConditionEx hresult(int;variant;long;ptr*);" & "CreateAndCondition hresult(ptr;ptr;ptr*);" & "CreateAndConditionFromArray hresult(ptr;ptr*);" & "CreateAndConditionFromNativeArray hresult(ptr;int;ptr*);" & "CreateOrCondition hresult(ptr;ptr;ptr*);" & "CreateOrConditionFromArray hresult(ptr;ptr*);" & "CreateOrConditionFromNativeArray hresult(ptr;int;ptr*);" & "CreateNotCondition hresult(ptr;ptr*);" & "AddAutomationEventHandler hresult(int;ptr;long;ptr;ptr);" & "RemoveAutomationEventHandler hresult(int;ptr;ptr);" & "AddPropertyChangedEventHandlerNativeArray hresult(ptr;long;ptr;ptr;struct*;int);" & "AddPropertyChangedEventHandler hresult(ptr;long;ptr;ptr;ptr);" & "RemovePropertyChangedEventHandler hresult(ptr;ptr);" & "AddStructureChangedEventHandler hresult(ptr;long;ptr;ptr);" & "RemoveStructureChangedEventHandler hresult(ptr;ptr);" & "AddFocusChangedEventHandler hresult(ptr;ptr);" & "RemoveFocusChangedEventHandler hresult(ptr);" & "RemoveAllEventHandlers hresult();" & "IntNativeArrayToSafeArray hresult(int;int;ptr*);" & "IntSafeArrayToNativeArray hresult(ptr;int*;int*);" & "RectToVariant hresult(struct;variant*);" & "VariantToRect hresult(variant;struct*);" & "SafeArrayToRectNativeArray hresult(ptr;struct*;int*);" & "CreateProxyFactoryEntry hresult(ptr;ptr*);" & "ProxyFactoryMapping hresult(ptr*);" & "GetPropertyProgrammaticName hresult(int;bstr*);" & "GetPatternProgrammaticName hresult(int;bstr*);" & "PollForPotentialSupportedPatterns hresult(ptr;ptr*;ptr*);" & "PollForPotentialSupportedProperties hresult(ptr;ptr*;ptr*);" & "CheckNotSupported hresult(variant;long*);" & "ReservedNotSupportedValue hresult(ptr*);" & "ReservedMixedAttributeValue hresult(ptr*);" & "ElementFromIAccessible hresult(idispatch;int;ptr*);" & "ElementFromIAccessibleBuildCache hresult(iaccessible;int;ptr;ptr*);" #EndRegion IUIAutomation MS framework #Region TichySID Global Const $tagIMAGE_DOS_HEADER = 'WORD e_magic;WORD e_cblp;WORD e_cp;WORD e_crlc;WORD e_cparhdr;WORD e_minalloc;WORD e_maxalloc;WORD e_ss;WORD e_sp;WORD e_csum;WORD e_ip;WORD e_cs;WORD e_lfarlc;WORD e_ovno;WORD e_res[4];WORD e_oemid;WORD e_oeminfo;WORD e_res2[10];LONG e_lfanew;' Global Const $tagIMAGE_FILE_HEADER = 'WORD Machine;WORD NumberOfSections;DWORD TimeDateStamp;DWORD PointerToSymbolTable;DWORD NumberOfSymbols;WORD SizeOfOptionalHeader;WORD Characteristics;' Global $tagIMAGE_OPTIONAL_HEADER = 'WORD Magic;BYTE MajorLinkerVersion;BYTE MinorLinkerVersion;DWORD SizeOfCode;DWORD SizeOfInitializedData;DWORD SizeOfUninitializedData;DWORD AddressOfEntryPoint;DWORD BaseOfCode;DWORD BaseOfData;PTR ImageBase;DWORD SectionAlignment;DWORD FileAlignment;WORD MajorOperatingSystemVersion;WORD MinorOperatingSystemVersion;WORD MajorImageVersion;WORD MinorImageVersion;WORD MajorSubsystemVersion;WORD MinorSubsystemVersion;DWORD Win32VersionValue;DWORD SizeOfImage;DWORD SizeOfHeaders;DWORD CheckSum;WORD Subsystem;WORD DllCharacteristics;PTR SizeOfStackReserve;PTR SizeOfStackCommit;PTR SizeOfHeapReserve;PTR SizeOfHeapCommit;DWORD LoaderFlags;DWORD NumberOfRvaAndSizes;' If @AutoItX64 Then $tagIMAGE_OPTIONAL_HEADER = 'WORD Magic;BYTE MajorLinkerVersion;BYTE MinorLinkerVersion;DWORD SizeOfCode;DWORD SizeOfInitializedData;DWORD SizeOfUninitializedData;DWORD AddressOfEntryPoint;DWORD BaseOfCode;PTR ImageBase;DWORD SectionAlignment;DWORD FileAlignment;WORD MajorOperatingSystemVersion;WORD MinorOperatingSystemVersion;WORD MajorImageVersion;WORD MinorImageVersion;WORD MajorSubsystemVersion;WORD MinorSubsystemVersion;DWORD Win32VersionValue;DWORD SizeOfImage;DWORD SizeOfHeaders;DWORD CheckSum;WORD Subsystem;WORD DllCharacteristics;PTR SizeOfStackReserve;PTR SizeOfStackCommit;PTR SizeOfHeapReserve;PTR SizeOfHeapCommit;DWORD LoaderFlags;DWORD NumberOfRvaAndSizes;' Global Const $tagIMAGE_NT_HEADER = 'DWORD Signature;' & $tagIMAGE_FILE_HEADER & $tagIMAGE_OPTIONAL_HEADER Global Const $tagIMAGE_SECTION_HEADER = 'CHAR Name[8];DWORD VirtualSize;DWORD VirtualAddress;DWORD SizeOfRawData;DWORD PointerToRawData;DWORD PointerToRelocations;DWORD PointerToLinenumbers;WORD NumberOfRelocations;WORD NumberOfLinenumbers;DWORD Characteristics;' Global Const $tagIMAGE_DATA_DIRECTORY = 'DWORD VirtualAddress;DWORD Size;' Global Const $tagIMAGE_BASE_RELOCATION = 'DWORD VirtualAddress;DWORD SizeOfBlock;' Global Const $tagIMAGE_IMPORT_DESCRIPTOR = 'DWORD OriginalFirstThunk;DWORD TimeDateStamp;DWORD ForwarderChain;DWORD Name;DWORD FirstThunk;' Global Const $tagIMAGE_IMPORT_BY_NAME = 'WORD Hint;char Name[1];' Global Const $tagIMAGE_EXPORT_DIRECTORY = 'DWORD Characteristics;DWORD TimeDateStamp;WORD MajorVersion;WORD MinorVersion;DWORD Name;DWORD Base;DWORD NumberOfFunctions;DWORD NumberOfNames;DWORD AddressOfFunctions;DWORD AddressOfNames;DWORD AddressOfNameOrdinals;' Global $_KERNEL32DLL = DllOpen('kernel32.dll') Global $_MFHookPtr, $_MFHookBak, $_MFHookApi = 'LocalCompact' Global Const $tagModule = 'PTR ExportList;PTR CodeBase;PTR ImportList;PTR DllEntry;DWORD Initialized;' Global Const $SID_MEMORY = 1 Global Const $SID_NON_DEFAULT = 2 Global $hTitchysidDll, $iSubsongCount = 0 Global $binSID = _SID_Tune() #EndRegion Global $aTaskbar = WinGetPos("[CLASS:Shell_TrayWnd;INSTANCE:1]", "") Global $i, $aShortcutDetails, $hIcon, $aFileList = ReadDesktopIcons(), $aFileIcons[$aFileList[0] + 1] If @error Then Dim $aFileList[1] $aFileList[0] = 0 MsgBox($MB_ICONWARNING, "Warning", "No desktop icons!", 15) EndIf Global $iLen = 0, $l For $i = 1 To $aFileList[0] $l = StringLen(StringRegExpReplace($aFileList[$i], ".*\\(.*)\..+", "$1")) $iLen = $l > $iLen ? $l : $iLen Next Global $iW = 0, $iH = 0, $iW_def, $iH_def, $iLVBgColor = 0xFFFFFF, $iColumnWidth, $hHBITMAP, $fIconSize = 16 * $g_iDPI_ratio1, $fLVFontSize = 15.5 * $g_iDPI_ratio1 Global Const $hGUI = GUICreate("Toolbar Desktop by UEZ", $iW, $iH, $aTaskbar[1] ? -1 : -10000, $aTaskbar[1] ? -10000 : -1, BitOR($WS_MINIMIZEBOX, $WS_SIZEBOX), $WS_EX_TOPMOST) GUISetFont(8.5, $FW_NORMAL, $GUI_FONTNORMAL, "Arial", $hGUI, $CLEARTYPE_QUALITY) Global $hLV_Font = _WinAPI_CreateFont($fLVFontSize, 0, 0, 0, $FW_MEDIUM, False, False, False, $DEFAULT_CHARSET, $OUT_DEFAULT_PRECIS, $CLIP_DEFAULT_PRECIS, $CLEARTYPE_QUALITY, 0, "Segoe UI") Global $hLV = _GUICtrlListView_Create($hGUI, "", 0, 0, 0, 0, BitOR($LVS_SINGLESEL, $LVS_NOCOLUMNHEADER, $LVS_LIST)), $iLV = _WinAPI_GetDlgCtrlID($hLV) GUICtrlSendMsg($hLV, $LVM_SETEXTENDEDLISTVIEWSTYLE, $LVS_EX_ONECLICKACTIVATE, $LVS_EX_TRACKSELECT) _GUICtrlListView_SetExtendedListViewStyle($hLV, $LVS_EX_DOUBLEBUFFER) _GUICtrlListView_InsertColumn($hLV, 0, "Desktop App") Global Const $ILC_ORIGINALSIZE = 0x00010000, $ILC_HIGHQUALITYSCALE = 0x00020000 Global $hImageList = DllCall("comctl32.dll", "handle", "ImageList_Create", "int", $fIconSize, "int", $fIconSize, "uint", BitOR($ILC_COLOR32, $ILC_ORIGINALSIZE, $ILC_HIGHQUALITYSCALE), "int", $aFileList[0], "int", $aFileList[0])[0] _GUICtrlListView_SetBkColor($hLV, $iLVBgColor) ConsoleWrite("Added " & $aFileList[0] & " items to the list" & @CRLF) For $i = 1 To $aFileList[0] $hIcon = _WinAPI_ShellExtractAssociatedIcon($aFileList[$i], True) If $hIcon Then $aFileIcons[$i] = $hIcon $hHBITMAP = _WinAPI_Create32BitHBITMAP($hIcon) _GUIImageList_Add($hImageList, $hHBITMAP) _WinAPI_DeleteObject($hHBITMAP) Else _GUIImageList_Add($hImageList, _GUICtrlListView_CreateSolidBitMap($hLV, 0xFFFFFF, $fIconSize, $fIconSize)) EndIf Next _GUICtrlListView_SetImageList($hLV, $hImageList, 1) Global $aIconAssignment[UBound($aFileList) - 1][3] For $i = 1 To $aFileList[0] If StringInStr(FileGetAttrib($aFileList[$i]), "D") Then If StringRegExp($aFileList[$i], ".+\.\{(.*)\}") Then _GUICtrlListView_AddItem($hLV, StringRegExpReplace($aFileList[$i], ".*\\(.*)\..+", "$1"), $i - 1, $i - 1) Else _GUICtrlListView_AddItem($hLV, StringRegExpReplace($aFileList[$i], ".+\\(.+)", "$1"), $i - 1, $i - 1) EndIf Else _GUICtrlListView_AddItem($hLV, StringRegExpReplace($aFileList[$i], ".*\\(.*)\..+", "$1"), $i - 1, $i - 1) EndIf $aIconAssignment[$i - 1][0] = $i - 1 $aIconAssignment[$i - 1][1] = $aFileList[$i] $aIconAssignment[$i - 1][2] = $aFileIcons[$i] Next Global $aPos = WinGetPos($hGUI), $aWinPos Global $aParts[1] = [1], $hStatusBar $hStatusBar = _GUICtrlStatusBar_Create($hGUI, $aParts) Global Const $iStatusBar = _WinAPI_GetDlgCtrlID($hStatusBar), $iH_SB = _GUICtrlStatusBar_GetHeight($hStatusBar) GUIRegisterMsg($WM_SIZE, "WM_SIZE") If $iW < @DesktopWidth / 2 And BitAND(_WinAPI_GetWindowLong($hLV, $GWL_STYLE), $WS_HSCROLL) = $WS_HSCROLL Then While BitAND(_WinAPI_GetWindowLong($hLV, $GWL_STYLE), $WS_HSCROLL) $iW += 2 $iH += 1 WinMove($hGUI, "", $aPos[0], $aPos[1], $iW * $g_iDPI_ratio1, ($iH + $iH_SB) * $g_iDPI_ratio1) If $iW > @DesktopWidth / 2 Then ExitLoop WEnd EndIf If $iW = 0 Or $iH = 0 Then $iW = 200 $iH = $iW * 8 / 16 WinMove($hGUI, "", $aPos[0], $aPos[1], $iW * $g_iDPI_ratio1, ($iH + $iH_SB + 1) * $g_iDPI_ratio1) _GUICtrlListView_SetColumnWidth($hLV, 0, $iW) EndIf Global $fAdjust = $g_iDPI_ratio1 > 1 ? 1 + $g_iDPI_ratio1 / 10 : 1 $iW_def = $iW * $fAdjust $iH_def = ($iH * $fAdjust + $iH_SB) ConsoleWrite("GUI size: " & ($iW) & " x " & ($iH) & @CRLF) Global $iLV_cw = _GUICtrlListView_GetColumnWidth($hLV, 0) _GUICtrlStatusBar_SetText($hStatusBar, $aFileList[0] & " icons added to the list") Global Const $hMenu_Tray = TrayItemGetHandle(0) Global Const $iTrayRestart = TrayCreateItem("Restart") Global Const $iTrayAutostart = TrayCreateItem("Autostart") Global Const $iTrayAbout = TrayCreateItem("About") TrayCreateItem("") Global Const $iTrayExit = TrayCreateItem("Exit") If RegRead("HKCU\Software\Microsoft\Windows\CurrentVersion\Run", "Toolbar Desktop") = '"' & @ScriptDir & '\Toolbar Desktop.exe"' Then TrayItemSetState($iTrayAutostart, $TRAY_CHECKED) Global Const $hBMP_Restart = _GDIPlus_BitmapCreateFromMemory(_Restart_Pic(), True) Global Const $hBMP_About = _GDIPlus_BitmapCreateFromMemory(_About_Pic(), True) Global Const $hBMP_Exit = _GDIPlus_BitmapCreateFromMemory(_Exit_Pic(), True) Global Const $hBMP_Check = _GDIPlus_BitmapCreateFromMemory(_Check_Pic(), True) Global Const $hBMP_Rect = _GDIPlus_BitmapCreateFromMemory(_Rect_Pic(), True) _GUICtrlMenu_SetItemBitmaps($hMenu_Tray, 0, $hBMP_Restart, $hBMP_Restart) _GUICtrlMenu_SetItemBitmaps($hMenu_Tray, 1, $hBMP_Check, $hBMP_Rect) _GUICtrlMenu_SetItemBitmaps($hMenu_Tray, 2, $hBMP_About, $hBMP_About) _GUICtrlMenu_SetItemBitmaps($hMenu_Tray, 4, $hBMP_Exit, $hBMP_Exit) Global $sRunAsAdmin Global Enum $idRunAsAdmin = 2000, $idAbout, $idSort, $idOpenFL Global Const $hQMenu_LV = _GUICtrlMenu_CreatePopup() _GUICtrlMenu_InsertMenuItem($hQMenu_LV, 0, "Run app as Administrator", $idRunAsAdmin) _GUICtrlMenu_InsertMenuItem($hQMenu_LV, 1, "") _GUICtrlMenu_InsertMenuItem($hQMenu_LV, 2, "Sort List", $idSort) _GUICtrlMenu_InsertMenuItem($hQMenu_LV, 3, "") _GUICtrlMenu_InsertMenuItem($hQMenu_LV, 4, "Open File Location", $idOpenFL) _GUICtrlMenu_SetMenu($hGUI, $hQMenu_LV) Global $hBMP_Shield = _GUICtrlMenu_CreateBitmap(@SystemDir & "\imageres.dll", 73) _GUICtrlMenu_SetItemBmp($hQMenu_LV, 0, $hBMP_Shield) Global $hTmp = _GDIPlus_BitmapCreateFromMemory(_Sort()) Global Const $hBMP_Sort = _GDIPlus_Convert2HBitmap($hTmp, $COLOR_MENU) _GDIPlus_BitmapDispose($hTmp) _GUICtrlMenu_SetItemBmp($hQMenu_LV, 2, $hBMP_Sort) $hTmp = _GDIPlus_BitmapCreateFromMemory(_OpenFolder()) Global Const $hBMP_OpenFolder = _GDIPlus_Convert2HBitmap($hTmp, $COLOR_MENU) _GDIPlus_BitmapDispose($hTmp) _GUICtrlMenu_SetItemBmp($hQMenu_LV, 4, $hBMP_OpenFolder) Global Const $hMenu_Sys = _GUICtrlMenu_GetSystemMenu($hGUI) _GUICtrlMenu_AppendMenu($hMenu_Sys, $MF_SEPARATOR, 0, 0) _GUICtrlMenu_AppendMenu($hMenu_Sys, $MF_STRING, $idAbout, "About") _GUICtrlMenu_SetItemBmp($hMenu_Sys, 8, $hBMP_About) _WinAPI_DwmSetWindowAttribute($hGUI, $DWMWA_TRANSITIONS_FORCEDISABLED, True) ;disable window animation GUISetState(@SW_SHOWMINIMIZED, $hGUI) GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") GUIRegisterMsg($WM_EXITSIZEMOVE, "WM_EXITSIZEMOVE") GUIRegisterMsg($WM_COMMAND, "WM_COMMAND") GUIRegisterMsg($WM_SYSCOMMAND, "WM_SYSCOMMAND") If @OSBuild > 9599 Then GUIRegisterMsg($WM_DPICHANGED, "WM_DPICHANGED") ;requires Win 8.1+ / Server 2012 R2+ Global $bCheck, $px, $py, $tx, $hTaskbar, $iMonitorX, $iMonitorY, $iMonitorW, $iMonitorH, $iTbW, $iTbH, $bManualResized = False Global Const $iWinTitleSize = _WinAPI_GetSystemMetrics($SM_CYSIZE), $iDummy_About = GUICtrlCreateDummy(), $iDummy_Error = GUICtrlCreateDummy() Global Const $iListViewCallback = DllCallbackRegister("LVKeyCallback", "long", "int;wparam;lparam"), _ $hHook_Key = _WinAPI_SetWindowsHookEx($WH_KEYBOARD_LL, DllCallbackGetPtr($iListViewCallback), _WinAPI_GetModuleHandle(0)) Global $oMyError = ObjEvent("AutoIt.Error", "ErrFunc") Global $iFPS = 0, $iShowFPS = 0, $bExit = False, $oShell = ObjCreate("WScript.Shell") Do Switch GUIGetMsg() Case $GUI_EVENT_CLOSE _Exit() Case $iDummy_About About() Case $iDummy_Error MsgBox(BitOR($MB_TOPMOST, $MB_ICONWARNING), "Warning", "No desktop icons were added to the list!" & @CRLF & "Add at least one icon to the desktop which can be shell executed!", 15, $hGUI) EndSwitch Switch TrayGetMsg() Case $iTrayRestart _ScriptRestart() ;restart script to re-read desktop icons Case $iTrayAutostart $bCheck = BitAND($TRAY_CHECKED, TrayItemGetState($iTrayAutostart)) If $bCheck Then TrayItemSetState($iTrayAutostart, $TRAY_UNCHECKED) AutoStartReg(False) Else TrayItemSetState($iTrayAutostart, $TRAY_CHECKED) AutoStartReg(True) EndIf Case $iTrayAbout About() Case $iTrayExit _Exit() EndSwitch Until False Func PosGUI() ;~ $aWinPos = _WinAPI_FindMyIconPosInTaskbar("Toolbar Desktop.exe - a simple toolbar menu app for Windows 11 to access desktop icons faster") $aWinPos = _WinAPI_FindMyIconPosInTaskbar("Toolbar Desktop.exe") Local $tmpW = $iW_def, $tmpH = $iH_def If $bManualResized Then Local $aWin = WinGetPos($hGUI) $iW_def = $aWin[2] * $g_iDPI_ratio2 $iH_def = $aWin[3] * $g_iDPI_ratio2 EndIf If @error Or Not UBound($aWinPos) Then ConsoleWrite("Error getting icon pos in taskbar - " & @error & @CRLF) $px = MouseGetPos(0) - $iW_def * $g_iDPI_ratio1 / 2 $py = MouseGetPos(1) - $iH_def * $g_iDPI_ratio1 / 2 $px = $px < $iMonitorX ? $iMonitorX : $px $px = $px + $iW_def * $g_iDPI_ratio1 > $iMonitorX + $iMonitorW ? $iMonitorX + $iMonitorW - $iW_def * $g_iDPI_ratio1 : $px $py = $py < $iMonitorY ? $iMonitorY : $py $py = $py + $iH_def * $g_iDPI_ratio1 > $iMonitorY + $iMonitorH ? $iMonitorX + $iMonitorH - $iH_def * $g_iDPI_ratio1 : $py WinMove($hGUI, "", $px, $py, $iW_def * $g_iDPI_ratio1, $iH_def * $g_iDPI_ratio1) Else If $aWinPos[0] >= $iMonitorX + $iMonitorW And $aWinPos[1] < $iMonitorY + $iMonitorH Then ;Taskbar on the right side ConsoleWrite("Taskbar right" & @CRLF) $px = $aWinPos[0] - $iW_def * $g_iDPI_ratio1 - 1 $py = $aWinPos[1] + $aWinPos[3] - $iH_def * $g_iDPI_ratio1 / 2 $py = $py < $iMonitorY ? $iMonitorY : $py $py = $py + $iH_def * $g_iDPI_ratio1 > $iMonitorY + $iMonitorH ? $py + $iH_def * $g_iDPI_ratio1 - ($py + $iH_def * $g_iDPI_ratio1 - $iMonitorY + $iMonitorH) : $py ElseIf $aWinPos[0] < $iMonitorX And $aWinPos[1] < $iMonitorY + $iMonitorH Then ;Taskbar on the left side ConsoleWrite("Taskbar left" & @CRLF) $px = $aWinPos[0] + $aWinPos[2] + 1 $py = $aWinPos[1] + $aWinPos[3] - $iH_def * $g_iDPI_ratio1 / 2 $py = $py < $iMonitorY ? $iMonitorY : $py $py = $py + $iH_def * $g_iDPI_ratio1 > $iMonitorY + $iMonitorH ? $py + $iH_def * $g_iDPI_ratio1 - ($py + $iH_def * $g_iDPI_ratio1 - $iMonitorY + $iMonitorH) : $py ElseIf $aWinPos[1] < $iMonitorY And $aWinPos[0] > $iMonitorX Then ;Taskbar at top ConsoleWrite("Taskbar top" & @CRLF) $px = $aWinPos[0] - ($iW_def * $g_iDPI_ratio1 - $aWinPos[2]) / 2 $px = $px < $iMonitorX ? $iMonitorX : $px $tx = $iMonitorX + $iMonitorW - $px - $iW_def * $g_iDPI_ratio1 $py = $aWinPos[1] + $aWinPos[3] + 1 Else ;Taskbar at bottom ConsoleWrite("Taskbar bottom" & @CRLF) $px = $aWinPos[0] - ($iW_def * $g_iDPI_ratio1 - $aWinPos[2]) / 2 $px = $px < $iMonitorX ? $iMonitorX : $px $tx = $iMonitorX + $iMonitorW - $px - $iW_def * $g_iDPI_ratio1 If $tx < 0 Then $px += $tx $py = $aWinPos[1] - $iH_def * $g_iDPI_ratio1 - 1 EndIf WinMove($hGUI, "", $px, $py, $iW_def * $g_iDPI_ratio1, $iH_def * $g_iDPI_ratio1) EndIf If $bManualResized Then $iW_def = $tmpW $iH_def = $tmpH EndIf EndFunc ;==>PosGUI Func AdjustLVIcons() _GUICtrlListView_BeginUpdate($hLV) Local $i If $hLV_Font Then _WinAPI_DeleteObject($hLV_Font) $hLV_Font = _GUICtrlListView_SetItemHeightByFont($hLV, $fIconSize, $fLVFontSize) _GUIImageList_SetIconSize($hImageList, $fIconSize, $fIconSize) If $bSorted Then _ArraySort($aIconAssignment, 0, 0, 0, 0) For $i = 0 To UBound($aIconAssignment) - 1 _GUIImageList_ReplaceIcon($hImageList, -1, $aIconAssignment[$i][2]) Next _GUICtrlListView_SetImageList($hLV, $hImageList, 1) ;~ _GUICtrlListView_SetColumnWidth($hLV, 0, $LVSCW_AUTOSIZE) _GUICtrlListView_SetColumnWidth($hLV, 0, $iW_def * $g_iDPI_ratio1 / 3.5) _GUICtrlListView_EndUpdate($hLV) EndFunc ;==>AdjustLVIcons Func Max($a, $b) Return $a > $b ? $a : $b EndFunc ;==>Max Func Min($a, $b) Return $a < $b ? $a : $b EndFunc ;==>Min Func AutoStartReg($bSet) Switch $bSet Case True If RegWrite("HKCU\Software\Microsoft\Windows\CurrentVersion\Run", "Toolbar Desktop", "REG_SZ", '"' & @ScriptDir & '\Toolbar Desktop.exe"') Then MsgBox($MB_ICONINFORMATION, "Information", "Autostart entry properly set to the registry", 10, $hGUI) Else MsgBox($MB_ICONERROR, "ERROR", "Unable to set autostart entry to the registry!", 30, $hGUI) EndIf Case Else If RegDelete("HKCU\Software\Microsoft\Windows\CurrentVersion\Run", "Toolbar Desktop") Then MsgBox($MB_ICONINFORMATION, "Information", "Autostart entry properly removed from the registry", 10, $hGUI) Else MsgBox($MB_ICONERROR, "ERROR", "Unable to remove autostart entry from the registry!", 30, $hGUI) EndIf EndSwitch EndFunc ;==>AutoStartReg Func About() AutoItSetOption("GUIOnEventMode", 1) If @AutoItX64 = 0 Then _SIDStartup() _SIDOpen($binSID) EndIf $bExit = False TraySetState($TRAY_ICONSTATE_HIDE) GUISetState(@SW_MINIMIZE, $hGUI) GUISetState(@SW_HIDE, $hGUI) GDIPlus_About() If @AutoItX64 = 0 Then _SIDStop() _SIDClose() _SIDShutdown() EndIf TraySetState( $TRAY_ICONSTATE_SHOW) GUISetState(@SW_SHOWMINIMIZED, $hGUI) AutoItSetOption("GUIOnEventMode", 0) EndFunc ;==>About Func GDIPlus_About() Local Const $iW = 800, $iH = Int($iW * 9 / 16), $iWh = $iW / 2, $iHh = $iH / 2 Local Const $_t = 1 / 60 Local Const $hGUI_About = GUICreate($sTitle, $iW, $iH, -1, -1, -1, BitOR($WS_EX_APPWINDOW, $WS_EX_TOOLWINDOW)) GUISetState(@SW_SHOW, $hGUI_About) ;create canvas elements Local Const $hDC = _WinAPI_GetDC($hGUI_About) Local Const $hHBITMAP = _WinAPI_CreateCompatibleBitmap($hDC, $iW, $iH) Local Const $hDC_backbuffer = _WinAPI_CreateCompatibleDC($hDC) Local Const $DC_obj = _WinAPI_SelectObject($hDC_backbuffer, $hHBITMAP) Local Const $hCanvas = _GDIPlus_GraphicsCreateFromHDC($hDC_backbuffer) _GDIPlus_GraphicsSetSmoothingMode($hCanvas, $GDIP_SMOOTHINGMODE_HIGHQUALITY) _GDIPlus_GraphicsSetPixelOffsetMode($hCanvas, $GDIP_PIXELOFFSETMODE_HIGHQUALITY) ;~ _GDIPlus_GraphicsSetTextRenderingHint(_GDIPlus_GraphicsSetTextRenderingHint, $GDIP_TEXTRENDERINGHINTANTIALIASGRIDFIT) Local Const $fTxtHeight = 3.0 * $iH Local $hBrush_Clr = _GDIPlus_BrushCreateSolid(0xF0303030), _ $hBrush_FPS = _GDIPlus_BrushCreateSolid(0xF0808080), _ $hFormat_FPS = _GDIPlus_StringFormatCreate(), _ $hFamily_FPS = _GDIPlus_FontFamilyCreate("Arial"), _ $hFont_FPS = _GDIPlus_FontCreate($hFamily_FPS, 8), _ $tLayout_FPS = _GDIPlus_RectFCreate(0, 0, 60, 16), _ $hBrush_anim = _GDIPlus_BrushCreateSolid(0xF0C0C0C0), _ $hPen_anim = _GDIPlus_PenCreate(0xF0101010, 1), _ $tRectF_col = _GDIPlus_RectFCreate(0, 0, $iW, $iHh), _ $hBrush_txt = _GDIPlus_LineBrushCreateFromRectWithAngle($tRectF_col, 0xC07D1B7E, 0xCFFCDFFF, 45, True, 1), _ $tRectF_txt = _GDIPlus_RectFCreate(0, 0, $iW, $fTxtHeight), _ $hPen_txt = _GDIPlus_PenCreate(0x80000000, 2), _ $hFormat_txt = _GDIPlus_StringFormatCreate(), _ $hFamily_txt = _GDIPlus_FontFamilyCreate("Impact"), _ $hPath_txt = _GDIPlus_PathCreate(), _ $sTxt = $sTitle & @CRLF & _ $sVer & @CRLF & @CRLF & _ "Coded by" & @CRLF & @CRLF & _ "UEZ" & @CRLF & @CRLF & @CRLF & _ "Thanks to:" & @CRLF & _ "argumentum" & @CRLF & _ "BugFix" & @CRLF & _ "InnI" & @CRLF & _ "junkew" & @CRLF & _ "KaFu" & @CRLF & _ "Kanashius" & @CRLF & _ "Soren" & @CRLF & _ "Mombas" & @CRLF & _ "Yashied" & @CRLF & _ "wakillon" & @CRLF & _ "Ward" & @CRLF & @CRLF & @CRLF & _ "Greetings to all Autoit'ers" & @CRLF & _ "around the world." _GDIPlus_StringFormatSetAlign($hFormat_txt, 1) _GDIPlus_StringFormatSetLineAlign($hFormat_txt, 1) Local $p, $q, $z, $x, $s, $i, $t = 0, $f1, $px, $py $iFPS = 0 GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit_About", $hGUI_About) AdlibRegister("CalcFPS", 1000) $tRectF_txt.y = $iH + $iH / 10 Local $tFFTData = DllStructCreate("float data[1024]"), $pFFTData = DllStructGetPtr($tFFTData), $sum Do DllCall($__g_hGDIPDll, "int", "GdipFillRectangle", "handle", $hCanvas, "handle", $hBrush_Clr, "float", 0, "float", 0, "float", $iW, "float", $iH) ;erase canvas background DllCall($__g_hGDIPDll, "int", "GdipAddPathString", "handle", $hPath_txt, "wstr", $sTxt, "int", -1, "handle", $hFamily_txt, "int", 0, "float", $iH / 10, "struct*", $tRectF_txt, "handle", $hFormat_txt) ;~ _SIDGetFFTData($tFFTData) ;~ $sum = 0 ;~ For $i = 1 To 64 ;~ $sum += $tFFTData.data(($i)) * $tFFTData.data(($i)) ;~ Next ;~ $sum = 0x30 + Log(Sqrt($sum)) / Log(10) * 10 ;~ _GDIPlus_GraphicsClear($hCanvas, BitOR(0xFF000000, BitShift($sum, -16), BitShift($sum, -8), BitShift($sum, 0))) For $i = 0 To 1919 Step 15 $p = $i * Cos($t / 2) / 40 $q = $i / 628 $f1 = Sin($q) $z = 2.4 + Cos($p) * $f1 $x = Sin($p) * $f1 $s = 49 / $z / $z $f1 = 1 / $z $px = $iWh + $f1 * $x * $iWh $py = $iHh + Cos($q) * $iWh * $f1 DllCall($__g_hGDIPDll, "int", "GdipFillEllipse", "handle", $hCanvas, "handle", $hBrush_anim, "float", $px, "float", $py, "float", $s, "float", $s) ;~ DllCall($__g_hGDIPDll, "int", "GdipDrawEllipse", "handle", $hCanvas, "handle", $hPen_anim, "float", $px, "float", $py, "float", $s, "float", $s) Next DllCall($__g_hGDIPDll, "int", "GdipFillPath", "handle", $hCanvas, "handle", $hBrush_txt, "handle", $hPath_txt) DllCall($__g_hGDIPDll, "int", "GdipDrawPath", "handle", $hCanvas, "handle", $hPen_txt, "handle", $hPath_txt) DllCall($__g_hGDIPDll, "int", "GdipResetPath", "handle", $hPath_txt) $tRectF_txt.y -= 1 $tRectF_txt.y = ($tRectF_txt.y < -$iH / 10 - $fTxtHeight) ? ($iH + $iH / 10) : ($tRectF_txt.y) $t += $_t _GDIPlus_GraphicsDrawStringEx($hCanvas, "FPS: " & $iShowFPS, $hFont_FPS, $tLayout_FPS, $hFormat_FPS, $hBrush_FPS) _WinAPI_BitBlt($hDC, 0, 0, $iW, $iH, $hDC_backbuffer, 0, 0, $SRCCOPY) $iFPS += 1 If $bExit Then ExitLoop Until Not Sleep(10) AdlibUnRegister("CalcFPS") ;release resources _GDIPlus_PathDispose($hPath_txt) _GDIPlus_PenDispose($hPen_txt) _GDIPlus_PenDispose($hPen_anim) _GDIPlus_FontDispose($hFont_FPS) _GDIPlus_FontFamilyDispose($hFamily_FPS) _GDIPlus_FontFamilyDispose($hFamily_txt) _GDIPlus_StringFormatDispose($hFormat_FPS) _GDIPlus_StringFormatDispose($hFormat_txt) _GDIPlus_BrushDispose($hBrush_anim) _GDIPlus_BrushDispose($hBrush_Clr) _GDIPlus_BrushDispose($hBrush_FPS) _GDIPlus_GraphicsDispose($hCanvas) _WinAPI_SelectObject($hDC_backbuffer, $DC_obj) _WinAPI_DeleteDC($hDC_backbuffer) _WinAPI_DeleteObject($hHBITMAP) _WinAPI_ReleaseDC($hGUI_About, $hDC) GUIDelete($hGUI_About) EndFunc ;==>GDIPlus_About Func _Exit_About() $bExit = True EndFunc ;==>_Exit_About Func CalcFPS() ;display FPS $iShowFPS = $iFPS $iFPS = 0 EndFunc ;==>CalcFPS Func ReadDesktopIcons() Local $aFileList1 = _FileListToArray(@DesktopDir, "*", $FLTA_FILESFOLDERS, True) Local $aFileList2 = _FileListToArray(@DesktopCommonDir, "*", $FLTA_FILESFOLDERS, True) If BitOR(IsArray($aFileList1), IsArray($aFileList2)) = 0 Then Return SetError(1, 0, 0) Local $i, $j, $aFileList[$aFileList1[0] + $aFileList2[0] + 1], $c = 1 For $i = 1 To $aFileList1[0] If StringRight($aFileList1[$i], 4) <> ".ini" Then $aFileList[$c] = $aFileList1[$i] $c += 1 EndIf Next For $j = 1 To $aFileList2[0] If StringRight($aFileList2[$j], 4) <> ".ini" Then $aFileList[$c] = $aFileList2[$j] $c += 1 EndIf Next $aFileList[0] = $c - 1 ReDim $aFileList[$c] Return $aFileList EndFunc ;==>ReadDesktopIcons Func _ScriptRestart($fExit = 1) ;thanks to Yashied Local $pid If Not $__Restart Then If @Compiled Then $pid = Run(@ScriptFullPath & " " & $CmdLineRaw, @ScriptDir, Default, 1) Else $pid = Run(@AutoItExe & ' "' & @ScriptFullPath & '" ' & $CmdLineRaw, @ScriptDir, Default, 1) EndIf If @error Then Return SetError(@error, 0, 0) EndIf StdinWrite($pid, @AutoItPID) EndIf $__Restart = 1 If $fExit Then Sleep(50) Exit EndIf Return 1 EndFunc ;==>_ScriptRestart Func _GUICtrlMenu_CreateBitmap($file, $iIndex = 0, $iX = 16, $iY = 16) ;thanks to Yashied If FileExists($file) Then Local $aRet, $hIcon, $hBitmap Local $hDC, $hBackDC, $hBackSv $aRet = DllCall("shell32", "long", "ExtractAssociatedIcon", "int", 0, "str", $file, "word*", $iIndex) If @error Then Return SetError(@error, @extended, 0) $hIcon = $aRet[0] $hDC = _WinAPI_GetDC(0) ;thanks to Yashied $hBackDC = _WinAPI_CreateCompatibleDC($hDC) $hBitmap = _WinAPI_CreateSolidBitmap(0, _WinAPI_GetSysColor($COLOR_MENU), $iX, $iY) $hBackSv = _WinAPI_SelectObject($hBackDC, $hBitmap) _WinAPI_DrawIconEx($hBackDC, 0, 0, $hIcon, $iX, $iY, 0, 0, 3) _WinAPI_DestroyIcon($hIcon) _WinAPI_SelectObject($hBackDC, $hBackSv) _WinAPI_ReleaseDC(0, $hDC) _WinAPI_DeleteDC($hBackDC) Return $hBitmap Else Return SetError(1, 0, 0) EndIf EndFunc ;==>_GUICtrlMenu_CreateBitmap Func _GDIPlus_Convert2HBitmap($hBitmap, $iColor) ; removes alpha backround using system color and converts to gdi bitmap Local $iBgColor = _WinAPI_GetSysColor($iColor) $iBgColor = 0x10000 * BitAND($iBgColor, 0xFF) + BitAND($iBgColor, 0x00FF00) + BitShift($iBgColor, 16) Local $iWidth = _GDIPlus_ImageGetWidth($hBitmap), $iHeight = _GDIPlus_ImageGetHeight($hBitmap) Local $hBitmap_new = _GDIPlus_BitmapCreateFromScan0($iWidth, $iHeight) ;$aResult[6] Local $hCtx_new = _GDIPlus_ImageGetGraphicsContext($hBitmap_new) _GDIPlus_GraphicsSetPixelOffsetMode($hCtx_new, $GDIP_PIXELOFFSETMODE_HIGHQUALITY) Local $hBrush = _GDIPlus_BrushCreateSolid(0xFF000000 + $iBgColor) _GDIPlus_GraphicsFillRect($hCtx_new, 0, 0, $iWidth, $iHeight, $hBrush) _GDIPlus_GraphicsDrawImageRect($hCtx_new, $hBitmap, 0, 0, $iWidth, $iHeight) Local $hHBITMAP = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap_new) _GDIPlus_BrushDispose($hBrush) _GDIPlus_BitmapDispose($hBitmap_new) _GDIPlus_GraphicsDispose($hCtx_new) Return $hHBITMAP EndFunc ;==>_GDIPlus_Convert2HBitmap Func _Exit() $binSID = 0 For $i = 1 To $aFileList[0] _WinAPI_DestroyIcon($aFileIcons[$i]) Next _WinAPI_UnhookWindowsHookEx($hHook_Key) DllCallbackFree($iListViewCallback) GUIRegisterMsg($WM_SIZE, "") GUIRegisterMsg($WM_EXITSIZEMOVE, "") GUIRegisterMsg($WM_NOTIFY, "") GUIRegisterMsg($WM_COMMAND, "") GUIRegisterMsg($WM_SYSCOMMAND, "") GUIRegisterMsg($WM_DPICHANGED, "") _WinAPI_DeleteObject($hLV_Font) _WinAPI_DeleteObject($hBMP_Shield) _WinAPI_DeleteObject($hBMP_Sort) _WinAPI_DeleteObject($hBMP_OpenFolder) _WinAPI_DeleteObject($hBMP_Restart) _WinAPI_DeleteObject($hBMP_Rect) _WinAPI_DeleteObject($hBMP_Check) _WinAPI_DeleteObject($hBMP_About) _WinAPI_DeleteObject($hBMP_Exit) _GUIImageList_Destroy($hImageList) GUIDelete($hGUI) _GDIPlus_Shutdown() DllClose($_KERNEL32DLL) Exit EndFunc ;==>_Exit Func _GUICtrlListView_SetItemHeightByFont(ByRef $hListView, $iHeight, $fFontSize) ; Get font of ListView control ; Copied from _GUICtrlGetFont example by KaFu ; See https://www.autoitscript.com/forum/index.php?showtopic=124526 Local $hDC = _WinAPI_GetDC($hListView), $hFont = _SendMessage($hListView, $WM_GETFONT) Local $tagLOGFONT2 = "long lfHeight;long lfWidth;long lfEscapement;long lfOrientation;long lfWeight;byte lfItalic;byte lfUnderline;byte lfStrikeOut;byte lfCharSet;byte lfOutPrecision;byte lfClipPrecision;byte lfQuality;byte lfPitchAndFamily;wchar lfFaceName[32]" Local $hObject = _WinAPI_SelectObject($hDC, $hFont), $lvLOGFONT = DllStructCreate($tagLOGFONT2) _WinAPI_GetObject($hFont, DllStructGetSize($lvLOGFONT), DllStructGetPtr($lvLOGFONT)) $lvLOGFONT.lfQuality = $CLEARTYPE_QUALITY $lvLOGFONT.lfOutPrecision = $OUT_DEFAULT_PRECIS $lvLOGFONT.lfWeight = $FW_MEDIUM $lvLOGFONT.lfHeight = $fFontSize Local $hLVfont = _WinAPI_CreateFontIndirect($lvLOGFONT) ; Original ListView font _WinAPI_SelectObject($hDC, $hObject) _WinAPI_ReleaseDC($hListView, $hDC) _WinAPI_DeleteObject($hFont) ; Set height of ListView items by applying text font with suitable height $hFont = _WinAPI_CreateFont($iHeight, 0, 0, 0, $FW_MEDIUM, False, False, False, $DEFAULT_CHARSET, $OUT_DEFAULT_PRECIS, $CLIP_DEFAULT_PRECIS, $CLEARTYPE_QUALITY, 0, "Segoe UI") _WinAPI_SetFont($hListView, $hFont) _WinAPI_DeleteObject($hFont) ; Restore font of Header control Local $hHeader = _GUICtrlListView_GetHeader($hListView) If $hHeader Then _WinAPI_SetFont($hHeader, $hLVfont) ; Return original ListView font Return $hLVfont EndFunc ;==>_GUICtrlListView_SetItemHeightByFont Func WM_DPICHANGED($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $lParam Local $iDPI = _WinAPI_LoWord($wParam) ConsoleWrite("DPI change triggered! DPI: " & $iDPI & @CRLF) $g_iDPI_ratio1 = $iDPI / $iDPI_def $g_iDPI_ratio2 = $g_iDPI_ratio1 ^ - 1 $fIconSize = 16 * $g_iDPI_ratio1 $fLVFontSize = 15.5 * $g_iDPI_ratio1 AdjustLVIcons() PosGUI() Return 1 EndFunc ;==>WM_DPICHANGED Func WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $wParam Local $tNMHDR = DllStructCreate($tagNMHDR, $lParam), $tInfo Local Static $iHot = -1, $iHotPrev = -1 Switch HWnd($tNMHDR.hWndFrom) Case $hLV Switch $tNMHDR.Code Case $NM_CLICK ToolTip("") $tInfo = DllStructCreate($tagNMITEMACTIVATE, $lParam) If $tInfo.Index > -1 And $tInfo.Index < UBound($aIconAssignment) Then ConsoleWrite("Shell executing " & $aIconAssignment[$tInfo.Index][1] & @CRLF) _GUICtrlListView_SetItemSelected($hLV, $tInfo.Index, False, False) ;_GUICtrlListView_SetItemFocused($hLV, $tInfo.Index, False) GUISetState(@SW_MINIMIZE, $hGUI) ConsoleWrite("PID: " & ShellExecute(@WindowsDir & "\Explorer.exe", $aIconAssignment[$tInfo.Index][1]) & @CRLF) ;~ ConsoleWrite("PID: " & ShellExecute($aIconAssignment[$tInfo.Index][1]) & @CRLF) EndIf Case $NM_RCLICK ToolTip("") $tInfo = DllStructCreate($tagNMITEMACTIVATE, $lParam) If $tInfo.Index > -1 And $tInfo.Index < UBound($aIconAssignment) Then _GUICtrlListView_SetItemSelected($hLV, $tInfo.Index, False, False) $sRunAsAdmin = $aIconAssignment[$tInfo.Index][1] EndIf _GUICtrlMenu_TrackPopupMenu($hQMenu_LV, $hGUI) Case $NM_KILLFOCUS ToolTip("") GUISetState(@SW_MINIMIZE, $hGUI) Case $NM_CUSTOMDRAW Local $tNMLVCUSTOMDRAW = DllStructCreate($tagNMLVCUSTOMDRAW, $lParam) Local $dwDrawStage = $tNMLVCUSTOMDRAW.dwDrawStage Local $dwItemSpec = $tNMLVCUSTOMDRAW.dwItemSpec Switch $dwDrawStage Case $CDDS_PREPAINT Return $CDRF_NOTIFYITEMDRAW Case $CDDS_ITEMPREPAINT If $dwItemSpec = $iHot Then $tNMLVCUSTOMDRAW.ClrText = 0x000000 $tNMLVCUSTOMDRAW.ClrTextBk = 0x98FF98 Else ; Other rows $tNMLVCUSTOMDRAW.ClrText = 0x000000 $tNMLVCUSTOMDRAW.ClrTextBk = $iLVBgColor EndIf _WinAPI_SelectObject($tNMLVCUSTOMDRAW.hdc, $hLV_Font) Return $CDRF_NEWFONT EndSwitch Case $LVN_HOTTRACK If WinActive($hGUI) Then $tInfo = DllStructCreate($tagNMLISTVIEW, $lParam) $iHot = $tInfo.Item If $iHot <> $iHotPrev Then If $iHot <> -1 Then _GUICtrlListView_RedrawItems($hLV, $iHot, $iHot) If $iHotPrev <> -1 Then _GUICtrlListView_RedrawItems($hLV, $iHotPrev, $iHotPrev) If $iHot <> $iHotPrev And $iHot <> -1 Then $iHotPrev = $iHot EndIf ;check if listview text is shortened with "..." and display listview text in tooltip Local $sTxt = _GUICtrlListView_GetItemTextString($hLV, _GUICtrlListView_GetHotItem($hLV)) Local $hDC = _WinAPI_GetDC($hLV) Local $hFont = _SendMessage($hLV, $WM_GETFONT, 0, 0) Local $hFont_old = _WinAPI_SelectObject($hDC, $hFont) Local $tSize = _WinAPI_GetTextExtentPoint32($hDC, $sTxt) If Not @error Then Local $iTextWidth = $tSize.x * $g_iDPI_ratio1 Local $iColumnWidth = _GUICtrlListView_GetColumnWidth($hLV, $iHot) If $iTextWidth > $iColumnWidth Then $iColumnWidth -= 3 * _WinAPI_GetTextExtentPoint32($hDC, ".") If $iTextWidth >= $iColumnWidth Then ToolTip($sTxt, MouseGetPos(0) + 10, MouseGetPos(1) - 20, "", 0, 6) Else ToolTip("") EndIf Else ToolTip("") EndIf EndIf _WinAPI_SelectObject($hDC, $hFont_old) _WinAPI_ReleaseDC($hLV, $hDC) Return 0 EndIf EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_NOTIFY Func WM_SIZE($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $wParam Local $iW = _WinAPI_LoWord($lParam), $iH = _WinAPI_HiWord($lParam), $iH_SB = _GUICtrlStatusBar_GetHeight($hStatusBar) ControlMove($hGUI, "", $iStatusBar, 0, $iH - $iH_SB, $iW, $iH_SB) ControlMove($hGUI, "", $iLV, 0, 0, $iW, $iH - $iH_SB - 1) Return $GUI_RUNDEFMSG EndFunc ;==>WM_SIZE Func WM_EXITSIZEMOVE($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $wParam, $lParam $bManualResized = True Return $GUI_RUNDEFMSG EndFunc ;==>WM_EXITSIZEMOVE Func WM_COMMAND($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $lParam Switch $wParam Case $idRunAsAdmin ConsoleWrite("Shell executing as Administrator" & $sRunAsAdmin & @CRLF) ConsoleWrite("PID: " & ShellExecute($sRunAsAdmin, "", @DesktopDir, "runas") & @CRLF) Case $idSort Static $a[1] = [0], $iDir = 1 $a[0] = ($iDir = 1 ? 0 : 1) _ArraySort($aIconAssignment, $a[0], 0, 0, 1) Local $i _GUICtrlListView_BeginUpdate($hLV) For $i = 0 To UBound($aIconAssignment) - 1 _GUICtrlListView_SetItemImage($hLV, $i, $aIconAssignment[$i][0]) _GUICtrlListView_SetItemText($hLV, $i, StringRegExpReplace($aIconAssignment[$i][1], ".+\\(.+)\..+", "$1")) Next _GUICtrlListView_EndUpdate($hLV) $iDir *= -1 $bSorted = 1 Case $idOpenFL Local $sFullPath = $oShell.CreateShortcut($sRunAsAdmin).TargetPath If $sFullPath = "" Then Return 0 Local $sFolder = StringRegExpReplace($sFullPath, "(.+\\).*", "$1") If $sFolder Then ShellExecute("Explorer.exe", "/e, /n, " & $sFolder, $sFolder) Return 1 EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_COMMAND Func WM_SYSCOMMAND($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $lParam Switch BitAND($wParam, 0x0000FFFF) Case $idAbout GUICtrlSendToDummy($iDummy_About) Return 0 Case $SC_RESTORE If @OSBuild > 9599 Then Local $tPos = _WinAPI_GetMousePos() Local $hMontitor = _WinAPI_MonitorFromPoint($tPos) Local $iDPI = _WinAPI_GetDpiForPrimaryMonitor($hMontitor) $g_iDPI_ratio1 = $iDPI / $iDPI_def $g_iDPI_ratio2 = $g_iDPI_ratio1 ^ - 1 $fIconSize = 16 * $g_iDPI_ratio1 $fLVFontSize = 15.5 * $g_iDPI_ratio1 EndIf WinSetTrans($hGUI, "", 0) GUISetState(@SW_RESTORE, $hGUI) If $aFileList[0] Then AdjustLVIcons() PosGUI() WinSetTrans($hGUI, "", 255) Else GUICtrlSendToDummy($iDummy_Error) EndIf Return 0 Case $SC_MINIMIZE ToolTip("") EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_SYSCOMMAND Func LVKeyCallback($nCode, $wParam, $lParam) If $nCode < 0 Then Return _WinAPI_CallNextHookEx($hHook_Key, $nCode, $wParam, $lParam) Switch $wParam Case $WM_KEYDOWN, $WM_SYSKEYDOWN ;prevent keyboard access in listview Local $tKEYHOOKS = DllStructCreate($tagKBDLLHOOKSTRUCT, $lParam) Switch $tKEYHOOKS.vkCode Case $VK_LEFT, $VK_Right, $VK_UP, $VK_DOWN If WinActive($hGUI) Then Return 1 EndSwitch EndSwitch Return _WinAPI_CallNextHookEx($hHook_Key, $nCode, $wParam, $lParam) EndFunc ;==>LVKeyCallback Func ErrFunc() Local Static $iEventError = 0 $iEventError += 1 ; Use to check when a COM Error occurs Local Const $sText_Error = _ (@ScriptName & " : ==> COM Error intercepted !" & @CRLF & _ "Error count is: " & @TAB & $iEventError & @CRLF & _ "Number is: " & @TAB & @TAB & "0x" & Hex($oMyError.number) & @CRLF & _ "WinDescription:" & @TAB & @TAB & $oMyError.windescription & _ "Description is: " & @TAB & $oMyError.description & @CRLF & _ "Source is: " & @TAB & @TAB & $oMyError.source & @CRLF & _ "ScriptLine is: " & @TAB & @TAB & $oMyError.scriptline & @CRLF & _ "RetCode is: " & @TAB & @TAB & "0x" & Hex($oMyError.retcode) & @CRLF & @CRLF) ConsoleWrite($sText_Error) EndFunc ;==>ErrFunc Func _GDIPlus_MeasureString($sString, $sFont = "Arial", $fSize = 12, $iStyle = 0, $bRound = True) Local $aSize[2] Local Const $hFamily = _GDIPlus_FontFamilyCreate($sFont) If Not $hFamily Then Return SetError(1, 0, $aSize) Local Const $hFormat = _GDIPlus_StringFormatCreate() Local Const $hFont = _GDIPlus_FontCreate($hFamily, $fSize, $iStyle) Local Const $tLayout = _GDIPlus_RectFCreate(0, 0, 0, 0) Local Const $hGraphic = _GDIPlus_GraphicsCreateFromHWND(0) Local $aInfo = _GDIPlus_GraphicsMeasureString($hGraphic, $sString, $hFont, $tLayout, $hFormat) $aSize[0] = $bRound ? Round($aInfo[0].Width, 0) : $aInfo[0].Width $aSize[1] = $bRound ? Round($aInfo[0].Height, 0) : $aInfo[0].Height _GDIPlus_FontDispose($hFont) _GDIPlus_FontFamilyDispose($hFamily) _GDIPlus_StringFormatDispose($hFormat) _GDIPlus_GraphicsDispose($hGraphic) Return $aSize EndFunc ;==>_GDIPlus_MeasureString ;by InnI - https://www.autoitscript.com/forum/topic/200541-solved-taskbar-icons-coordinates/?do=findComment&comment=1521328 Func _WinAPI_FindMyIconPosInTaskbar($sFileDescription) ; Search taskbars Local $ahWnd = WinList("[REGEXPCLASS:Shell_(Secondary)?TrayWnd]") ; Search controls Local $ahCtrl[$ahWnd[0][0]][2] For $i = 1 To $ahWnd[0][0] $ahCtrl[$i - 1][0] = ControlGetHandle($ahWnd[$i][1], "", "MSTaskListWClass1") $ahCtrl[$i - 1][1] = WinGetPos($ahWnd[$i][1]) Next ; Get UIAutomation object Local $oUIAutomation = ObjCreateInterface($sCLSID_CUIAutomation, $sIID_IUIAutomation, $dtagIUIAutomation), $oElement, $oCondition, $oElementArray, $oButton If Not IsObj($oUIAutomation) Then Return SetError(1, 0, 0) ;Exit ConsoleWrite("Error create UIA object" & @CRLF) ; Create 2D array of buttons [name,left,top,right,bottom] Local $aBtnInfo[4], $pElement, $pCondition, $pElementArray, $iButtons, $vValue, $tPos, $hMOnitor, $aMonitorPos $tPos = _WinAPI_GetMousePos() $hMOnitor = _WinAPI_MonitorFromPoint($tPos) If @error Or Not $hMOnitor Then Return SetError(2, 0, 0) $aMonitorPos = _WinAPI_GetMonitorInfo($hMOnitor) If @error Or Not $hMOnitor Then Return SetError(3, 0, 0) $iMonitorX = $aMonitorPos[1].left $iMonitorY = $aMonitorPos[1].top $iMonitorW = Abs($aMonitorPos[1].right - $aMonitorPos[1].left) $iMonitorH = Abs($aMonitorPos[1].bottom - $aMonitorPos[1].top) Local $tRECT = DllStructCreate("long Left;long Top;long Right;long Bottom"), $tPOINT = DllStructCreate($tagPOINT) For $n = 0 To UBound($ahCtrl) - 1 ; Get taskbar element $oUIAutomation.ElementFromHandle($ahCtrl[$n][0], $pElement) $oElement = ObjCreateInterface($pElement, $sIID_IUIAutomationElement, $dtagIUIAutomationElement) ; Get condition (ControlType = Button) $oUIAutomation.CreatePropertyCondition($UIA_ControlTypePropertyId, $UIA_ButtonControlTypeId, $pCondition) $oCondition = ObjCreateInterface($pCondition, $sIID_IUIAutomationPropertyCondition, $dtagIUIAutomationPropertyCondition) ; Find all buttons $oElement.FindAll($TreeScope_Children, $oCondition, $pElementArray) $oElementArray = ObjCreateInterface($pElementArray, $sIID_IUIAutomationElementArray, $dtagIUIAutomationElementArray) $oElementArray.Length($iButtons) ; Get name and position for each button For $i = 0 To $iButtons - 1 $oElementArray.GetElement($i, $pElement) $oButton = ObjCreateInterface($pElement, $sIID_IUIAutomationElement, $dtagIUIAutomationElement) $oButton.GetCurrentPropertyValue($UIA_NamePropertyId, $vValue) $oButton.CurrentBoundingRectangle($tRECT) If StringInStr($vValue, $sFileDescription) Then $aBtnInfo[0] = $tRECT.Left $aBtnInfo[1] = $tRECT.Top $aBtnInfo[2] = Abs($tRECT.Right - $tRECT.Left) $aBtnInfo[3] = Abs($tRECT.Bottom - $tRECT.Top) $tPOINT.x = $tRECT.Left $tPOINT.y = $tRECT.Top If _WinAPI_PtInRect($aMonitorPos[0], $tPOINT) Then Return $aBtnInfo EndIf Next Next Return SetError(4, 0, 0) EndFunc ;==>_WinAPI_FindMyIconPosInTaskbar Func _WinAPI_Base64Decode($sB64String) Local $aCrypt = DllCall("Crypt32.dll", "bool", "CryptStringToBinaryA", "str", $sB64String, "dword", 0, "dword", 1, "ptr", 0, "dword*", 0, "ptr", 0, "ptr", 0) If @error Or Not $aCrypt[0] Then Return SetError(1, 0, "") Local $bBuffer = DllStructCreate("byte[" & $aCrypt[5] & "]") $aCrypt = DllCall("Crypt32.dll", "bool", "CryptStringToBinaryA", "str", $sB64String, "dword", 0, "dword", 1, "struct*", $bBuffer, "dword*", $aCrypt[5], "ptr", 0, "ptr", 0) If @error Or Not $aCrypt[0] Then Return SetError(2, 0, "") Return DllStructGetData($bBuffer, 1) EndFunc ;==>_WinAPI_Base64Decode Func _WinAPI_LZNTDecompress(ByRef $tInput, ByRef $tOutput, $iBufferSize) $tOutput = DllStructCreate("byte[" & $iBufferSize & "]") If @error Then Return SetError(1, 0, 0) Local $aRet = DllCall("ntdll.dll", "uint", "RtlDecompressBuffer", "ushort", 0x0002, "struct*", $tOutput, "ulong", $iBufferSize, "struct*", $tInput, "ulong", DllStructGetSize($tInput), "ulong*", 0) If @error Then Return SetError(2, 0, 0) If $aRet[0] Then Return SetError(3, $aRet[0], 0) Return $aRet[6] EndFunc ;==>_WinAPI_LZNTDecompress Func _WinAPI_GetDPI($hWnd = 0) $hWnd = Not $hWnd ? _WinAPI_GetDesktopWindow() : $hWnd Local Const $hDC = _WinAPI_GetDC($hWnd) If @error Then Return SetError(1, 0, 0) Local Const $iDPI = _WinAPI_GetDeviceCaps($hDC, 88) If @error Or Not $iDPI Then _WinAPI_ReleaseDC($hWnd, $hDC) Return SetError(2, 0, 0) EndIf _WinAPI_ReleaseDC($hWnd, $hDC) Return $iDPI EndFunc ;==>_WinAPI_GetDPI ;https://learn.microsoft.com/en-us/windows/win32/api/shellscalingapi/nf-shellscalingapi-getdpiformonitor Func _WinAPI_GetDpiForPrimaryMonitor($hMOnitor = 0, $dpiType = $MDT_DEFAULT) If $hMOnitor = 0 Then Local $aMonitors = _WinAPI_EnumDisplayMonitors() If @error Or Not IsArray($aMonitors) Then Return SetError(1, 0, 0) Local $i For $i = 1 To $aMonitors[0][0] If _WinAPI_GetMonitorInfo($aMonitors[$i][0])[2] = 1 Then $hMOnitor = $aMonitors[$i][0] ExitLoop EndIf Next EndIf Local $tx = DllStructCreate("int dpiX"), $tY = DllStructCreate("int dpiY") Local $aResult = DllCall("Shcore.dll", "long", "GetDpiForMonitor", "handle", $hMOnitor, "long", $dpiType, "struct*", $tx, "struct*", $tY) If @error Or Not IsArray($aResult) Then Return SetError(2, 0, 0) Return $tx.dpiX EndFunc ;==>_WinAPI_GetDpiForPrimaryMonitor Func _WinAPI_SetProcessDpiAwarenessContext($DPI_AWARENESS_CONTEXT_value) Local $aResult = DllCall("user32.dll", "bool", "SetProcessDpiAwarenessContext", @AutoItX64 ? "int64" : "int", $DPI_AWARENESS_CONTEXT_value) If Not IsArray($aResult) Or @error Then Return SetError(1, @extended, 0) If Not $aResult[0] Then Return SetError(2, @extended, 0) Return $aResult[0] EndFunc ;==>_WinAPI_SetProcessDpiAwarenessContext Func _WinAPI_SetThreadDpiAwarenessContext($DPI_AWARENESS_CONTEXT_value) Local $aResult = DllCall("user32.dll", "uint", "SetThreadDpiAwarenessContext", @AutoItX64 ? "int64" : "int", $DPI_AWARENESS_CONTEXT_value) If Not IsArray($aResult) Or @error Then Return SetError(1, @extended, 0) If Not $aResult[0] Then Return SetError(2, @extended, 0) Return $aResult[0] EndFunc ;==>_WinAPI_SetThreadDpiAwarenessContext Func _WinAPI_SetProcessDpiAwareness($PROCESS_DPI_AWARENESS = $DPI_AWARENESS_PER_MONITOR_AWARE) Local $aResult = DllCall("Shcore.dll", "long", "SetProcessDpiAwareness", "int", $PROCESS_DPI_AWARENESS) If Not IsArray($aResult) Or @error Then Return SetError(1, @extended, 0) If $aResult[0] Then Return SetError(2, $aResult[0], 0) Return $aResult[0] EndFunc ;==>_WinAPI_SetProcessDpiAwareness Func _WinAPI_SetDPIAwareness($DPIAwareContext = $DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE, $iMode = 1) Switch @OSBuild Case 6000 To 9199 Local $aResult = DllCall("user32.dll", "bool", "SetProcessDPIAware") If Not $aResult[0] Then Return SetError(1, 0, 0) Case 9200 To 13999 $DPIAwareContext = ($DPIAwareContext < 0) ? 0 : ($DPIAwareContext > 2) ? 2 : $DPIAwareContext _WinAPI_SetProcessDpiAwareness($DPIAwareContext) If @error Then Return SetError(2, @error, 0) Case @OSBuild > 13999 $DPIAwareContext = ($DPIAwareContext < -5) ? -5 : ($DPIAwareContext > -1) ? -1 : $DPIAwareContext $iMode = ($iMode < 1) ? 1 : ($iMode > 2) ? 2 : $iMode Local $iResult Switch $iMode Case 1 $iResult = _WinAPI_SetProcessDpiAwarenessContext($DPIAwareContext) If Not $iResult Or @error Then Return SetError(3, 0, 0) Case 2 $iResult = _WinAPI_SetThreadDpiAwarenessContext($DPIAwareContext) If Not $iResult Or @error Then Return SetError(4, 0, 0) EndSwitch EndSwitch Local $iDPI If @OSBuild < 9200 Then $iDPI = _WinAPI_GetDPI() If @error Or Not $iDPI Then Return SetError(5, 0, 0) Else $iDPI = _WinAPI_GetDpiForPrimaryMonitor() If @error Or Not $iDPI Then Return SetError(6, 0, 0) EndIf Return $iDPI EndFunc ;==>_WinAPI_SetDPIAwareness #Region Embedded Gfx Func _Info_Pic($bSaveBinary = False, $sSavePath = @ScriptDir) Local $Info_Pic $Info_Pic &= 'iVBORw0KGgoAAAANSUhEUgAAAEQAAABECAYAAAA4E5OyAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3goVCzU6of+cFgAAAB1pVFh0Q29tbWVudAAAAAAAQ3JlYXRlZCB3aXRoIEdJTVBkLmUHAAAQNEl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qb/s6/Oc6GB37Hx79CNevfZ++vRSnzpxdI9dsXLNKmb8GwtNFmARkT5BQOEm60zwxR/APAAegHPXdSIihOD7LFpEJKOCEu07KVdt27Hj1//ypWUbdOfeX9r25feCCNjX8T4A4P8AfQxoGhUQAVAAAAAASUVORK5CYII=' Local $bString = Binary(_WinAPI_Base64Decode($Info_Pic)) If $bSaveBinary Then Local $hFile = FileOpen($sSavePath & "\Info_68x68.png", 18) FileWrite($hFile, $bString) FileClose($hFile) EndIf Return $bString EndFunc ;==>_Info_Pic Func _Error_Pic($bSaveBinary = False, $sSavePath = @ScriptDir) Local $Error_Pic $Error_Pic &= 'iVBORw0KGgoAAAANSUhEUgAAAEQAAABECAYAAAA4E5OyAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3goUEicBw0v6ewAAAB1pVFh0Q29tbWVudAAAAAAAQ3JlYXRlZCB3aXRoIEdJTVBkLmUHAAAO3UlEQVR42t1bbWgc1fr/zfvM7mazu2naRKOJrRWrV+7fYtCrQYpWyAerpvpBqqKorVqQeivoh6JirxZUhFZB2hi1FOUK+oeCfigILUJBaJXyb1GsDTGJabJp3ST7vvP+/3Bz5p49Oy+bTeuHDgw7s3PmnPP8npfzPM95Bq7rAgCCfq/kw3VdPPLII3X3HADouo5cLsd1d3dr2Wx27Y8//rjZtu3/qdVqf3NdVxAEARzHged5bvEXHMdxi78N92xbAKCfAeCY+7pJua4Lx3EWb+vu4TgOua975rquSz1j713XdWHbNgA4siz/n2VZP952223/u3r16vFsNqun02lXVVVwlmVhYWGB6+joyExNTb2g6/o/OY7LVCoVLCws2LVazRUEwSOKviYEk5MCw2tHt2ffIe0JKIRAQhRNIAFkkSjYtu09p9vQ79DtyLWiKFw8Hhc0TYNpmhclSdqzbt26z+bm5godHR0utziR2NTU1M5kMvkvAE6lUuFLpRLy+TxyuRwA0JIASmI8zpL/6HbkOU04KxV+gLDSQp+MlHj/E6Do57Zt17UDgGQyiba2NqiqCkVRHAB8qVT654033rj/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p6dvf19f371ltvLa5fv94VAeDixYvuCy+8UHz33XcP9vX1HZ2YmNg0Nzf3D57nb5YkSVgGAJGENSscy5UeSkpsURR/TqVSP1xzzTXfJBKJyUQiYRw/fvw/HezYsaMu6XI5Dtd1ucUTLZ6c67qXZUuQrq/dsWMH/h9l1MgBujE/MAAAAABJRU5ErkJggg==' Local $bString = Binary(_WinAPI_Base64Decode($Error_Pic)) If $bSaveBinary Then Local $hFile = FileOpen($sSavePath & "\Status-dialog-error-icon_68x68.png", 18) FileWrite($hFile, $bString) FileClose($hFile) EndIf Return $bString EndFunc ;==>_Error_Pic Func _OK_Pic($bSaveBinary = False, $sSavePath = @ScriptDir) Local $OK_Pic $OK_Pic &= 'iVBORw0KGgoAAAANSUhEUgAAAEQAAABECAQAAACSGls5AAAAAmJLR0QA/4ePzL8AAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAHdElNRQfeChULJBFemkZGAAAH5UlEQVRo3r2aS2wdZxXHf9/M3BsrTi52Yqd5uHUTb6rSEkSDhNgEFYlKIAELSiVUrgoLiihtJSQQGxYskFggQEGUiocQtyxoF6xAouElQELqoi0oVH0Qx7KbBiVuXL+d2HfOYeG5M99r7jV26Vhy5uVv/t85//P/zjlfDLRNR9v3cz9TvNNHl3/zVOfZdkpu2oYG19ivqZp3HIgaNcrznQ+0MdBeZTjnJHfgI9Gac/eO/a/9lrGu1PvdO3uVeVD+1jlr2l/ie93mp7iLrRoQGoGhERja57kWo/hjNbjAH8ngbMbntXGGO7lZA0MiltgpCJzPa8TKXaZ4hXmRJzPuFnMPm6VbNDpgHQQXqEbsqOU7IVhFUY5xFU5kNKGJeh4NGSEDbCUBH+J28O8rKYpJM0pkg0DUAdWAuGqN6NtBPbpKcZbF2Pz/4YPrJP9rGSWyQc7wbeU7QxzTE3WGBmN7FlFHQ2SAQuw0OLdHqoPgWi3bqz5g8d+XMMFYto7xsOJStns+2PN1Cbh9N2GDZYQW+8kD26pH6sxlSJ0++HEh0WhywV1iBVDmGeb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cU8UAAAAASUVORK5CYII=' Local $bString = Binary(_WinAPI_Base64Decode($OK_Pic)) If $bSaveBinary Then Local $hFile = FileOpen($sSavePath & "\OK-button-icon_68x68.png", 18) FileWrite($hFile, $bString) FileClose($hFile) EndIf Return $bString EndFunc ;==>_OK_Pic Func _Sort($bSaveBinary = False, $sSavePath = @ScriptDir) Local $Sort $Sort &= 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAADAFBMVEVHcEwAAQIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAgQAAQIAAAAERo4AAAAAAAAERo4AAAAAAQMAAAAABg0AAAABBQkAAAAAAAAAAAAUV6QUV6QQU6AkabwJTJYBM2sXWqkjaLsjaLv////39/fx8fH29vb09PT19fX7+/vy8vLz8/Pw8PD6+vr4+Pj5+fn8/Pzv7+/h4+b9/f3i5Oeurq7FzdXX2+C9xdDj5uiQlJnIztbFzNXc3+S9xc/Z3OHBydLX3OHCytO7w868w8+Ul5uPk5jV2t7W2t+RlZnd4eTO09rDy9Tm5+qvr6+/yNHg4ube4eWSlprk5+nAyNLEzNTc3+PJz9ff4eTN0tqSlZmtra2wsLDL0djK0Nfg4+e/yNLb3uLa3eLa3uHHzdbK0NjU2N7T2N3P1NvQ1dvZ3eEOUZ2/x9DL0dkMUJvJz9aVvO/b3+Sav/Hn6evR1twGSZIER4+dwvMLTpjd4OMkar0JTJcVWqgbYLAXXKvS19wCRIwTWKUQVKDBytO4wcyjxfUgZbesrKwSVqK8xM8eZLXIz9e8xdAiZ7odYrOgxPSnyvcjabwZXq6Tu+6VmJyXu+LM0tnAydIIS5RnnNvIzteszPl4qOLK3velyPZxpOBgmNhMi9BsoN2OkpeJsd2vz/qGsul8qdujxfBTj9KXvfB4p9uvy+eXvvCiwuWmxOWRtt+Ltesxa6mbveKBr+aQuOx9q+R0pNlcldbb3uMobLyKqs5XktRBda4tarCqyOaNtN6Fr9wra7SArNtwodiev+Oz0fx2nMcva60pa7lFd62UueF9ocoyc8CCrd21zugWVZoPUpw1bavp6uzL0Ni6ws200O671vo7eMBqlcZgjsMVU5eDpcuHqM1WiMLb6f3s7fAxZ6JDfcDL2u3H3f1KgcC81fMZ' $Sort &= 'WZ+70Oiryu/E2vbK0dmbv+qz0PWPrc9QhL7C1evU5fyLtOfQ4vk6bqXh7f+kvNiqqqrW4e4kYaNllc5YowvFAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfnBwcWAAT3pH7oAAAAwUlEQVQY02NgMDE2MdIDAiMggwEEdNLTov2BIDotvRIiEJOY6AxEt5ITd1wAC6RFO4FUOHWunDLlM0jAQNcYaIiR8ZmLx46d+cLAoGuQF+Rzw8cnSNvg/n2QFt1op7AUS8uUMKfoV8/BAskQQ52Tkl+9AgsAbQ0LDQ0D2vv4MVjAQNtYz8JCzxhuBszQe2cuX753Hmjtvmj/0JSUUH/Pz1OmHEBxaefvrRCXgp3qFJ2W5gL2i7autrEJEBgDGQxYAADHkkynWLow7gAAAABJRU5ErkJggg==' Local $bString = _WinAPI_Base64Decode($Sort) If @error Then Return SetError(1, 0, 0) $bString = Binary($bString) If $bSaveBinary Then Local Const $hFile = FileOpen($sSavePath & "\Sort_16x16.png", 18) If @error Then Return SetError(2, 0, $bString) FileWrite($hFile, $bString) FileClose($hFile) EndIf Return $bString EndFunc ;==>_Sort ;Code below was generated by: 'File to Base64 String' Code Generator v1.20 Build 2020-06-05 Func _OpenFolder($bSaveBinary = False, $sSavePath = @ScriptDir) Local $OpenFolder $OpenFolder &= 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAB0VBMVEV4xhJ9zAZ/1gCA1gCK1wCM2gCNylqUz1yW2jea3TOn4lSw5G+854O+y9vFz9zJz8DOzsXR2eTR2uTTz8XUqIXUxZjUz8bU0MfU8LPVmmDW0cjXxZPX0snY3N/Y7MjZ1MvZ8b3akz/asova1c3b8r7dngDdoAbdpADdpAbd2dLd9MLepAbepQze2tLe9MTfpQ/fzaDg4uPh4+Th8dri7fjjkiLj9czkuHTk06jk5Obk9s/nqADn99TorxbotDbprxTprxbprxzpsBzpsB7psSPpsiXpsy3pszLp9d7qsR7qsy3qy47q38/q7PrrsBjrtC3rtC/rukbry43stzns18Ts6+rttS3ttzntuT7t27nt7Onutzbuu0Xuu0buvEjux2ju5N7wu0Hwu0XwxmXxuzfxvDrxvUrxvlHxy3vx++Xy8/PzvDbzvTrzyXLz59Dz6Nzz8/P0wk70x1/0yGT01JP1yGb2z3L20H325tf29/X347v35ND39/f43cD47eP5+fn68en6+vj6/Pf78uD7/vf88t388t/8/Pz8/vr98+H9+vj9/vv+9+z++fD+/Pr+/fr+/fv+/vz+/v3+/v7+//7+/////Pj//v3//v7///7///8fdIuRAAAACXBIWXMAABcSAAAXEgFnn9JSAAAA6UlEQVQYV2OYBQSTQITWrJkgigGIZ87qttIz48qcNQUiMGWWDScTMysLd8fkmRCBFhUFCR4ORgaPGRNnAAWmzwCpnMXOZjwVZkZ9QWVjk9ysaW2drT2zGPpq87OijGQNffPKikuLytsYqk1DTIT4BHkFktPS05NyexkqFBP4RQ0spOMTY2PiwkpmMdRJ+hRmp6bkRAeHh0f4Vc1kaBDxtnd383IL8Pf3D/BsnsXQpWTn5OoCBq62gf1Aa82tHR0gwNk6Y9YEhslBqvra6iCgoaMW2T6BoT1U' $OpenFolder &= 'V1lGXFhYWExKXtOyBuxSFAAAdgZiD4/tcMUAAAAASUVORK5CYII=' Local $bString = _WinAPI_Base64Decode($OpenFolder) If @error Then Return SetError(1, 0, 0) $bString = Binary($bString) If $bSaveBinary Then Local Const $hFile = FileOpen($sSavePath & "\Open-file_16x16.png", 18) If @error Then Return SetError(2, 0, $bString) FileWrite($hFile, $bString) FileClose($hFile) EndIf Return $bString EndFunc ;==>_OpenFolder Func _Restart_Pic($bSaveBinary = False, $sSavePath = @ScriptDir) Local $Restart_Pic $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/DwAPAE8GDwAPAA8ADwAPAP9PBg8ADwAPAA8ADwBPBg8A/w8ADwAPAE8GDwAPAA8ADwD/DwBPBg8ADwAPAA8ATwYvAR8PAA8ADwAPAAIAKrI6IAEACgJQXACtyQo8AD94cGFja2V0ACBlbmQ9InciAD8+Bg1a+gAAAAAGYktHRAD/IUEAoL2nk0AECXCASFlzAAALE8EAIAEAmpwYAAUHdABJTUUH5wcMCwA2MwX6/bAAAAABgUlEQVQ4ywCt1bFL1VEUBwDwz/u9Z2i9NgC3CBIkkIKGpgBIUIkaFUyHQgAIGtrEpc3VoQCtoH/AKSTy2QDiEkRLeziEQwBQlG5uoibUqwCW8+Byu+/5BAC/8IP7+55zzwDvd+79nnNqygAYxBzuooGD4AAvoI13WMexPgAwjw1Mo16w1wDDth4f7YnnWADUPxZjT9dgEwBOj4k0aD1J8wAXXnfZdB4D4QCT4zuu4jK2OwAX0EocBnAzngDh4B7hYayHMQBUCNzCYBUHuwCaGIZwCx8wGwBcDVWsL4V/HgB0FferkMZmYgDYx0WsdEl/CwAvsZzxm7jXCACdtTPjDTwO3QCV8BFPMq6NegCViLaDkTjoIwDs9bjdbVzLuADDRp/SeI+//QA4Vmhm3DdcyQC4Hexm3Bg+ZwBcs8LvQol9wgCdHj9yGz8KJQDZhoWozRTn8AAWU4Vg41gryABmBgu1EParRABzadCnuI4v+ACDUXzFM/zM/AA38KDzMndCUwAYjfLqhqUo3wAzaQ6TeHFW7QBrqVewNP3WCQANdibO7L80awCnHAHNZAS8KQCNgH8IK0cZ5giggq3A' $Restart_Pic &= 'ZwBJRU4ARK5CYII=' $Restart_Pic = _WinAPI_Base64Decode($Restart_Pic) If @error Then Return SetError(1, 0, 0) Local $tSource = DllStructCreate('byte[' & BinaryLen($Restart_Pic) & ']') DllStructSetData($tSource, 1, $Restart_Pic) Local $tDecompress _WinAPI_LZNTDecompress($tSource, $tDecompress, 5125) If @error Then Return SetError(3, 0, 0) $tSource = 0 Local Const $bString = Binary(DllStructGetData($tDecompress, 1)) If $bSaveBinary Then Local Const $hFile = FileOpen($sSavePath & "\Restart_20x20.png", 18) If @error Then Return SetError(2, 0, $bString) FileWrite($hFile, $bString) FileClose($hFile) EndIf Return $bString EndFunc ;==>_Restart_Pic Func _Rect_Pic($bSaveBinary = False, $sSavePath = @ScriptDir) Local $Rect_Pic $Rect_Pic &= 'iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAABhGlDQ1BJQ0MgcHJvZmlsZQAAKJF9kT1Iw0AcxV9TpSItDnYQcchQXbQgKuIorVgEC6Wt0KqDyaVf0KQhSXFxFFwLDn4sVh1cnHV1cBUEwQ8QVxcnRRcp8X9JoUWMB8f9eHfvcfcOEJpVppo9k4CqWUY6ERNz+VUx8IoAQghiHD6JmXoys5iF5/i6h4+vd1Ge5X3uzxFSCiYDfCLxPNMNi3iDeHbT0jnvE4dZWVKIz4knDLog8SPXZZffOJccFnhm2Mim48RhYrHUxXIXs7KhEs8QRxRVo3wh57LCeYuzWq2z9j35C4MFbSXDdZojSGAJSaQgQkYdFVRhIUqrRoqJNO3HPPzDjj9FLplcFTByLKAGFZLjB/+D392axekpNykYA3pfbPtjFAjsAq2GbX8f23brBPA/A1dax19rAnOfpDc6WuQIGNgGLq47mrwHXO4AQ0+6ZEiO5KcpFIvA+xl9Ux4YvAX619ze2vs4fQCy1NXyDXBwCIyVKHvd49193b39e6bd3w9P7XKZpWdougAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB+cHDQ0AILRpNswAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAfElEQVQ4y+3UMQoCQQyF4U+ZO9iKeBIbD6WV19iTeBWLcdu9xGqTBVELnZlyHoRAAj8hIY/GWkXe4IJ9IeeOE6alMOBRGQOkAO4iHzH+Od0W14WR3pojbjU7XLc+Sgd2YAf+ovTl0RWYwwcw4xCuUar8CjxjrjDYHIz2egIcTx4/Oi5K+wAAAABJRU5ErkJggg==' Local $bString = _WinAPI_Base64Decode($Rect_Pic) If @error Then Return SetError(1, 0, 0) $bString = Binary($bString) If $bSaveBinary Then Local Const $hFile = FileOpen($sSavePath & "\Rect_20x20.png", 18) If @error Then Return SetError(2, 0, $bString) FileWrite($hFile, $bString) FileClose($hFile) EndIf Return $bString EndFunc ;==>_Rect_Pic Func _Check_Pic($bSaveBinary = False, $sSavePath = @ScriptDir) Local $Check_Pic $Check_Pic &= 'lbkAiVBORw0KGgoAAAAADUlIRFIlAHAUARgIBgAojYkAHQ0AAALyelQAWHRSYXcgcHIAb2ZpbGUgdHkAcGUgZXhpZgAAAHja7ZdBkuQAKAxF95xijmAASQiJ42AwEX0Agzn+fGGnpyoAK3uRM6uOSAgAAxb4I/SArEoAx9+/ZvoLiaoAl5TVvNRSNqQAXHPlhoZvZ2oAq6Qtr/J8yVcAH323p7uDYRIA1HK+ernGP+wAdAucVUNLvwgAeb869u8d9ZoAgP1J6JpIwiMARmNcQvUSEj4AOx4etnNZW6kAbl+XsB9nfX0Af4YBT4pCbGkA3yLP79kQvaEAMArzISQbShEAPh2QeCRJQ8MAUFL0oNRl2VAAqtDlCQLyKk4Ad6rwaIar+eUAoG9U7ha9tqcAZ1qZryHyFOQActcv7Yn0NZUAFfovM2e/WvwA3W5ySqXtKfoA8cw5fK41YxUALReEulyLeiwAZbUwbscUMbUAJ+iVzfAoJGwA5Yrs2NUd1MYA1rcduVMlBq4ASZkGNZp0rLoAU4eLmY/EhgYAc2dZRhfjyl0Agl+OTJNNqgwAcUDuC3sWvn0AoTVt3XpaszkAZh6EoUwQI3wA8nZO734wZxwABaLN71jBL+YACDbcCHJRYhgAiNC8gqorwI8A/JyCq4CgRpQA44hUBHY/JXYApX9vAlmgBQMAFfV5XMjGJYAAEGFqhTMkIAAAajgVVGgzZiMAQiAdgBpcZ8kAvIMAqfKAk5wARQrYOMfU+MQAaA1lZZgT7LgAzEBCpeDMOQgANcDKWbF/LDsA9l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BlNmJmWwRzb2aAdHdhcmVBZ3AUp7ASUCmyEiAopBop+wIYd2hlcRhAEC0wN6ItRxAzIi/EDi/Z' $Check_Pic &= 'Dv48kTb7EAMCKEaRSzIBoEv9kFAvplD0Eg8ADwAPAA8A/w8AAgBPBg8ADwAPAA8ATwb/DwAPAA8ADwAPAE8GDwAPAP8PAA8ATwYPAA8ADwAPAA8A/08GDwAPAA8ADwAPAE8GDwD/DwAPAA8ATwYPAA8ADwAPAP8PAE8GDwAPAA8ADwBPBg8A/w8ADwAPAA8ATwYPAA8ADwD/DwAPAE8GDwAPAA8ADwBPBv8PAA8ADwAPAA8ATwYPAA8A/w8ADwBPBi8BDwAPAA8ADwABAwCssTogAAAKAUBdAK3JCjwAP3hwYWNrZXQAIGVuZD0idyIAPz4l53wHAAAAAAZiS0dEAP8hQQCgvaeTQAQJcIBIWXMAAAsTwQAgAQCanBgABQd0AElNRQfnBw0NAAA12bTSJwAAAAERSURBVDjLALXUvUrDUBQAAODPmqV2cRDcAESk1MHBRxBcAHwDcVYRurnbAMlJVHyBgiKuAPoADn0AH8BFAKEWN59A/GtdAG4g1tSkST0QAC7cJF/OPffkADLhmArjPA5RAC/oPOEAL/FEABuDklcbogAuAIVxA70xs1vEAG1sREM3e3goAFPDSsH3qlieABQ4g3PcYa0sAFjFBbZQw0JeAHAupb41XGITAB/Yx9WoL3fCANY3sIpnnGE6ALHM6/DMG5qJAB5uhPnOKLCJAC/0cYpZ3CSwAO2hZDLBCo4CANjHYwLbS1ldACYY9+dxAAd4AMfuiHLlAoX6AJ3gFTt/7HxuADDOdCWjlX6AAFl9+In7cRo1AEr50RU4HH6BAF2sh1OjaHSTAGAr7Gi9BNbyAB/xDZYOU00wCIg/xMBLAElFTgBErkJggg==' $Check_Pic = _WinAPI_Base64Decode($Check_Pic) If @error Then Return SetError(1, 0, 0) Local $tSource = DllStructCreate('byte[' & BinaryLen($Check_Pic) & ']') DllStructSetData($tSource, 1, $Check_Pic) Local $tDecompress _WinAPI_LZNTDecompress($tSource, $tDecompress, 5012) If @error Then Return SetError(3, 0, 0) $tSource = 0 Local Const $bString = Binary(DllStructGetData($tDecompress, 1)) If $bSaveBinary Then Local Const $hFile = FileOpen($sSavePath & "\RectCheck_20x20.png", 18) If @error Then Return SetError(2, 0, $bString) FileWrite($hFile, $bString) FileClose($hFile) EndIf Return $bString EndFunc ;==>_Check_Pic Func _About_Pic($bSaveBinary = False, $sSavePath = @ScriptDir) Local $About $About &= 'iVBORw0KGgoAAAANSUhEUgAAABAAAAAUCAYAAACEYr13AAAACXBIWXMAAAsSAAALEgHS3X78AAADgklEQVQ4jYWS3UssZRzHv888zzwzOy+7O7O66q4WTQnKZoGg3ih4PLYdKAyKIiE4F0I30UVXEf0JdRWEXUZ0o3ddlBJeBNFNUhmiJ1nFl12do+uk7O7Mvs3M09WJ2g6n3+WP7/fD9/dC8ZgyDGN8aWlpdXl5+fNCofD+ycnJsO/7vwIIerWst6Gq6tMrKyvrjuM877oubm9voev6BwCeAnC/F/IfwOjo6LupVKqwu7uLcrmMcrmMi4sLQgh5TZKkO1EUfftPPe3xU1mWP4zj+NlSqYTDw0NUKhV0Oh0QQijnvBSG4Q9PSiDOz88b1WoVQgiEYQghBACAEAJKaeNxO+ut+wC6AAQhRBBCBABhmuafiqK82CvuHQEASpIk9eu6/oJlWdQwDCSTyRqAj+v1+ncAxP8BIlVV6/l8/m5/f3/atm1IkvTAdd1P4ziuPjEBYyxrWdZHCwsLn8zPzw+l02nk83lMT08P9vX13XNd12u1WgcAol4AsW17bmZm5usgCN50HEcbHByEaZowDAOSJCGTydj1ev1VRVEytVrtpziO248AZGRk5PXZ2dmvtre3n7u5uSGFQgHdbhe+78P3fTQaDQRBAFmW2fHx8dTY2Ngzrut+L4ToME3TxhYXFz/b3Nzsr1aryOVyqNVqaDT+fbF2u40wDMEYk8IwfMu27W+q1eoacxznHc/zcg8fPgSlFIlEApeXl38bhRBot9uYmprC3NwcVFXF/v4+XV9ff+/6+vpHNjQ09NLR0RGEEJBlGWdnZ7i8vARjDIQQEEJQLBZRLBbhOA6EEGCMgVI6u7q6+gWzLGv09PQUyWQSURSh1Wqh2+2CEAIAGB4ehm3bKJVKAADOOXZ2dhDHMZmYmHhFcl33QTabPcvlckG73YYkSVAUBZqmwTRNpFIpKIoCz/MwMDCAyclJ1Ot1NJtNWJYlsb29vbdN05wOguCuLMtvKIrSp6oq4ZyDUopOpwPDMKDrOjRNAyEEmUwGjDEcHByAAogZYxLn3E8kEn8kEol6KpWi6XSaWpYloiiKdV2n4+PjJJvNotvtwvM8+L6PjY2N31iz2fQJISVN025kWT4C8EutVjODIEgyxrQ4junW1tbLnPNFQggXQuDq6kqsra39XqlUVsijT6SUUs45Z4wplFJOCJEJITSOYxpFkRqG4Z1kMnmPc657nvdzs9n8Ughx+heduWqeDdOyegAAAABJRU5ErkJggg==' Local $bString = Binary(_WinAPI_Base64Decode($About)) If $bSaveBinary Then Local $hFile = FileOpen($sSavePath & "\About1_16x20.png", 18) FileWrite($hFile, $bString) FileClose($hFile) EndIf Return $bString EndFunc ;==>_About_Pic Func _Exit_Pic($bSaveBinary = False, $sSavePath = @ScriptDir) Local $Exit $Exit &= 'iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAACXBIWXMAAAsSAAALEgHS3X78AAABdElEQVQ4ja2UO0vDUBiGn/ecnLbaWmgtRbxPLi6Cm4MuOghO4uDgILg7CG4Orm7+Av+Lo5sI7oqTiChRkdqa4+Clsa3RBF/4IJzke/LmuwTiklkEmkCULfQY0CmZMCjXDzA2BIT3gBfeC+/xn9fxeyDfbExHjaf1Ttgi6Ao01PWiX6UVUGjSJybrG1DGtuQKIVIUP84OzPWfuMrwsqy7jZ3OAKtAd72zSUvAPbAPlBKeWwGFAXCQDPSTQBnYA6aBHeAqMSNFRMApMEdXbd8dpgV+xjVoE2Q7gZnGRjYo5urj4wpyPfNTuTOF4oWrTayZfLGj6x9NcdXR3SQ30cvz1Ovj7RYIW6oe24HKdvPm8ty3mr63fWMTA9kljH1wtbFDWxqsop/mvN2UuArACPBVbAX5WVeb2DB9ZZf0Jb2BMgugM1C9DcwZ2eAP69ce7LgcUCG2kr71EpFC//636bXweWAeuEvJmgH0HShFMqYPOMpgTqDGG6xug+Rulk+sAAAAAElFTkSuQmCC' Local $bString = Binary(_WinAPI_Base64Decode($Exit)) If $bSaveBinary Then Local $hFile = FileOpen($sSavePath & "\Exit3_20x20.png", 18) FileWrite($hFile, $bString) FileClose($hFile) EndIf Return $bString EndFunc ;==>_Exit_Pic Func _Shell32_39ico($bSaveBinary = False, $sSavePath = @ScriptDir) Local $Shell32_39ico $Shell32_39ico &= 'iLRIAAABABBAQAFwIAAAKEIAABYAAMwAKAAYAJAAgAAYAVwPAgAAbP8DGwBaWFJgAFtXUd9bVlL/AFpVUf5ZVVD+C+AAYQH/YAH/WVRQYP5YVE/+4ABhAf8RYAH/WFNjAFdSTgz+VmAA4AD/VlJNoWEB/1ZRTWIBVeEAAWAAVVFM/1VQTIz/VGAA5QBUT0tiAIJTZABSTkr/U2AADeAA/mEBYQBRTUn+A2AA4QD/UUxI/1CBZgBH/k9LR/9gAJD+T0pG4QD/TuEAB2AA4QBoAO9OS0ZfAf0fXFdT71tXUuD+XFdS/+AAYwBhIfhWUf5gAGIi5ABiAGIhA+Mi5iFXU0/+V1P/4CBkImABYSBrImIhZQDiIPD+VFBLYQBmIuIhYyDW/uQhYABJ4AFJ4QBjIdxNSOEhYCPiIf5sI+IhE2Qi4CNH3/0fXVlUqP9dWGEAU2EA/uEA6eMhU/9gIv5lIuEh5CL/ZgBhReFD4yFlRGJDYUbgIp9lIeNE4SFjRWkiTP7gQt/iReIgYgDuQ2MiT2QiYEN/4iLlQ2oAYyHiQ2AA/R9eAFpV/15ZVf9f/eIAVGYAYSJhIOQiYgHhIv9gIGUA5UTmAOVE4SFlReJlB2UA4kTjIq6mnv+5ALCn/7eupf+qdKKaYSH+YgDgRmEirpKn4AOxqOMDoZliIhdgIWAg4QBK9g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A=' $Shell32_39ico = _WinAPI_Base64Decode($Shell32_39ico) If @error Then Return SetError(1, 0, 0) Local $tSource = DllStructCreate('byte[' & BinaryLen($Shell32_39ico) & ']') DllStructSetData($tSource, 1, $Shell32_39ico) Local $tDecompress _WinAPI_LZNTDecompress($tSource, $tDecompress, 16958) If @error Then Return SetError(3, 0, 0) $tSource = 0 Local Const $bString = Binary(DllStructGetData($tDecompress, 1)) If $bSaveBinary Then Local Const $hFile = FileOpen($sSavePath & "\Shell32_39.ico", 18) If @error Then Return SetError(2, 0, $bString) FileWrite($hFile, $bString) FileClose($hFile) EndIf Return $bString EndFunc ;==>_Shell32_39ico #EndRegion Embedded Gfx #Region Embedded Binary Data #Region TichySID Func _SIDClose() Local $aRet = MemoryDllCall($hTitchysidDll, 'int', 'SIDClose') If @error Then Return SetError(@error, 0, 0) Return $aRet[0] EndFunc ;==>_SIDClose Func _SIDOpen($Sid, $iSubsong = 1) Local $bSid If Not IsBinary($Sid) Then If Not FileExists($Sid) Then Return SetError(2, 0, 0) Local $hFileOpen = FileOpen($Sid, 0) If $hFileOpen = -1 Then Return SetError(-1, 0, 0) $bSid = FileRead($hFileOpen) FileClose($hFileOpen) Else $bSid = $Sid EndIf Local $tSid = DllStructCreate('byte[' & BinaryLen($bSid) & ']') DllStructSetData($tSid, 1, $bSid) Local $sType = BinaryToString(BinaryMid($bSid, 1, 4), 1) ConsoleWrite('-->-- Sid File Type : ' & $sType & @CRLF) Local $iVersion = Execute(BinaryMid($bSid, 5, 2)) ConsoleWrite('-->-- Sid File Version : ' & $iVersion & @CRLF) $iSubsongCount = Int(StringTrimLeft(BinaryMid($bSid, 15, 2), 2)) ConsoleWrite('-->-- SubsongCount : ' & $iSubsongCount & @CRLF) $iSubsong = $iSubsong - 1 If $iSubsong < 0 Then $iSubsong = 0 If $iSubsong > $iSubsongCount Then $iSubsong = 0 ConsoleWrite('-->-- Subsong : ' & $iSubsong & @CRLF) Local $aRet = MemoryDllCall($hTitchysidDll, 'int', 'SIDOpen', 'ptr', DllStructGetPtr($tSid), 'int', DllStructGetSize($tSid), 'int', $SID_MEMORY, 'int', $SID_NON_DEFAULT, 'int', $iSubsong) If @error Then Return SetError(@error, 0, 0) $tSid = 0 $bSid = 0 Return $aRet[0] EndFunc ;==>_SIDOpen Func _SIDShutdown() MemoryDllClose($hTitchysidDll) $hTitchysidDll = 0 EndFunc ;==>_SIDShutdown Func _SIDStartup() $hTitchysidDll = MemoryDllOpen(TitchySIDdll()) If $hTitchysidDll = -1 Then Return SetError(1, 0, 0) Return SetError(0, 0, $hTitchysidDll) EndFunc ;==>_SIDStartup Func _SIDStop() Local $aRet = MemoryDllCall($hTitchysidDll, 'int', 'SIDStop') If @error Then Return SetError(@error, 0, 0) Return $aRet[0] EndFunc ;==>_SIDStop Func _SIDGetFFTData($tFFTData) Local $aRet = MemoryDllCall ( $hTitchysidDll, 'int', 'SIDGetFFTData', "struct*", $tFFTData) If @error Then Return SetError ( @error, 0, 0 ) Return $aRet[0] EndFunc ;==> _SIDGetFFTData() Func TitchySIDdll($bSaveBinary = False, $sSavePath = @ScriptDir) Local $TitchySIDdll $TitchySIDdll &= 'UbwATVqQAAMAAACCBAAw//8AALgAOB0BAEAEOBkAAawOH7oADgC0Cc0huAEATM0hVGhpcyAAcHJvZ3JhbSAAY2Fubm90IGIAZSBydW4gaW4AIERPUyBtb2RAZS4NDQokBIYDgFUFlEc0a8cJA4JEAAPJK3jHVgAHMFJpY2gBEw17UEUAAABMAQQAoAEExF8FE+AADiELIAEFDAAWAAyqBrUDFBAEAzAEDQELAgPv4wEABQcAAAcGBgAPAxoHgRWGAwMDoDEAAPMLgY+AJzwZjvAGAEgXoKEOAIArNBgPLnRl5Hh0gANaFARIgXUHYgECACAAAGAucmTAYXRhAACTAWaBfU2BERqLE4DxQC6DCQBceKLASwF9wQsezgnAAC5yZWxvYwAAvDgBwzbCCQAazAlCsTw/PwA/AD8APwA/AC8AVYsE7LhBOl3CDABWCFfo6kABi/6Bx0JIQEuN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BiBlcgAAxXUBUmVAc2V0AADG+AB0FGFyEAHKFQFVbnCFuwPLlQFXcml0MAZgd2lubW0jCgwAoAgBxF9xACIyAADVYVQJNADIMBHs8RVwASDPEwAAGDAABBQIAAArMADlEQAAqq/wAFIwAL8wAGcwAKo3cAJFMABOMABcMACq' $TitchySIDdll &= 'aDAAcDAAeTAAgTAARoswABEGAgADsGsFEAAGAAeAbHRpdABjaHlzaWRfZSB4dHJhcyIKU0kARENoYW5nZVN4b25n0gBRGYEAUBVGQEZURGF0YdQAUPByb3BzsQCSFXAAMxUxgQBsYXlxAMASdW3hEgFTdG9wfyIPAA8A/w8ADwAPAA8ADwAPAA8ADwD/DwAPAA8ADwAPAA8ADwAPABcPAAMA0R5EgJoQsQIBMB8QAOmkYS6PABefD/YJvwaPAAW+BMkDhQHCAAB5AGEAIAATAAAMAKSmbTyxAB5bFPoMygg+AAcuBu8E+wH9AACeAH8AKgAZAfADBCBUMA2ABOCQAyJUM3EA8AB1AAI7cQAAIkQzDcjIRAARcwCpAXEAcAEBdQAmMYeaDgkEAAEMCgcIBQIDAA0GCxQTBAgWABcFCRgSBgwZACIHDTgfACQtACEBDjIgAgoxABwDCzgqFRURAC0yMSMaHR4bADg3OC4zLzQQACwoKSclJjUP+CswNj8PDwAPAA8ADwD/DwAPAA8ADwAPAA8ADwAPAAcPAA8ADQBOsAAAEAAAKAAAAABMMP4wFjE/MQBUMdYxmzICMwBZMzE0UTSZNEAcOmk6cT8AgCABAggAGjQgNCY0ACw0MjQ4ND40AEQ0SjRQNFY0AwAwtAE=' $TitchySIDdll = _WinAPI_Base64Decode($TitchySIDdll) If @error Then Return SetError(1, 0, 0) Local $tSource = DllStructCreate('byte[' & BinaryLen($TitchySIDdll) & ']') DllStructSetData($tSource, 1, $TitchySIDdll) Local $tDecompress _WinAPI_LZNTDecompress($tSource, $tDecompress, 8704) If @error Then Return SetError(3, 0, 0) $tSource = 0 Local Const $bString = Binary(DllStructGetData($tDecompress, 1)) If $bSaveBinary Then Local Const $hFile = FileOpen($sSavePath & "\TitchySID.dll", 18) If @error Then Return SetError(2, 0, $bString) FileWrite($hFile, $bString) FileClose($hFile) EndIf Return $bString EndFunc ;==>_TitchySIDdll Func API_FreeLibrary($Module) Local $Ret = DllCall($_KERNEL32DLL, 'bool', 'FreeLibrary', 'handle', $Module) If @error Then Return SetError(@error, @extended, 0) Return $Ret[0] EndFunc ;==>API_FreeLibrary Func API_GetProcAddress($Module, $Procname) If IsNumber($Procname) Then Local $Ret = DllCall($_KERNEL32DLL, 'ptr', 'GetProcAddress', 'handle', $Module, 'int', $Procname) Else Local $Ret = DllCall($_KERNEL32DLL, 'ptr', 'GetProcAddress', 'handle', $Module, 'str', $Procname) EndIf If @error Then Return SetError(@error, @extended, 0) Return $Ret[0] EndFunc ;==>API_GetProcAddress Func API_IsBadReadPtr($Ptr, $Len) Local $Ret = DllCall($_KERNEL32DLL, 'int', 'IsBadReadPtr', 'ptr', $Ptr, 'UINT_PTR', $Len) If @error Then Return SetError(@error, @extended, 0) Return $Ret[0] EndFunc ;==>API_IsBadReadPtr Func API_LoadLibrary($Filename) Local $Ret = DllCall($_KERNEL32DLL, 'handle', 'LoadLibraryW', 'wstr', $Filename) If @error Then Return SetError(@error, @extended, 0) Return $Ret[0] EndFunc ;==>API_LoadLibrary Func API_lstrlenA($Address) Local $Ret = DllCall($_KERNEL32DLL, 'int', 'lstrlenA', 'ptr', $Address) If @error Then Return SetError(@error, @extended, 0) Return $Ret[0] EndFunc ;==>API_lstrlenA Func API_lstrlenW($Address) Local $Ret = DllCall($_KERNEL32DLL, 'int', 'lstrlenW', 'ptr', $Address) If @error Then Return SetError(@error, @extended, 0) Return $Ret[0] EndFunc ;==>API_lstrlenW Func API_VirtualProtect($Address, $Size, $Protection) Local $Ret = DllCall($_KERNEL32DLL, 'bool', 'VirtualProtect', 'ptr', $Address, 'dword_ptr', $Size, 'dword', $Protection, 'dword*', 0) If @error Then Return SetError(@error, @extended, 0) Return $Ret[0] EndFunc ;==>API_VirtualProtect Func API_ZeroMemory($Address, $Size) Local $Ret = DllCall($_KERNEL32DLL, 'none', 'RtlZeroMemory', 'ptr', $Address, 'dword_ptr', $Size) If @error Then Return SetError(@error, @extended, 0) Return $Ret[0] EndFunc ;==>API_ZeroMemory Func MemLib_BuildImportTable($CodeBase, $PEHeader) Local Const $IMAGE_DIRECTORY_ENTRY_IMPORT = 1 Local Const $SizeOfPtr = DllStructGetSize(DllStructCreate('ptr', 1)) Local $IMAGE_NT_HEADER = DllStructCreate($tagIMAGE_NT_HEADER, $PEHeader) Local $SizeOfDataDirectory = DllStructGetSize(DllStructCreate($tagIMAGE_DATA_DIRECTORY)) Local $ImportDirectoryPtr = $PEHeader + DllStructGetSize($IMAGE_NT_HEADER) + $IMAGE_DIRECTORY_ENTRY_IMPORT * $SizeOfDataDirectory Local $ImportDirectory = DllStructCreate($tagIMAGE_DATA_DIRECTORY, $ImportDirectoryPtr) Local $ImportSize = DllStructGetData($ImportDirectory, 'Size') Local $ImportVirtualAddress = DllStructGetData($ImportDirectory, 'VirtualAddress') Local $SizeOfImportDir = DllStructGetSize(DllStructCreate($tagIMAGE_IMPORT_DESCRIPTOR)) Local $ImportList = '' If $ImportSize > 0 Then Local $ImportDescPtr = $CodeBase + $ImportVirtualAddress While 1 If API_IsBadReadPtr($ImportDescPtr, $SizeOfImportDir) Then ExitLoop Local $ImportDesc = DllStructCreate($tagIMAGE_IMPORT_DESCRIPTOR, $ImportDescPtr) Local $NameOffset = DllStructGetData($ImportDesc, 'Name') If $NameOffset = 0 Then ExitLoop Local $Name = Peek('str', $CodeBase + $NameOffset) Local $OriginalFirstThunk = DllStructGetData($ImportDesc, 'OriginalFirstThunk') Local $FirstThunk = DllStructGetData($ImportDesc, 'FirstThunk') Local $Handle = API_LoadLibrary($Name) If $Handle Then $ImportList &= $Handle & ',' Local $FuncRef = $CodeBase + $FirstThunk Local $ThunkRef = $CodeBase + $OriginalFirstThunk If $OriginalFirstThunk = 0 Then $ThunkRef = $FuncRef While 1 Local $Ref = Peek('ptr', $ThunkRef) If $Ref = 0 Then ExitLoop If BitAND(Peek('byte', $ThunkRef + $SizeOfPtr - 1), 0x80) Then Local $Ptr = API_GetProcAddress($Handle, BitAND($Ref, 0xffff)) Else Local $IMAGE_IMPORT_BY_NAME = DllStructCreate($tagIMAGE_IMPORT_BY_NAME, $CodeBase + $Ref) Local $NamePtr = DllStructGetPtr($IMAGE_IMPORT_BY_NAME, 2) Local $FuncName = Peek('str', $NamePtr) Local $Ptr = API_GetProcAddress($Handle, $FuncName) EndIf If $Ptr = 0 Then Return SetError(1, 0, False) Poke('ptr', $FuncRef, $Ptr) $ThunkRef += $SizeOfPtr $FuncRef += $SizeOfPtr WEnd Else Return SetError(1, 0, False) EndIf $ImportDescPtr += $SizeOfImportDir WEnd EndIf Return $ImportList EndFunc ;==>MemLib_BuildImportTable Func MemLib_CopySections($CodeBase, $PEHeader, $DllDataPtr) Local $IMAGE_NT_HEADER = DllStructCreate($tagIMAGE_NT_HEADER, $PEHeader) Local $SizeOfFileHeader = DllStructGetPtr($IMAGE_NT_HEADER, 'Magic') - $PEHeader Local $SizeOfOptionalHeader = DllStructGetData($IMAGE_NT_HEADER, 'SizeOfOptionalHeader') Local $NumberOfSections = DllStructGetData($IMAGE_NT_HEADER, 'NumberOfSections') Local $SectionAlignment = DllStructGetData($IMAGE_NT_HEADER, 'SectionAlignment') Local $SectionPtr = $PEHeader + $SizeOfFileHeader + $SizeOfOptionalHeader For $i = 1 To $NumberOfSections Local $Section = DllStructCreate($tagIMAGE_SECTION_HEADER, $SectionPtr) Local $VirtualAddress = DllStructGetData($Section, 'VirtualAddress') Local $SizeOfRawData = DllStructGetData($Section, 'SizeOfRawData') Local $PointerToRawData = DllStructGetData($Section, 'PointerToRawData') If $SizeOfRawData = 0 Then Local $Dest = _MemVirtualAlloc($CodeBase + $VirtualAddress, $SectionAlignment, $MEM_COMMIT, $PAGE_READWRITE) API_ZeroMemory($Dest, $SectionAlignment) Else Local $Dest = _MemVirtualAlloc($CodeBase + $VirtualAddress, $SizeOfRawData, $MEM_COMMIT, $PAGE_READWRITE) _MemMoveMemory($DllDataPtr + $PointerToRawData, $Dest, $SizeOfRawData) EndIf DllStructSetData($Section, 'VirtualSize', $Dest - $CodeBase) $SectionPtr += DllStructGetSize($Section) Next EndFunc ;==>MemLib_CopySections Func MemLib_FinalizeSections($CodeBase, $PEHeader) Local Const $IMAGE_SCN_MEM_EXECUTE = 0x20000000 Local Const $IMAGE_SCN_MEM_READ = 0x40000000 Local Const $IMAGE_SCN_MEM_WRITE = 0x80000000 Local Const $IMAGE_SCN_MEM_NOT_CACHED = 0x4000000 Local Const $IMAGE_SCN_CNT_INITIALIZED_DATA = 64 Local Const $IMAGE_SCN_CNT_UNINITIALIZED_DATA = 128 Local Const $PAGE_WRITECOPY = 0x0008 Local Const $PAGE_EXECUTE_WRITECOPY = 0x0080 Local $IMAGE_NT_HEADER = DllStructCreate($tagIMAGE_NT_HEADER, $PEHeader) Local $SizeOfFileHeader = DllStructGetPtr($IMAGE_NT_HEADER, 'Magic') - $PEHeader Local $SizeOfOptionalHeader = DllStructGetData($IMAGE_NT_HEADER, 'SizeOfOptionalHeader') Local $NumberOfSections = DllStructGetData($IMAGE_NT_HEADER, 'NumberOfSections') Local $SectionAlignment = DllStructGetData($IMAGE_NT_HEADER, 'SectionAlignment') Local $SectionPtr = $PEHeader + $SizeOfFileHeader + $SizeOfOptionalHeader For $i = 1 To $NumberOfSections Local $Section = DllStructCreate($tagIMAGE_SECTION_HEADER, $SectionPtr) Local $Characteristics = DllStructGetData($Section, 'Characteristics') Local $SizeOfRawData = DllStructGetData($Section, 'SizeOfRawData') Local $Executable = (BitAND($Characteristics, $IMAGE_SCN_MEM_EXECUTE) <> 0) Local $Readable = (BitAND($Characteristics, $IMAGE_SCN_MEM_READ) <> 0) Local $Writeable = (BitAND($Characteristics, $IMAGE_SCN_MEM_WRITE) <> 0) Local $ProtectList[8] = [$PAGE_NOACCESS, $PAGE_EXECUTE, $PAGE_READONLY, $PAGE_EXECUTE_READ, $PAGE_WRITECOPY, $PAGE_EXECUTE_WRITECOPY, $PAGE_READWRITE, $PAGE_EXECUTE_READWRITE] Local $Protect = $ProtectList[$Executable + $Readable * 2 + $Writeable * 4] If BitAND($Characteristics, $IMAGE_SCN_MEM_NOT_CACHED) Then $Protect = BitOR($Protect, $PAGE_NOCACHE) Local $Size = $SizeOfRawData If $Size = 0 Then If BitAND($Characteristics, $IMAGE_SCN_CNT_INITIALIZED_DATA) Then $Size = DllStructGetData($IMAGE_NT_HEADER, 'SizeOfInitializedData') ElseIf BitAND($Characteristics, $IMAGE_SCN_CNT_UNINITIALIZED_DATA) Then $Size = DllStructGetData($IMAGE_NT_HEADER, 'SizeOfUninitializedData') EndIf EndIf If $Size > 0 Then Local $PhysicalAddress = $CodeBase + DllStructGetData($Section, 'VirtualSize') API_VirtualProtect($PhysicalAddress, $Size, $Protect) EndIf $SectionPtr += DllStructGetSize($Section) Next EndFunc ;==>MemLib_FinalizeSections Func MemLib_FreeLibrary($ModulePtr) If Not MemLib_Vaild($ModulePtr) Then Return 0 Local $Module = DllStructCreate($tagModule, $ModulePtr) Local $CodeBase = DllStructGetData($Module, 'CodeBase') Local $DllEntry = DllStructGetData($Module, 'DllEntry') Local $Initialized = DllStructGetData($Module, 'Initialized') Local $ImportListPtr = DllStructGetData($Module, 'ImportList') Local $ExportListPtr = DllStructGetData($Module, 'ExportList') If $Initialized And $DllEntry Then Local $Success = MemoryFuncCall('bool', $DllEntry, 'ptr', $CodeBase, 'dword', 0, 'ptr', 0) DllStructSetData($Module, 'Initialized', 0) EndIf If $ExportListPtr Then _MemGlobalFree($ExportListPtr) If $ImportListPtr Then Local $ImportList = StringSplit(Peek('str', $ImportListPtr), ',') For $i = 1 To $ImportList[0] If $ImportList[$i] Then API_FreeLibrary($ImportList[$i]) Next _MemGlobalFree($ImportListPtr) EndIf If $CodeBase Then _MemVirtualFree($CodeBase, 0, $MEM_RELEASE) DllStructSetData($Module, 'CodeBase', 0) DllStructSetData($Module, 'ExportList', 0) _MemGlobalFree($ModulePtr) Return 1 EndFunc ;==>MemLib_FreeLibrary Func MemLib_GetExportList($CodeBase, $PEHeader) Local Const $IMAGE_DIRECTORY_ENTRY_EXPORT = 0 Local $IMAGE_NT_HEADER = DllStructCreate($tagIMAGE_NT_HEADER, $PEHeader) Local $SizeOfDataDirectory = DllStructGetSize(DllStructCreate($tagIMAGE_DATA_DIRECTORY)) Local $ExportDirectoryPtr = $PEHeader + DllStructGetSize($IMAGE_NT_HEADER) + $IMAGE_DIRECTORY_ENTRY_EXPORT * $SizeOfDataDirectory Local $ExportDirectory = DllStructCreate($tagIMAGE_DATA_DIRECTORY, $ExportDirectoryPtr) Local $ExportSize = DllStructGetData($ExportDirectory, 'Size') Local $ExportVirtualAddress = DllStructGetData($ExportDirectory, 'VirtualAddress') Local $ExportList = '' If $ExportSize > 0 Then Local $IMAGE_EXPORT_DIRECTORY = DllStructCreate($tagIMAGE_EXPORT_DIRECTORY, $CodeBase + $ExportVirtualAddress) Local $NumberOfNames = DllStructGetData($IMAGE_EXPORT_DIRECTORY, 'NumberOfNames') Local $NumberOfFunctions = DllStructGetData($IMAGE_EXPORT_DIRECTORY, 'NumberOfFunctions') Local $AddressOfFunctions = DllStructGetData($IMAGE_EXPORT_DIRECTORY, 'AddressOfFunctions') If $NumberOfNames = 0 Or $NumberOfFunctions = 0 Then Return '' Local $NameRef = $CodeBase + DllStructGetData($IMAGE_EXPORT_DIRECTORY, 'AddressOfNames') Local $Ordinal = $CodeBase + DllStructGetData($IMAGE_EXPORT_DIRECTORY, 'AddressOfNameOrdinals') For $i = 1 To $NumberOfNames Local $Ref = Peek('dword', $NameRef) Local $Idx = Peek('word', $Ordinal) Local $FuncName = Peek('str', $CodeBase + $Ref) If $Idx <= $NumberOfFunctions Then Local $Addr = $CodeBase + Peek('dword', $CodeBase + $AddressOfFunctions + $Idx * 4) $ExportList &= $FuncName & Chr(1) & $Addr & Chr(1) EndIf $NameRef += 4 $Ordinal += 2 Next EndIf Return $ExportList EndFunc ;==>MemLib_GetExportList Func MemLib_GetProcAddress($ModulePtr, $FuncName) Local $ExportPtr = Peek('ptr', $ModulePtr) If Not $ExportPtr Then Return 0 Local $ExportList = Peek('str', $ExportPtr) Local $Match = StringRegExp($ExportList, '(?i)' & $FuncName & '\001([^\001]*)\001', 3) If Not @error Then Return Ptr($Match[0]) Return 0 EndFunc ;==>MemLib_GetProcAddress Func MemLib_LoadLibrary($DllBinary) $DllBinary = Binary($DllBinary) Local $DllData = DllStructCreate('byte[' & BinaryLen($DllBinary) & ']') Local $DllDataPtr = DllStructGetPtr($DllData) DllStructSetData($DllData, 1, $DllBinary) Local $IMAGE_DOS_HEADER = DllStructCreate($tagIMAGE_DOS_HEADER, $DllDataPtr) If DllStructGetData($IMAGE_DOS_HEADER, 'e_magic') <> 0x5A4D Then Return SetError(1, 0, 0) EndIf Local $PEHeader = $DllDataPtr + DllStructGetData($IMAGE_DOS_HEADER, 'e_lfanew') Local $IMAGE_NT_HEADER = DllStructCreate($tagIMAGE_NT_HEADER, $PEHeader) If DllStructGetData($IMAGE_NT_HEADER, 'Signature') <> 0x4550 Then Return SetError(1, 0, 0) EndIf Switch DllStructGetData($IMAGE_NT_HEADER, 'Magic') Case 0x10B If @AutoItX64 Then Return SetError(2, 0, 0) Case 0x20B If Not @AutoItX64 Then Return SetError(2, 0, 0) EndSwitch Local $ImageBase = DllStructGetData($IMAGE_NT_HEADER, 'ImageBase') Local $SizeOfImage = DllStructGetData($IMAGE_NT_HEADER, 'SizeOfImage') Local $SizeOfHeaders = DllStructGetData($IMAGE_NT_HEADER, 'SizeOfHeaders') Local $AddressOfEntryPoint = DllStructGetData($IMAGE_NT_HEADER, 'AddressOfEntryPoint') Local $ModulePtr = _MemGlobalAlloc(DllStructGetSize(DllStructCreate($tagModule)), $GPTR) If $ModulePtr = 0 Then Return SetError(3, 0, 0) Local $Module = DllStructCreate($tagModule, $ModulePtr) Local $CodeBase = _MemVirtualAlloc($ImageBase, $SizeOfImage, $MEM_RESERVE, $PAGE_READWRITE) If $CodeBase = 0 Then $CodeBase = _MemVirtualAlloc(0, $SizeOfImage, $MEM_RESERVE, $PAGE_READWRITE) If $CodeBase = 0 Then Return SetError(3, 0, 0) DllStructSetData($Module, 'CodeBase', $CodeBase) _MemVirtualAlloc($CodeBase, $SizeOfImage, $MEM_COMMIT, $PAGE_READWRITE) Local $Base = _MemVirtualAlloc($CodeBase, $SizeOfHeaders, $MEM_COMMIT, $PAGE_READWRITE) _MemMoveMemory($DllDataPtr, $Base, $SizeOfHeaders) MemLib_CopySections($CodeBase, $PEHeader, $DllDataPtr) Local $LocationDelta = $CodeBase - $ImageBase If $LocationDelta <> 0 Then MemLib_PerformBaseRelocation($CodeBase, $PEHeader, $LocationDelta) Local $ImportList = MemLib_BuildImportTable($CodeBase, $PEHeader) If @error Then MemLib_FreeLibrary($ModulePtr) Return SetError(2, 0, 0) EndIf Local $ExportList = MemLib_GetExportList($CodeBase, $PEHeader) Local $ImportListPtr = _MemGlobalAlloc(StringLen($ImportList) + 2, $GPTR) Local $ExportListPtr = _MemGlobalAlloc(StringLen($ExportList) + 2, $GPTR) DllStructSetData($Module, 'ImportList', $ImportListPtr) DllStructSetData($Module, 'ExportList', $ExportListPtr) If $ImportListPtr = 0 Or $ExportListPtr = 0 Then MemLib_FreeLibrary($ModulePtr) Return SetError(3, 0, 0) EndIf Poke('str', $ImportListPtr, $ImportList) Poke('str', $ExportListPtr, $ExportList) MemLib_FinalizeSections($CodeBase, $PEHeader) Local $DllEntry = $CodeBase + $AddressOfEntryPoint DllStructSetData($Module, 'DllEntry', $DllEntry) DllStructSetData($Module, 'Initialized', 0) If $AddressOfEntryPoint Then Local $Success = MemoryFuncCall('bool', $DllEntry, 'ptr', $CodeBase, 'dword', 1, 'ptr', 0) If Not $Success[0] Then MemLib_FreeLibrary($ModulePtr) Return SetError(4, 0, 0) EndIf DllStructSetData($Module, 'Initialized', 1) EndIf Return $ModulePtr EndFunc ;==>MemLib_LoadLibrary Func MemLib_PerformBaseRelocation($CodeBase, $PEHeader, $LocationDelta) Local Const $IMAGE_DIRECTORY_ENTRY_BASERELOC = 5 Local Const $IMAGE_REL_BASED_HIGHLOW = 3 Local Const $IMAGE_REL_BASED_DIR64 = 10 Local $IMAGE_NT_HEADER = DllStructCreate($tagIMAGE_NT_HEADER, $PEHeader) Local $SizeOfDataDirectory = DllStructGetSize(DllStructCreate($tagIMAGE_DATA_DIRECTORY)) Local $RelocDirectoryPtr = $PEHeader + DllStructGetSize($IMAGE_NT_HEADER) + $IMAGE_DIRECTORY_ENTRY_BASERELOC * $SizeOfDataDirectory Local $RelocDirectory = DllStructCreate($tagIMAGE_DATA_DIRECTORY, $RelocDirectoryPtr) Local $RelocSize = DllStructGetData($RelocDirectory, 'Size') Local $RelocVirtualAddress = DllStructGetData($RelocDirectory, 'VirtualAddress') If $RelocSize > 0 Then Local $Relocation = $CodeBase + $RelocVirtualAddress While 1 Local $IMAGE_BASE_RELOCATION = DllStructCreate($tagIMAGE_BASE_RELOCATION, $Relocation) Local $VirtualAddress = DllStructGetData($IMAGE_BASE_RELOCATION, 'VirtualAddress') Local $SizeOfBlock = DllStructGetData($IMAGE_BASE_RELOCATION, 'SizeOfBlock') If $VirtualAddress = 0 Then ExitLoop Local $Dest = $CodeBase + $VirtualAddress Local $Entries = ($SizeOfBlock - 8) / 2 Local $RelInfo = DllStructCreate('word[' & $Entries & ']', $Relocation + 8) For $i = 1 To $Entries Local $Info = DllStructGetData($RelInfo, 1, $i) Local $Type = BitShift($Info, 12) If $Type = $IMAGE_REL_BASED_HIGHLOW Or $Type = $IMAGE_REL_BASED_DIR64 Then Local $Addr = DllStructCreate('ptr', $Dest + BitAND($Info, 0xFFF)) DllStructSetData($Addr, 1, DllStructGetData($Addr, 1) + $LocationDelta) EndIf Next $Relocation += $SizeOfBlock WEnd EndIf EndFunc ;==>MemLib_PerformBaseRelocation Func MemLib_Vaild($ModulePtr) Local $ModuleSize = DllStructGetSize(DllStructCreate($tagModule)) If API_IsBadReadPtr($ModulePtr, $ModuleSize) Then Return False Local $Module = DllStructCreate($tagModule, $ModulePtr) Local $CodeBase = DllStructGetData($Module, 'CodeBase') If Not $CodeBase Then Return False Return True EndFunc ;==>MemLib_Vaild Func MemoryDllCall($Module, $RetType, $FuncName, $Type1 = '', $Param1 = 0, $Type2 = '', $Param2 = 0, $Type3 = '', $Param3 = 0, $Type4 = '', $Param4 = 0, $Type5 = '', $Param5 = 0, $Type6 = '', $Param6 = 0, $Type7 = '', $Param7 = 0, $Type8 = '', $Param8 = 0, $Type9 = '', $Param9 = 0, $Type10 = '', $Param10 = 0, $Type11 = '', $Param11 = 0, $Type12 = '', $Param12 = 0, $Type13 = '', $Param13 = 0, $Type14 = '', $Param14 = 0, $Type15 = '', $Param15 = 0, $Type16 = '', $Param16 = 0, $Type17 = '', $Param17 = 0, $Type18 = '', $Param18 = 0, $Type19 = '', $Param19 = 0, $Type20 = '', $Param20 = 0) Local $Ret, $OpenFlag = False Local Const $MaxParams = 20 If (@NumParams < 3) Or (@NumParams > $MaxParams * 2 + 3) Or (Mod(@NumParams, 2) = 0) Then Return SetError(4, 0, 0) If Not IsPtr($Module) Then $OpenFlag = True $Module = MemoryDllOpen($Module) If @error Then Return SetError(1, 0, 0) EndIf Local $Addr = MemLib_GetProcAddress($Module, $FuncName) If Not $Addr Then Return SetError(3, 0, 0) Poke('ptr', $_MFHookPtr + 1 + @AutoItX64, $Addr) Switch @NumParams Case 3 $Ret = DllCall($_KERNEL32DLL, $RetType, $_MFHookApi) Case 5 $Ret = DllCall($_KERNEL32DLL, $RetType, $_MFHookApi, $Type1, $Param1) Case 7 $Ret = DllCall($_KERNEL32DLL, $RetType, $_MFHookApi, $Type1, $Param1, $Type2, $Param2) Case 9 $Ret = DllCall($_KERNEL32DLL, $RetType, $_MFHookApi, $Type1, $Param1, $Type2, $Param2, $Type3, $Param3) Case 11 $Ret = DllCall($_KERNEL32DLL, $RetType, $_MFHookApi, $Type1, $Param1, $Type2, $Param2, $Type3, $Param3, $Type4, $Param4) Case 13 $Ret = DllCall($_KERNEL32DLL, $RetType, $_MFHookApi, $Type1, $Param1, $Type2, $Param2, $Type3, $Param3, $Type4, $Param4, $Type5, $Param5) Case Else Local $DllCallStr = 'DllCall ( $_KERNEL32DLL, $RetType, $_MFHookApi', $n = 1 For $i = 5 To @NumParams Step 2 $DllCallStr &= ', $Type' & $n & ', $Param' & $n $n += 1 Next $DllCallStr &= ' )' $Ret = Execute($DllCallStr) EndSwitch Local $Err = @error If $OpenFlag Then MemoryDllClose($Module) Return SetError($Err, 0, $Ret) EndFunc ;==>MemoryDllCall Func MemoryDllClose($Module) MemLib_FreeLibrary($Module) EndFunc ;==>MemoryDllClose Func MemoryDllOpen($DllBinary) If Not IsDllStruct($_MFHookBak) Then MemoryFuncInit() Local $Module = MemLib_LoadLibrary($DllBinary) If @error Then Return SetError(@error, 0, -1) Return $Module EndFunc ;==>MemoryDllOpen Func MemoryFuncCall($RetType, $Address, $Type1 = '', $Param1 = 0, $Type2 = '', $Param2 = 0, $Type3 = '', $Param3 = 0, $Type4 = '', $Param4 = 0, $Type5 = '', $Param5 = 0, $Type6 = '', $Param6 = 0, $Type7 = '', $Param7 = 0, $Type8 = '', $Param8 = 0, $Type9 = '', $Param9 = 0, $Type10 = '', $Param10 = 0, $Type11 = '', $Param11 = 0, $Type12 = '', $Param12 = 0, $Type13 = '', $Param13 = 0, $Type14 = '', $Param14 = 0, $Type15 = '', $Param15 = 0, $Type16 = '', $Param16 = 0, $Type17 = '', $Param17 = 0, $Type18 = '', $Param18 = 0, $Type19 = '', $Param19 = 0, $Type20 = '', $Param20 = 0) If Not IsDllStruct($_MFHookBak) Then MemoryFuncInit() Poke('ptr', $_MFHookPtr + 1 + @AutoItX64, $Address) Local $Ret Switch @NumParams Case 2 $Ret = DllCall($_KERNEL32DLL, $RetType, $_MFHookApi) Case 4 $Ret = DllCall($_KERNEL32DLL, $RetType, $_MFHookApi, $Type1, $Param1) Case 6 $Ret = DllCall($_KERNEL32DLL, $RetType, $_MFHookApi, $Type1, $Param1, $Type2, $Param2) Case 8 $Ret = DllCall($_KERNEL32DLL, $RetType, $_MFHookApi, $Type1, $Param1, $Type2, $Param2, $Type3, $Param3) Case 10 $Ret = DllCall($_KERNEL32DLL, $RetType, $_MFHookApi, $Type1, $Param1, $Type2, $Param2, $Type3, $Param3, $Type4, $Param4) Case 12 $Ret = DllCall($_KERNEL32DLL, $RetType, $_MFHookApi, $Type1, $Param1, $Type2, $Param2, $Type3, $Param3, $Type4, $Param4, $Type5, $Param5) Case Else Local $DllCallStr = 'DllCall($_KERNEL32DLL, $RetType, $_MFHookApi', $n = 1 For $i = 4 To @NumParams Step 2 $DllCallStr &= ', $Type' & $n & ', $Param' & $n $n += 1 Next $DllCallStr &= ')' $Ret = Execute($DllCallStr) EndSwitch Return SetError(@error, 0, $Ret) EndFunc ;==>MemoryFuncCall Func MemoryFuncInit() Local $KernelHandle = API_LoadLibrary('kernel32.dll') API_FreeLibrary($KernelHandle) Local $HookPtr = API_GetProcAddress($KernelHandle, $_MFHookApi) Local $HookSize = 7 + @AutoItX64 * 5 $_MFHookPtr = $HookPtr $_MFHookBak = DllStructCreate('byte[' & $HookSize & ']') If Not API_VirtualProtect($_MFHookPtr, $HookSize, $PAGE_EXECUTE_READWRITE) Then Return False DllStructSetData($_MFHookBak, 1, Peek('byte[' & $HookSize & ']', $_MFHookPtr)) If @AutoItX64 Then Poke('word', $_MFHookPtr, 0xB848) Poke('word', $_MFHookPtr + 10, 0xE0FF) Else Poke('byte', $_MFHookPtr, 0xB8) Poke('word', $_MFHookPtr + 5, 0xE0FF) EndIf Return True EndFunc ;==>MemoryFuncInit Func Peek($Type, $Ptr) If $Type = 'str' Then $Type = 'char[' & API_lstrlenA($Ptr) & ']' ElseIf $Type = 'wstr' Then $Type = 'wchar[' & API_lstrlenW($Ptr) & ']' EndIf Return DllStructGetData(DllStructCreate($Type, $Ptr), 1) EndFunc ;==>Peek Func Poke($Type, $Ptr, $Value) If $Type = 'str' Then $Type = 'char[' & (StringLen($Value) + 1) & ']' ElseIf $Type = 'wstr' Then $Type = 'wchar[' & (StringLen($Value) + 1) & ']' EndIf DllStructSetData(DllStructCreate($Type, $Ptr), 1, $Value) EndFunc ;==>Poke #EndRegion #EndRegion #Region SID Tune ;Code below was generated by: 'File to Base64 String' Code Generator v1.20 Build 2020-06-05 Func _SID_Tune($bSaveBinary = False, $sSavePath = @ScriptDir) Local $SID_Tune $SID_Tune &= 'DrkAUFNJRAACAHwAAAAQABADAAEDABAAAFVuaWNvcoBuZmxha2VzAUABDABT+HJlbiBMgHVuZCAoU28AFgIpCz4yMDE2IENAYW1lbG90EHwABAAUAgoQTH0RTADqEUwNEq2WiaCSlZqtIAwAAwUvDgEAABJICQAWJzhLAF9ziqG61PAOAC1OcZa95xNCAHSp4Btam+IsAHvOJ4XoUcE3ALQ3xFf1nE4JANCjgm5oboivAOs5nBOhRgTcANDcEF7WcjgmAEKMCLiguCC8AKzkcEyEGBBwAEBwQHhYyOCYsAgwIC4BQgQAAgMACgMBAAQAAAUFBQYABgYHBwgICQkACgoLDA0NDg8AEBESExQVFxgAGhsdHyAiJCcAKSsuMTQ3Oj4AQUVJTlJXXGIAaG51fIOLk5wApa+5xNDd6vim/R5wHgANGAIDFwMDBjEDAxUAqKkPjfMAEbklEAqqvQYAF417Eb0HF40AfBG5KRCNIxAArSQQjTIWjWcAErktEI1PEbkAMRCNVhG5NRAAjV0RogAgwREEogcBAQ6pAZ0+ABGdORGdZRGpAAKdDxGpBJ0SABGpAJ04EZ0TABGdTRGdPBEgAC0STFwUpftIAKX8SKkACQCNgBjUog4gqRNAEAUAAQAAAWiF/GiFzPtggwjABiUSwAYAAQIAAAFMBhK9OxEA8OJMyhSp/50AOhGdJRG8ExEAucYXnWMRuc4IF50QQRsjEZ0UABGdOxGdKBGdACkRue4XnScRALn2F50mEakDAcAj4ADQGbnmFwCNF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wZ0AKLfsA/C/+ZTRh/jJ3cAWgAwoDZWYSYQo1B2JmNFAL0A6wYHAPEQ82/7EWrwyvDK8MkAOvDK8Mogz+hq8MrwypDAkD' $SID_Tune &= 'rwyvDKMMAIdhKrT+MbT+UC20/jKCADaCADkCtKEBJrT+L7T+DisSAYAApwGGYSr+6jHQIzJQADZQAHEg0EEoL/4rwAAvJQE=' $SID_Tune = _WinAPI_Base64Decode($SID_Tune) If @error Then Return SetError(1, 0, 0) Local $tSource = DllStructCreate('byte[' & BinaryLen($SID_Tune) & ']') DllStructSetData($tSource, 1, $SID_Tune) Local $tDecompress _WinAPI_LZNTDecompress($tSource, $tDecompress, 3373) If @error Then Return SetError(3, 0, 0) $tSource = 0 Local Const $bString = Binary(DllStructGetData($tDecompress, 1)) If $bSaveBinary Then Local Const $hFile = FileOpen($sSavePath & "\Unicornflakes.sid", 18) If @error Then Return SetError(2, 0, $bString) FileWrite($hFile, $bString) FileClose($hFile) EndIf Return $bString EndFunc ;==>_SID_Tune #EndRegion The tool should also work for different DPI settings and in multi-monitor environment. Thanks to for testing: argumentum BugFix Kanashius Mombas After starting, the desktop icons are read in and displayed in a list. With the left mouse button you can start the app, with the right mouse button you have additional options, like starting the app with administrative rights. The source code and the compiled exe file are additionally located on my One Drive: Toolbar Desktop Works best when compiled!
- 15 replies
-
ICU - Icon Configuration Utility [Updated 2018-Sep-16]
KaFu posted a topic in AutoIt Example Scripts
ICU - Icon Configuration Utility Current Version: v6 (2018-Sep-16) Restore your desktop when the icons get "rearranged". Melba23 and I found we were working on very similar ideas to restore the Desktop icons to their normal place if they became "rearranged" ( ). Vista seems to like this doing on occasion just for fun - but we all know some apps and games which change the display resolution or move icons around. This annoys "tidy" people who like their desktops arranged "just so" - I am particularly thinking of this desktop when I say that! We combined efforts and here is the result of our labors. Operation is easy - press "Save" to store a particular configuration and "Restore" to reset the icons to the saved positions in the selected configuration file. "Delete" allows you to remove unwanted configuration files from the list. There is a command line option so that the restoration can be run via HotKeys if required (that is why the script warns that it should be compiled for full functionality). You can decide what to do with any icons that have been added since you last saved the configuration file - the default is to put them in the top-left corner, but you can also banish them way off-screen or, more sensibly, specify a location for them. A new feature as of ICU v3.4 is the optional Desktop Contextmenu Integration (DCI) for Win7 (Win7 only because Microsoft implemented an easy way to do this through the registry as of this release). Version 3.3 should fix the empty save file bug Version 3.4 Win7: Admin rights no longer needed for DCI Version 5.0 Win8 compatibility for DCI The source and executable can be downloaded from my site: http://www.funk.eu Kudos to Ascend4nt, Melba23, Prog@ndy, & Valik for parts of the code. Please let me know if you found some piece of code in the source for which I forgot to mention a credit. Enjoy, let me know what you think of ICU and with Best Regards -
Hi, guys! I'm new with using Autoit. Is possible do an automation to an application desktop java using Autoit?
-
Hi, when I call a MsgBox function I can use a "$MB_SERVICE_NOTIFICATION" flag so it will be displayed "on the current active desktop, even if there is no user logged on to the computer.". That works just great. Is there a way to do the same to Autoit GUI Form so it will be visible on desktop even if running from system account and user is not logged?
-
Windows Desktop Dimmer / Shade Are your eyes being blinded by the bright white light leaping from your screen and burning your retinas out? Yeah, so were mine. So I looked for ways to adjust this, but each thing had its limitations. - LCD brightness adjustments: Yes, this is the obvious choice. But there's two problems: The monitor emits a high pitched noise (common with LCD dimming) In different scenarios, brighter is better (games, movies). And what a pain to constantly adjust! - Graphics Card software adjustments: Pain in the ass, often inconsistent, and might ruin contrast, wash out colors, or otherwise not give the results you want. Its even more of a pain when dealing with more than one monitor. And again - see #2 above. So what other option is there? Well, there's this novel idea of using a desktop dimmer 'window' - basically a click-through full-screen GUI that is fully transparent - thus altering the screen colors. I got this idea from this Android app called 'Screen Filter'. I had explored the idea with this very basic test code: ; Styles: Basic: WS_POPUP (0x80000000), Extended: WS_EX_NOACTIVATE 0x08000000, ; $WS_EX_TOOLWINDOW (0x80) + $WS_EX_TOPMOST (0x8)? + $WS_EX_TRANSPARENT (click-through) $hGUI=GUICreate("",@DesktopWidth,@DesktopHeight,0,0,0x80000000,0x08000080 + 0x20) WinSetTrans($hGUI, "", 110) WinSetOnTop($hGUI, "", 1) GUISetBkColor(0x141414) WinSetState($hGUI, "", @SW_SHOWNOACTIVATE) Sleep(5000)This worked well when put inside a 'real' AutoIt script. However, there was a constant issue revolving around windows stealing the top-most attribute, thus causing them to hover 'above' the desktop shade. So (as you'll see from the posts below), we created workarounds by resetting the top-most flag. But that made things a bit, well, ugly. A number of people tried to come up with methods that tried to solve this problem - and really, its an interesting read, so check out the posts that follow. The thing is, everybody ran into the same losing-topmost status problem.. UNTIL, that is, lorenkinzel came in and> posted a script that surprised us all Dimmer Control / Tray Menu Turns out one easy API call was all it took to adjust the screen brightness. No fancy Desktop Shade GUI's were needed. So, KaFu took it one step further by developing a simple GUI, and I made some adjustments (see above pics), implemented some fixes, and the rest is history. We now have a nice 'Windows Desktop Dimmer' program that I find to be a must-have addition to my Windows toolbox. Ah, and I should mention the neat '>Windows Focus' GUI that was developed by KaFu in response to my '>Active Window Dimmer' script. Mine simply dimmed the active window, while KaFu's dimmed everything BUT the active window. This creates a cool movie-theater or focus-writer effect that I find actually compliments the Windows Dimmer. *UPDATE: See '>Spotlight + Focus GUI' script for some new eyestrain-relieving experiments! And check out RedShiftGUI for even better ideas for eyestrain relief! So, with all that said, I might as well post the whole package of scripts together as one ZIP. Use just the Windows Dimmer, or mix together different scripts for some funky effects! (see the attachment below) Oh, one more thing, just to clear up the context of post #2: it had to do with a question I had regarding any theories or common practices used to adjust brightness without losing contrast or details. WindowsDimmerShadeAndFocus.zip [previous downloads: 137] Changelog: 2013-05-14 + Added _GraphicsIsGammaRampSupported() function which checks if the graphics device supports Gamma Ramps (used by WindowsDimmer.au3). + Small speedup of DLLCalls
-
I am trying to create a script to clean up users' desktops by moving all desktop folders and files (except the two hidden "desktop.ini" files and a MyDesktop.lnk shortcut) to a different folder. The script below will move files but not folders. The other issue with the script is that it doesn't seem to execute from a location other than the user's desktop. I would appreciate any suggestions. #include <File.au3> MsgBox(64, "Desktop", "Cleaning up Desktop. This box will close in 4 seconds.", 4) $Files = _FileListToArray(@DesktopDir,"*",1) For $Index = 1 To $Files[0] If StringRight($Files[$Index],4) <> ".ini, MyDesktop.lnk" Then FileMove($Files[$Index],'F:\HOME\Desktop') EndIf Next
- 4 replies
-
- filemove
- foldermove
-
(and 1 more)
Tagged with:
-
Hey hello. I came here with maybe too specific questions about uncommon things, but as people says, I don't lose anything trying to asking here There's long time that I have a little "experimental" idea: Use windows desktop and it icon system like old videogame consoles (where "sprites" are used to draw things on screen, can be manipulated/animated to make interesting things happen). Some of that inspiration came from another experiments from demoscene. Researching the possibilities of doing something like that (maybe not so intense) I found that the Windows Desktop uses a GuiListView to show and arrange icons (and of course, AutoIt provides UDF's for that ). So, I'm used that UDF to create dummy icons (not putting files on Desktop, just modifiying the "GUI layer" of desktop for put non-working icons), setting custom values like coordinates, name and Icon (from a list of loaded icons in the GuiListView). As you can see in next image works well in Windows XP... even in Windows 95 (that's not the case from Windows Vista to 10, but I already posted another question here about that... anyways, for now I'm working that with a isolated XP machine... sigh). Another video doing an animation with that: How I make that custom icons? Here: $hWnd = ControlGetHandle("Program Manager", "", "[CLASS:SysListView32; INSTANCE:1]") $newItem = _GUICtrlListView_AddItem ( $hWnd, "TEST", 32 ) ; with an icon of index 32 _GUICtrlListView_SetItemPosition ( $hWnd, $newItem, 300, 300 ) ; set some example property. Put in X=300 Y=300 Okay, so the next phase was changing the icons with custom ones. And here starts the issues. As AutoIT help says, icons from GuiListView came from a loaded GUIImageList, which, seeing past images I conclude that it's already preloaded with some sort of most used icons (something like an icon cache?). But If I modify it (or create another GUIImageList and then put into the GuiListView) the icons became corrupted and replaced with blank ones. (can be reverted deleting IconCache.db, just like when windows shows wrong icons in desktop). How I change icons? Here $hImage = _GUIImageList_Create(48, 48, 5) ; create an image list for 48x48 icons $newIcon = _GUIImageList_AddIcon($imageList, @SystemDir & "\shell32.dll", 110) ; just adding a new icon in the image list _GUICtrlListView_SetImageList($hWnd, $hImage, 0) ; $hwnd is the desktop hwnd Another option as workaround for setting icons was getting the desktop GUIImageList, and modifiyng it directly. I otbtain a GUIImageList handle, but ... without any images inside! (That's strange beacuse, when I set desktop item icons without altering the GUIImageList, it applies correctly). And finally if I try to add new ones, it returns -1 with @error setted. How I'm trying to get desktop GUIImageList? Here. $imageList = _GUICtrlListView_GetImageList ( $hWnd, 0 ) MsgBox(0,_GUIImageList_GetImageCount ( $imageList ), $imageList) ; getting image count and GUIImageList handle $newIcon = _GUIImageList_AddIcon($imageList, @SystemDir & "\shell32.dll", 110) ; adding icons without success So, what is the question? There's something wrong I'm doing while trying to set the new icon set on desktop? Or desktop icons work in different way than the rest of the GuiListView's? Or there's something really stupid that I can't saw before that corrupts the icons? Also... if there's not known solution for that, do you have some idea for doing a workaround for that? Or another crazy idea? (Maybe putting real files instead dummy icons could be a solution ... a very slow one). Or even maybe (maybe not, I sure about that xD) do you want to help with this "experiment". Thanks in advance, have a good day
-
- guiimagelist
- guictrllistview
-
(and 3 more)
Tagged with:
-
Hi, How can i make function _ExplorerGetSelectedItems get selecteds items on the Desktop? Func _ExplorerGetSelectedItems($sCabinetWClass="[CLASS:CabinetWClass]") Local $Ret = "" Local $aIndexes, $sSelected, $sSelected_Path Local $hSearch, $sCurrentFile $sSelected_Path = ControlGetText($sCabinetWClass, "", "Edit1") ConsoleWrite($sSelected_Path&@CRLF) $aIndexes = StringSplit(ControlListView($sCabinetWClass, "", "SysListView321", "GetSelected", 1), "|") If $aIndexes[0] = 1 And ($aIndexes[1] == "" Or $aIndexes[1] = 0) Then Return SetError(1, 0, 0) For $i = 1 To $aIndexes[0] $sSelected = ControlListView($sCabinetWClass, "", "SysListView321", "GetText", $aIndexes[$i]) $sCurrentFile = StringRegExpReplace($sSelected_Path, "\\+$", "") & "\" & $sSelected If Not FileExists($sCurrentFile) Then ;Search the extension for file... $hSearch = FileFindFirstFile($sCurrentFile & ".*") If $hSearch <> -1 Then $sSelected = FileFindNextFile($hSearch) FileClose($hSearch) EndIf EndIf ;Check if item is a directory If StringInStr(FileGetAttrib($sCurrentFile), "D") > 0 Then $sSelected = "*"&$sSelected $Ret = $Ret&$sSelected&Chr(10) Sleep(1) Next Return $Ret EndFunc
-
Hello one and all. I am creating a toolbar which reserves 40 pixels of the right-hand side of the screen by updating the "Desktop Work Area" via _WinAPI_SystemParametersInfo, so windows maximize up to it, much like the old Office Toolbar. All worked great, new windows would maximize up to the new border, but existing maximized windows were a problem. Initially I created a slightly noddy function utilising a combination of WinList and WinMove to find any visible maximized windows and adjust them accordingly. While this worked ok, I didn't like it as it felt a bit, well, noddy. I then discovered the 4th parameter of _WinAPI_SystemParametersInfo to send a WM_SETTINGCHANGE message after updating the work area which caused all maximized windows to instantly jump to their new position - great! The Windows API was working for me - I could do away with my noddy function. The trouble I face, however, is that on exit, while I set the work area back to the full width of the desktop, maximized windows aren't taking up the new larger area, unless manually restored down and maximized again. With a bit of experimenting, I've discovered that using this method, maximized windows only respond to the message if the work area is reduced, not increased. I created a little GUI which plays around with this very phenomenon; #include <GUIConstantsEx.au3> #include <GuiListView.au3> #include <StaticConstants.au3> #include <StructureConstants.au3> #include <WinAPI.au3> Global $iLeft, $iTop, $iRight, $iBottom ; Create the GUI GUICreate("WorkArea", 210, 200) GUICtrlCreateLabel("Pixel Amount:", 10, 10, 90, 20, $SS_RIGHT) $Input = GUICtrlCreateInput("40", 110, 8, 90, 20) $Reduce = GUICtrlCreateButton("Reduce", 10, 40, 90, 30) $Increase = GUICtrlCreateButton("Increase", 110, 40, 90, 30) $Reset = GUICtrlCreateButton("Reset", 10, 80, 190, 30) $ListView = GUICtrlCreateListView("Left|Top|Right|Bottom", 10, 120, 190, 50) $WorkArea = GUICtrlCreateListViewItem("", $ListView) _GUICtrlListView_SetColumnWidth($ListView, 0, 33) _GUICtrlListView_SetColumnWidth($ListView, 1, 33) _GUICtrlListView_SetColumnWidth($ListView, 2, 60) _GUICtrlListView_SetColumnWidth($ListView, 3, 60) GUISetState(@SW_SHOW) _GetDesktopWorkArea($iLeft, $iTop, $iRight, $iBottom) ; Loop until message received While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ; Reset the work area to Desktop Width then close _SetDesktopWorkArea($iLeft, $iTop, @DesktopWidth, $iBottom) ExitLoop Case $msg = $Reduce ; Reduce the work area width by the amount in input box $Pixels = GUICtrlRead($Input) _SetDesktopWorkArea($iLeft, $iTop, $iRight-$Pixels, $iBottom) _GetDesktopWorkArea($iLeft, $iTop, $iRight, $iBottom) Case $msg = $Increase ; Increase the work area width by the amount in input box $Pixels = GUICtrlRead($Input) _SetDesktopWorkArea($iLeft, $iTop, $iRight+$Pixels, $iBottom) _GetDesktopWorkArea($iLeft, $iTop, $iRight, $iBottom) Case $msg = $Reset ; Reset the work area to Desktop Width _SetDesktopWorkArea($iLeft, $iTop, @DesktopWidth, $iBottom) _GetDesktopWorkArea($iLeft, $iTop, $iRight, $iBottom) EndSelect WEnd Func _GetDesktopWorkArea(ByRef $iLeft, ByRef $iTop, ByRef $iRight, ByRef $iBottom) Local Const $SPI_GETWORKAREA = 48 Local $tStruct = DllStructCreate($tagRECT) If _WinAPI_SystemParametersInfo($SPI_GETWORKAREA, 0, DllStructGetPtr($tStruct)) Then $iLeft = DllStructGetData($tStruct, "Left") $iRight = DllStructGetData($tStruct, "Right") $iTop = DllStructGetData($tStruct, "Top") $iBottom = DllStructGetData($tStruct, "Bottom") GUICtrlSetData($WorkArea, $iLeft&"|"&$iTop&"|"&$iRight&"|"&$iBottom) Return True EndIf Return False EndFunc ;==>_GetDesktopWorkArea Func _SetDesktopWorkArea($iLeft, $iTop, $iRight, $iBottom) Local Const $SPI_SETWORKAREA = 47 Local Const $SPIF_SENDWININICHANGE = 0x2 Local $tStruct = DllStructCreate($tagRECT) DllStructSetData($tStruct, "Left", $iLeft) DllStructSetData($tStruct, "Right", $iRight) DllStructSetData($tStruct, "Top", $iTop) DllStructSetData($tStruct, "Bottom", $iBottom) If _WinAPI_SystemParametersInfo($SPI_SETWORKAREA, 0, DllStructGetPtr($tStruct), $SPIF_SENDWININICHANGE) Then Return True EndIf Return False EndFunc ;==>_SetDesktopWorkArea Would anyone know why this might be, and indeed if it's possible with another API call to have maximized windows respond in the same way regardless of work area reduction or enlargement? I'm loathe to go back to the noddy function! Many thanks in advance. Valiante. SetDesktopWorkArea.au3
- 5 replies
-
- SPI_SETWORKAREA
- toolbar
-
(and 1 more)
Tagged with:
-
Hey could be interesting to the AutoIt devs out there Will win32 apps (autoit apps) work in the new windows 10 store? Early days yet won't be in the initial win 10 release... Note win32 apps are now called many things - desktop apps - CWA ( Classic Windows Apps - not country womens ..assoc. ) - Project C(entenial) apps These apps will not be sandboxed but NOT be allowed to run as admin , all files will be sandboxed installation handled through the store.. blog link How does this affect autoit - ? FYI following as not supported in Project C apps: “Windows NT Services”,“Things running in the kernel” (device drivers)“System Level Software” (anything not running in the user context)“Elevation”, meaning anything that causes a standard user to get a UAC prompt “will be blocked”.Using parts of other apps in your app, at least in version 1. John indicated that they would like to support extensibility and plug-ins, just probably not initially. The implication was that this might be a direct UWA thing and not specific to Project C, but we can’t be sure. following as supported in Project C apps: “COM”“WMI”“Networking”“Anything else a standard app does that isn’t in the system space”.I am guessing that there are a lot of other things that might end up in the ‘not supported’ list that you might have thought falls under the last item in the supported list but turns out is not supported, but we just don’t know yet: WMI ProvidersWindows Timed and Triggered Events (but they can write new UWA background triggers)Custom ETW ProvidersCOM localsystem (out of process) running as the system to avoid UAC promptsMaybe DCOMSoftware Clients,Application CapabilitiesShell Extensions, Browser Helper Objects, and the like FYI
- 4 replies
-
- windows 10
- cwa
-
(and 2 more)
Tagged with:
-
Two tiny, simple scripts (secondDesktop & desktopSwitch) that elaborate (slightly) on _WinAPI_CreateDesktop() to create a second workspace with some interesting features: Startup: define any number of programmes to be auto-started on the second desktop, hard-coded (by you, in desktopSwitch.au3) or parsed as parameters (from secondDesktop.au3);Full desktop mode: provides acccess to all your desktop shortcuts, start menu (Win7), taskbar, plus a one-button switch in both desktops;Kiosk mode: provides an empty workspace where only your designated startup entries will run; Switch button/GUI is absent; an unadvertised hotkey provides switching to the original desktop (Ctrl-Alt-Del still works, but a task manager started on the second desktop will appear on the original desktop). To enable kiosk mode, set flag $kioskmode=True in secondDesktop.au3;Security: software keyloggers running in your regular environment cannot capture keystrokes on the second desktop, and windows messages cannot be sent between desktops, so your apps won't be hijacked easily through remote control. (NB not extensively tested; use at your own risk!) In full desktop mode, the (red or green) background colour of the Switch GUI shows you whether you are on the exposed or secure desktop.I SecondDesktop.v0.8.7z (first beta release) Important: you'll need to compile desktopSwitch before running secondDesktop. You can test your edited version of desktopSwitch.au3 "dry," as a script on your regular desktop first, by setting its internal flag $testing=True; but don't forget to reset that flag again before compiling.
- 13 replies
-
I'm trying to make a desktop wallpaper application with video support. But stuck at z-order. Any suggestions? How to put autoit window before desktop listview? I'm currently attaching window to the WorkerW. also tried the $HWND_BOTTOM const of _WinAPI_SetWindowPos but when i apply this, win goes invisible. no luck yet any help will be appreciated
- 2 replies
-
- desktop
- background
-
(and 3 more)
Tagged with:
-
Spotlight + Focus GUI's This is the latest experiment dealing with screen-dimming and focus. The spotlight effect works by dimming the entire screen except the small 'spotlight' area where the mouse is, so that you can focus on and read/work on that area with less eyestrain. Its a work in progress, however I've added some tweaks to it to make it a bit more interesting (and potentially useful!). In my experiments, the Spotlight and Focus GUI's are pretty nice when used in combination with RedShiftGUI (portable version here), an eyestrain-relieving color temperature shifter, or my >Windows Dimmer project. Also, a previous, separate, version of the Focus-GUI can be located within the Windows Dimmer zip file. Currently the spotlight + focus script has these features: Spotlight-GUI effect: A circular, rounded-square or rounded-rectangle area of the screen is set to 'full-brightness', while everything around it is dimmed. Locked-Spotlight GUI: Press CTRL+SHIFT+DOWN-ARROW when your have the spotlight area positioned, and it will remain locked in that position until released via the same key (or the Tray menu). Focus-GUI effect: The currently Active window is set to 'full-brightness', while everything around it is dimmed. Locked-Focus GUI: Press CTRL+SHIFT+SPACEBAR to keep the currently active window highlighted. Note this only keeps the rectangle visible, so any other windows overlapping the Focused GUI will have partial highlighting. Crosshair Mouse Cursor: All mouse cursors (save for resize-window cursors) are replaced with a simple crosshair. This provides a nice aesthetic compliment to the spotlight effect. (An optional diagonal X-hair is available, as well as no mouse icons at all - see source) Tweaks via the Tray that are persistent on NTFS systems (see below). Much more can be done here with tweaks - dimming percentages, focus-area sizes, etc Current control-focus following is not implemented: The Spotlight GUI only tracks mouse movement at the moment. Tracking the 'active' control focus (using mouse or keyboard) like Windows Magnifier does requires a bit more work; initial experiments indicate that GetGUIThreadInfo on 'Active' window can often make this possible but some apps don't report info correctly and need something like MSAA or UIAutomation (see >IUIAutomation MS framework by junkew). In the extreme, one can also hook the Mouse and Keyboard events but it still won't give the accurate keyboard focus information for different programs. Settings as adjusted in the tray will be persisted only on NTFS file systems. This can easily be changed, but its there to show one use of NTFS's Alternate Data Streams. The INI idea was inspired by nullscrhitt's '>Save INI data to exe. (while open)' thread. Also check out trancexx's '>Alternate Data Streams Viewer' if you'd like to see 'what lies beneath', or install a shell extension such as 'AltStreamOverlay' which lets you view it in the Windows properties dialog. For a list of ADS info on all files in a folder, check out AlternateStreamView @ Nirsoft. Things to note with this code: Certain windows will fight for topmost status. This is an annoying problem with Windows which there isn't any easy workaround. Its only temporary though; it will restore itself within another iteration of the Main loop. CTRL+SHIFT+DOWN-ARROW will toggle locking the Spotlight GUI in place. Also available in the Tray menu. CTRL+SHIFT+SPACEBAR will toggle locking the Focus GUI to a specific Window. Also available in the Tray menu. CTRL+ALT+Q will exit the program. 'Exit' in the Tray menu will do the same. Anyway, here's the codes! Changelog: #include <WinAPI.au3> #include <WinAPIGdi.au3> #include <WinAPISys.au3> ;#include <_MouseFunctions.au3> ; (Functions embedded) ; =============================================================================================================================== ; <WindowsSpotlightFocusGUI.au3> ; ; Spotlight/Focus GUI: Choose from 2 different styles of GUI 'focus': ; 1. 'Spotlight' GUI: Everything but a circular (or rounded-rect) 'hole' is dimmed, creating a spotlight effect on ; the screen where the mouse is focused. (created using a GUI 2x the size of the screen with a 'hole' Region) ; 2. 'Focus' GUI: Everything except the Active Window is dimmed. This is like a dynamically sized version of ; a 'Rect' Spotlight GUI which resizes/moves itself to the current Active window. ; ; Note the Spotlight GUI doesn't take into account keyboard focus, which would actually round out this script! ; ; To DO: ; - Make spotlight also follow keyboard focus when appropriate (when typing) ; ; To lock/unlock Spotlight GUI: ; - Ctrl+Shift+DOWN hotkey (Ctrl+Alt+Down won't work for some reason) ; To lock/unlock Focus GUI (to a specific window): ; - Ctrl+Shift+SPACE hotkey ; ; To Exit: ; - Use Tray menu or Ctrl+Alt+Q hotkey code ; ; Tweakables: ; - STYLE / COLOR / TRANSPARENCY Settings ; $nSpotlightStyle: 0 = Circle Spotlight, 1 = Rounded-Rect, 2 = Wide-Rect ; $nSpotlightDiameter: the size of the circular spotlight 'hole' surrounding the mouse (mouse is centered in this area) ; $nSpotlightSqDiameter: Rounded-rect width/height ; $nSpotlightRectWidth/Height: Wide-Rect width/height ; $nShadeColor: color of the 'shade' GUI. Seems anything grayscale works well (RGB: 0x000000, 0x111111, 0xFFFFFF) ; $n{..}Transparency: level of transparency. From 0-255, with 0 = invisible and 255 = solid (BAD!) ; $nRoundRectCornerWidth: Rounded-Rect corners' circle width/height ; ; NTFS ADS Info: ; "Alternate Data Streams Viewer" by trancexx ; @ http://www.autoitscript.com/forum/topic/149659-alternate-data-streams-viewer/ ; "Save INI data to exe. (while open)" by nullschritt ; @ http://www.autoitscript.com/forum/topic/155669-save-ini-data-to-exe-while-open/ ; ; See also: ; <WindowsDimlightShadedFocusGUI.au3> ; Basically the reverse of this - a dimmed circle GUI follows the mouse, ; ; creating a reverse-spotlight effect (or a dim-light affect if u will) ; Author: Ascend4nt ; =============================================================================================================================== ; Singleton code: Global Const $sSINGLETON_STRING = "Spotlight[0bc53fe0-59c2-11e2-bcfd-0800200c9a66]" If WinExists($sSINGLETON_STRING) Then Exit AutoItWinSetTitle($sSINGLETON_STRING) ; ==================================================================================================== ; STYLE / COLOR / TRANSPARENCY Settings ; ==================================================================================================== Global Const $nSpotlightStyle = 1 ; 0 = Circle, 1 = Rounded Rect, 2 = Wide Rect Global Const $nSpotlightDiameter = 500 Global Const $nSpotlightSqDiameter = 450 Global Const $nSpotlightRectWidth = 800, $nSpotlightRectHeight = 320 Global Const $nShadeColor = 0 Global Const $nSpotlightTransparency = 110, $nFocusTransparency = 110 Global Const $nRoundRectCornerWidth = 16 Global Const $nSpotlightXHairState = 0 ; 0 = No Spotlight-XHair, 1 = Full, 2 = Horizontal ( - ), 3 = Vertical ( | ) Global Const $nSpotlightXHairDiameter = 4 ; This is divided by 2 and the Spotlight X-Hair will be offset by this from center (use even #'s) Global Const $nSpotlightXHairYOffset = 0 ; 8-10 is nice for hovering under most lines of text ; Global Const $nSpotlightXHairXOffset = 0 ; ?? offseting X seems a bit odd and not very useful ; ==================================================================================================== ; GLOBAL VARIABLES ; ==================================================================================================== Global $g_bHKPressed = False Global $g_aINISettings = 0 Global $g_bFocusOn = 0, $g_bSpotlightOn = 1 Global $g_nSpotlightStyle = $nSpotlightStyle ; 0 = Circle, 1 = Rounded Rect, 2 = Wide Rect Global $g_nMouseCursorState = 1 ; -1 = Default Cursors, 0 = Hidden Cursors, 1 = CrossHair Cursor Global $g_aCursorStateSelect[3] ; Cursor State Tray ID's Global $g_nSpotlightXHairState = $nSpotlightXHairState ; 0 = No Spotlight-XHair, 1 = Full, 2 = Horizontal ( - ), 3 = Vertical ( | ) Global $g_aSpotlightXHairSelect[4] ; Spotlight-XHair State Tray ID's Global $g_hSpotlightGUI = 0, $g_hFocusGUI = 0, $g_nTransitions = 0, $g_nActiveGUICount = 0, $g_hLastActiveWin = 0 Global $g_aSpotLockDown[4] = [0, 0, 0, 0] ; Spotlight Lockdown: toggle, Center-X, Center-Y location, Tray ID # Global $g_ctFocusLock = 0, $g_hFocusLockDown = -1 Global $g_iResolutionChangeMsg = 0 ; This array will be updated with resolution changes, as well as some GUI rebuilds Global $g_aVScrRect[4] = [0, 0, @DesktopWidth, @DesktopHeight] Global $g_hGDI32DLL = DllOpen("gdi32.dll"), $g_hUSER32DLL = DllOpen("user32.dll") ; Global Vars quick-exit test If ($g_hGDI32DLL = -1 Or $g_hUSER32DLL = -1) Then Exit ; ############################################### #Region MOUSE_FUNCTIONS_PARTIAL_UDF_DATA ; Mouse-Replace Cursor handles (associative with Cursor ID's). See 'Standard Cursor IDs' in _MouseFunctions UDF Global $MCF_aSysCursors[16][2] = [ _ [32512, 0],[32513, 0],[32514, 0],[32515, 0],[32516, 0],[32640, 0],[32641, 0],[32647, 0],[32648, 0],[32649, 0],[32650, 0], _ [32642, 0],[32643, 0],[32644, 0],[32645, 0],[32646, 0]] ; Sizing cursors Global $MCF_bCursorsReplaced = False #EndRegion MOUSE_FUNCTIONS_PARTIAL_UDF_DATA ; ############################################### ; /**************************************************************************************************/ #Region MAIN_CODE _WinMain() Func _WinMain() ; Initialize Global Width/Height vars _VirtualScreenSizeUpdate() ;AutoItWinSetTitle("WindowSpotlightFocusGUI("&@AutoItPID&")") ; would cancel out or Singleton test ; Move the invisible window off-screen (mostly). This was mainly because in tests, the AutoIt invisible window ; would *actually* beomme the ACTIVE window. (Mainly when the tray icon is clicked and loses focus in some way) WinMove(AutoItWinGetTitle(), "", $g_aVScrRect[0]+$g_aVScrRect[2]-1, $g_aVScrRect[1]+$g_aVScrRect[3]-1) Opt("TrayAutoPause", 0) Opt("TrayOnEventMode", 1) Opt("TrayMenuMode", 1) ;+2) ; We want toggled and radio button automatic behavior Opt("GUIOnEventMode", 1) ; Logic check (before reading INI) If $g_nMouseCursorState And $g_nSpotlightXHairState Then $g_nMouseCursorState = 0 ; Restore INI data (and save on program exit) if this script is compiled ; (and the folder is writable) - uses NTFS ADS (Alternate Data Streams) If @Compiled Then _INI_UpdateDataFromExeINI() OnAutoItExitRegister("_INI_SaveDataToExeINI") EndIf ; #--------- TRAY MENU SETUP --------------# ;TraySetClick(9) ; 9 is Default (left or right mouse-click) TrayCreateItem("Rounded-Rect Spotlight", -1, -1, 1) TrayItemSetOnEvent(-1, "_RoundRectSpotlight_TEvt") If $g_nSpotlightStyle = 1 Then TrayItemSetState(-1, 1) TrayCreateItem("Wide-Rect Spotlight", -1, -1, 1) TrayItemSetOnEvent(-1, "_WideRectSpotlight_TEvt") If $g_nSpotlightStyle = 2 Then TrayItemSetState(-1, 1) TrayCreateItem("Circle Spotlight", -1, -1, 1) TrayItemSetOnEvent(-1, "_CircleSpotlight_TEvt") If $g_nSpotlightStyle = 0 Then TrayItemSetState(-1, 1) TrayCreateItem("") $g_aSpotlightXHairSelect[0] = TrayCreateItem("Spotlight Crosshair - NONE", -1, -1, 1) $g_aSpotlightXHairSelect[1] = TrayCreateItem("Spotlight Crosshair - FULL (+)", -1, -1, 1) $g_aSpotlightXHairSelect[2] = TrayCreateItem("Spotlight Crosshair - Horizontal (-)", -1, -1, 1) $g_aSpotlightXHairSelect[3] = TrayCreateItem("Spotlight Crosshair - Vertical ( | )", -1, -1, 1) TrayItemSetState($g_aSpotlightXHairSelect[$g_nSpotlightXHairState], 1) For $i = 0 To 3 TrayItemSetOnEvent($g_aSpotlightXHairSelect[$i], "_SpotlightXHairSelect_TEvt") Next TrayCreateItem("") $g_aSpotLockDown[3] = TrayCreateItem("Lock Spotlight Position (CTRL+SHIFT+DOWN)") TrayItemSetOnEvent(-1, "_LockUnlockSpotlight") If $g_aSpotLockDown[0] Then TrayItemSetState(-1, 1) $g_ctFocusLock = TrayCreateItem("Lock Focus GUI to Window (CTRL+SHIFT+SPACE)") TrayItemSetOnEvent(-1, "_LockUnlockFocus") ; Saving Focus Lockdown windows between runs is iffy, as we obviously can't save the HWND ; We CAN save Classname, Title (not wise as titles change), and Window Styles (also can change), ; but as there can be more than 1 window of a given Class, and Titles & Windows Styles can change ; it really doesn't make much sense ;If IsHWnd($g_hFocusLockDown) Then TrayItemSetState(-1, 1) TrayCreateItem("") $g_aCursorStateSelect[0] = TrayCreateItem("Mouse Cursor - Defaults", -1, -1, 1) $g_aCursorStateSelect[1] = TrayCreateItem("Mouse Cursor - Hidden", -1, -1, 1) $g_aCursorStateSelect[2] = TrayCreateItem("Mouse Cursor - CrossHair", -1, -1, 1) TrayItemSetState($g_aCursorStateSelect[$g_nMouseCursorState + 1], 1) For $i = 0 To 2 TrayItemSetOnEvent($g_aCursorStateSelect[$i], "_MouseCursorSelect_TEvt") Next TrayItemSetOnEvent(-1, "_MouseCursorSelect_TEvt") TrayCreateItem("") TrayCreateItem("Toggle Spotlight") TrayItemSetOnEvent(-1, "_ToggleSpotlight_TEvt") If $g_bSpotlightOn Then TrayItemSetState(-1, 1) TrayCreateItem("Toggle Window-Focus") TrayItemSetOnEvent(-1, "_ToggleFocus_TEvt") If $g_bFocusOn Then TrayItemSetState(-1, 1) TrayCreateItem("") TrayCreateItem("Exit") TrayItemSetOnEvent(-1, "_Exit_TEvt") TraySetState() TraySetToolTip("Windows Spotlight GUI (click for options)") ; #----------------- X ---------------------# ; CTRL-ALT-Q Exit Hotkey HotKeySet("!^q", "_HotKeyPressed") ; CTRL-SHIFT-DOWN Lock/Release Spotlight Hotkey HotKeySet("+^{DOWN}", "_LockUnlockSpotlight") ; CTRL-SHIFT-SPACE Lock/Release Focus-Window Hotkey HotKeySet("+^{SPACE}", "_LockUnlockFocus") ; ----------------------------------------------------------------------------------------------------| ; Register Display-Mode changes to our function. ; NOTE that a GUI (*any* GUI) MUST be created or else the WM_DISPLAYCHANGE message won't be received ; UPDATE: Can't do it this way - we need to know exactly how many GUI's area active ; (hence a global count and the _GUICountChange() function. ; ----------------------------------------------------------------------------------------------------| ;GUIRegisterMsg(0x007E, "_ResolutionChanged") ; WM_DISPLAYCHANGE 0x007E ; Update GUI Count and register Rez-Chg message if any active _GUICountChange() ; Cursor State ;~ If $g_nMouseCursorState < 0 Then ; Normal Cursors ;Else If $g_nMouseCursorState = 0 Then _MouseHideAllCursors() Else _MouseReplaceAllCursors(True) EndIf ; Setup mouse cursor restore function on exit (regarldess of setting): OnAutoItExitRegister("_MouseRestoreAllCursors") ; Not necessary, but can free some memory by flushing data to disk DllCall("psapi.dll", "bool", "EmptyWorkingSet", "handle", -1) Local $iRezChg = 0, $hTopMostWnd = 0 ; Main loop While 1 If $g_bHKPressed Then ExitLoop ; Exit on 'ESC' keypress (BitAND() test for down-state) ;If BitAND(_WinAPI_GetAsyncKeyState(0x1B), 0x8000) Then ExitLoop ; Reset RezChg Message to be sent $iRezChg = 0 ; Rez change? Update metrics if necessary amount of Rez-Change Messages received (1 per GUI) If $g_iResolutionChangeMsg And $g_iResolutionChangeMsg = $g_nActiveGUICount Then ConsoleWrite("Main Loop WM_DISPLAYCHANGE detected, $g_iResolutionChangeMsg = " & $g_iResolutionChangeMsg & @LF) _VirtualScreenSizeUpdate() $g_iResolutionChangeMsg = 0 $iRezChg = 1 EndIf ; Mouse/Keyboard-Cursor Spotlight GUI Active? ; *Note: Call this FIRST as it gets the current Mouse position* If $g_bSpotlightOn Then _SpotlightGUIUpdate($iRezChg) EndIf ; Window-Focus GUI active? If $g_bFocusOn Then _FocusGUIUpdate($iRezChg) EndIf ; Check the topmost status and reset our GUI's if necessary ; This was taken out of main Update loops, as there can be a bit of flashing when moving windows $hTopMostWnd = _WinAPI_GetTopWindow(0) If $g_hSpotlightGUI <> $hTopMostWnd And $g_hFocusGUI <> $hTopMostWnd Then ;ConsoleWrite("WinOnTop hWnd = " & $hTopMostWnd & ", Title = " & WinGetTitle($hTopMostWnd) & @LF) If $g_bSpotlightOn Then WinSetOnTop($g_hSpotlightGUI, "", 1) If $g_bFocusOn Then WinSetOnTop($g_hFocusGUI, "", 1) EndIf Sleep(20) WEnd ; Unregister Display Mode change function ;GUIRegisterMsg(0x007E, "") ; WM_DISPLAYCHANGE 0x007E ; And restore all system cursors back to normal (called automatically via OnAutoItExitRegister) ;_MouseRestoreAllCursors() EndFunc #EndRegion MAIN_CODE ; /**************************************************************************************************/ ; ############################################### #Region MISC_FUNCTIONS ; _GUICountChange() -> adjust counts and set/unset DisplayChange Messages Func _GUICountChange() Local $iTotalActiveGUIs = 0 ; Maximum 2 GUI's If $g_bFocusOn Then $iTotalActiveGUIs += 1 If $g_bSpotlightOn Then $iTotalActiveGUIs += 1 If $iTotalActiveGUIs = 0 Then ; Was there previously GUI's active? If $g_nActiveGUICount Then ; UnRegister Rez-Chg message GUIRegisterMsg(0x007E, "") ; WM_DISPLAYCHANGE 0x007E ConsoleWrite("0 GUI's active, WM_DISPLAYCHANGE unregistered" & @LF) EndIf Else ; Were no GUI's active previously? If $g_nActiveGUICount = 0 Then ; Register Rez-Chg message GUIRegisterMsg(0x007E, "_ResolutionChanged") ; WM_DISPLAYCHANGE 0x007E ConsoleWrite($iTotalActiveGUIs & " GUI's active, WM_DISPLAYCHANGE registered" & @LF) EndIf WinSetTrans($g_hFocusGUI, "", $g_bSpotlightOn ? ($nFocusTransparency / 2) : $nFocusTransparency) WinSetTrans($g_hSpotlightGUI, "", $g_bFocusOn ? ($nSpotlightTransparency / 2) : $nSpotlightTransparency) EndIf ; Update global count now that we've compared states $g_nActiveGUICount = $iTotalActiveGUIs EndFunc Func _VirtualScreenSizeUpdate() ; Set up VScreen Coords: 0, 1 = Upper Left X, Y (CAN be negative!!!), 2, 3 = Virtual Width, Height ; SM_XVIRTUALSCREEN = 76, SM_YVIRTUALSCREEN = 77, SM_CXVIRTUALSCREEN = 78, SM_CYVIRTUALSCREEN = 79 Dim $g_aVScrRect[4] = [_WinAPI_GetSystemMetrics(76), _WinAPI_GetSystemMetrics(77), _WinAPI_GetSystemMetrics(78), _WinAPI_GetSystemMetrics(79)] If $g_aVScrRect[2] = 0 Then $g_aVScrRect[2] = @DesktopWidth If $g_aVScrRect[3] = 0 Then $g_aVScrRect[3] = @DesktopHeight ConsoleWrite("VirtualScreen X: " & $g_aVScrRect[0] & ", Y: " & $g_aVScrRect[1] & ", Width = " & $g_aVScrRect[2] & ", Height = " & $g_aVScrRect[3] & @LF) ; Alternative Way to get Virtual Screen Width/Height: CreateDC with 'DISPLAY', GetDeviceCape(8) [HORZRES] and (10) [VERTRES], DeleteDC() EndFunc #EndRegion MISC_FUNCTIONS ; ############################################### ; ############################################### #Region HOTKEY_FUNCTIONS Func _HotKeyPressed() ; CTRL-ALT-Q Key Pressed: $g_bHKPressed = True EndFunc ;==>_HotKeyPressed Func _LockUnlockSpotlight() ; Off? Turn Lockdown on then If Not $g_aSpotLockDown[0] Then Local $aMousePos = MouseGetPos() $g_aSpotLockDown[1] = $aMousePos[0] $g_aSpotLockDown[2] = $aMousePos[1] TrayItemSetState($g_aSpotLockDown[3], 1) Else TrayItemSetState($g_aSpotLockDown[3], 4) EndIf $g_aSpotLockDown[0] = Not $g_aSpotLockDown[0] ;ConsoleWrite("Lock/Unlock Spotlight Hotkey Pressed (or Menu item selected)" & @LF) EndFunc Func _LockUnlockFocus() ; Off? Turn Lockdown on then If $g_hFocusLockDown <= 0 Then ; Set the active window even when Focus window isn't on If Not $g_bFocusOn Then $g_hLastActiveWin = WinGetHandle("[ACTIVE]") $g_hFocusLockDown = $g_hLastActiveWin TrayItemSetState($g_ctFocusLock, 1) Else $g_hFocusLockDown = -1 ;$g_hLastActiveWin = -1 TrayItemSetState($g_ctFocusLock, 4) EndIf ;ConsoleWrite("Lock/Unlock Focus GUI Hotkey pressed" & @LF) EndFunc #EndRegion HOTKEY_FUNCTIONS ; ############################################### ; ############################################### #Region WINDOWS_MESSAGE_HANDLER_FUNCTIONS ; ==================================================================================================== ; Func _ResolutionChanged($hWnd,$iMsg,$wParam,$lParam) ; ; Note this registers multiple-monitor settings changes too, but will only report on the primary monitor's resolution ; This is why we would need to call _WinAPI_GetSystemMetrics() to get the Virtual width/height ; ==================================================================================================== Func _ResolutionChanged($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $wParam, $lParam ; Apparently under certain circumstances, we can receive more messages than GUI's!! If $g_iResolutionChangeMsg < $g_nActiveGUICount Then $g_iResolutionChangeMsg += 1 ;~ ConsoleWrite("_ResolutionChanged msg recieved, $g_iResolutionChangeMsg = " & $g_iResolutionChangeMsg & @LF) Return 'GUI_RUNDEFMSG' ; From <GUIConstantsEx.au3> Global Const $GUI_RUNDEFMSG = 'GUI_RUNDEFMSG' EndFunc ;==>_ResolutionChanged #EndRegion WINDOWS_MESSAGE_HANDLER_FUNCTIONS ; ############################################### ; ############################################### #Region TRAY_EVENT_HANDLER_FUNCS Func _RoundRectSpotlight_TEvt() If $g_nSpotlightStyle <> 1 Then $g_nSpotlightStyle = 1 If $g_bSpotlightOn Then _SpotlightGUIUpdate(1) EndIf EndFunc Func _WideRectSpotlight_TEvt() If $g_nSpotlightStyle <> 2 Then $g_nSpotlightStyle = 2 If $g_bSpotlightOn Then _SpotlightGUIUpdate(1) EndIf EndFunc Func _CircleSpotlight_TEvt() If $g_nSpotlightStyle Then $g_nSpotlightStyle = 0 If $g_bSpotlightOn Then _SpotlightGUIUpdate(1) EndIf EndFunc Func _MouseCursorSelect_TEvt() Switch @TRAY_ID Case $g_aCursorStateSelect[0] $g_nMouseCursorState = -1 _MouseRestoreAllCursors() Case $g_aCursorStateSelect[1] $g_nMouseCursorState = 0 _MouseHideAllCursors() Case $g_aCursorStateSelect[2] $g_nMouseCursorState = 1 _MouseReplaceAllCursors(True) EndSwitch ; This will remain in effect regardless of Mouse Cursor state (harmless): ;OnAutoItExitRegister("_MouseRestoreAllCursors") EndFunc Func _SpotlightXHairSelect_TEvt() Local $nPrevState = $g_nSpotlightXHairState Switch @TRAY_ID Case $g_aSpotlightXHairSelect[0] ; NO X-Hair Spotlight $g_nSpotlightXHairState = 0 Case $g_aSpotlightXHairSelect[1] ; FULL X-Hair Spotlight $g_nSpotlightXHairState = 1 Case $g_aSpotlightXHairSelect[2] ; Horizontal X-Hair Spotlight $g_nSpotlightXHairState = 2 Case $g_aSpotlightXHairSelect[3] ; Vertical X-Hair Spotlight $g_nSpotlightXHairState = 3 EndSwitch If $nPrevState <> $g_nSpotlightXHairState And $g_bSpotlightOn Then GUIDelete($g_hSpotlightGUI) ; Force re-initialization $g_hSpotlightGUI = 0 ; For the sake of sanity, adjust mouse cursors based on FULL/No X-Hair toggles ; If SpotlightXHairState is now disabled, and all Mouse Cursors are currently hidden, reenable at least the crosshair cursor If $g_nSpotlightXHairState = 0 And $g_nMouseCursorState = 0 Then ConsoleWrite("X-HAIR - MOUSE SANITY: Spotlight XHair Turned OFF, Mouse Cursors Hidden! ACTION: Enabling Crosshair cursors" & @LF) $g_nMouseCursorState = 1 _MouseReplaceAllCursors(True) TrayItemSetState($g_aCursorStateSelect[0], 4) TrayItemSetState($g_aCursorStateSelect[1], 4) TrayItemSetState($g_aCursorStateSelect[2], 1) ; If SpotlightXHairState is now fully enabled, and Mouse Cursors are currently the Crosshair cursor, choose to hide all cursors ElseIf $g_nSpotlightXHairState = 1 And $g_nMouseCursorState = 1 Then ConsoleWrite("X-HAIR - MOUSE SANITY: Spotlight XHair Turned FULLY ON, Mouse Cursors CrossHair is Active! ACTION: Disabling Crosshair cursors.. too presumptive?" & @LF) $g_nMouseCursorState = 0 _MouseHideAllCursors() TrayItemSetState($g_aCursorStateSelect[1], 1) TrayItemSetState($g_aCursorStateSelect[0], 4) TrayItemSetState($g_aCursorStateSelect[2], 4) EndIf _SpotlightGUIUpdate() EndIf EndFunc Func _ToggleSpotlight_TEvt() If $g_bSpotlightOn Then GUIDelete($g_hSpotlightGUI) ; Force re-initialization next time $g_hSpotlightGUI = 0 ; For the sake of sanity, adjust mouse cursors based on FULL/No X-Hair toggles ; If SpotlightXHairState was on, but now the GUI is disabled, and if all Mouse Cursors are currently hidden, reenable at least the crosshair cursor If $g_nSpotlightXHairState And $g_nMouseCursorState = 0 Then ConsoleWrite("X-HAIR - MOUSE SANITY: Spotlight GUI being turned OFF, Mouse Cursors Hidden! ACTION: Enabling Crosshair cursors" & @LF) $g_nMouseCursorState = 1 _MouseReplaceAllCursors(True) TrayItemSetState($g_aCursorStateSelect[0], 4) TrayItemSetState($g_aCursorStateSelect[1], 4) TrayItemSetState($g_aCursorStateSelect[2], 1) EndIf Else _SpotlightGUIUpdate() EndIf $g_bSpotlightOn = Not $g_bSpotlightOn ; Update GUI Counts, and Rez-Chg handler if necessary _GUICountChange() EndFunc Func _ToggleFocus_TEvt() If $g_bFocusOn Then GUIDelete($g_hFocusGUI) ; Force re-initialization next time $g_hFocusGUI = 0 ; Prevent sticky situations where transitions are confused with GUI re-init's $g_nTransitions = 0 Else _FocusGUIUpdate() EndIf $g_bFocusOn = Not $g_bFocusOn ; Update GUI Counts, and Rez-Chg handler if necessary _GUICountChange() EndFunc Func _Exit_TEvt() Exit EndFunc #EndRegion TRAY_EVENT_HANDLER_FUNCS ; ############################################### ; ############################################### #Region INI_IN_EXE_FUNCS ; ================================================================================================================= ; Func _INI_SaveDataToExeINI() ; ; Writes settings to NTFS ADS Stream INI file (NTFS file systems only) ; NOTE: Write access to folder is required (I think this type of write is the same as regular file access) ; ; Author: Ascend4nt, based nullschritt's 'Save INI data to exe' functions ; ================================================================================================================= Func _INI_SaveDataToExeINI() ;If 1 Then If @Compiled Then Local $sNTFS_ADS_File = @ScriptFullPath&':'&"INI_DATA" ;IniWrite($sNTFS_ADS_File, "Settings", "SpotlightStyle", $g_nSpotlightStyle) ; Build array (Number casts for True->1 and False->0 conversions) Local $aINISettingsOut[6][2] = [ [5, 0], _ ["FocusOn", Number($g_bFocusOn)], ["SpotlightOn", Number($g_bSpotlightOn)], ["SpotlightStyle", Number($g_nSpotlightStyle)], _ ["MouseCursorsState", Number($g_nMouseCursorState)], ["SpotlightXHairState", Number($g_nSpotlightXHairState)] ] ; Prevent unnecessary write by comparing IN settings vs OUT settings: Local $bSame = False ; Both arrays, both equal element counts? If IsArray($g_aINISettings) And $g_aINISettings[0][0] = $aINISettingsOut[0][0] Then Local $iMatches = 0 For $i = 1 To $aINISettingsOut[0][0] If $g_aINISettings[$i][0] = $aINISettingsOut[$i][0] And _ $g_aINISettings[$i][1] = $aINISettingsOut[$i][1] Then $iMatches += 1 Next If $iMatches = $aINISettingsOut[0][0] Then $bSame = True EndIf If Not $bSame Then ;ConsoleWrite("Determined settings have changed! Writing INI data.." & @CRLF) IniWriteSection($sNTFS_ADS_File, "Settings", $aINISettingsOut) EndIf EndIf EndFunc ; ================================================================================================================= ; Func _INI_UpdateDataFromExeINI() ; ; Reads settings from NTFS ADS Stream INI file (NTFS file systems only) ; ; Author: Ascend4nt, based nullschritt's 'Save INI data to exe' functions ; ================================================================================================================= Func _INI_UpdateDataFromExeINI() ;If 1 Then If @Compiled Then Local $sNTFS_ADS_File = @ScriptFullPath&':'&"INI_DATA" If FileExists($sNTFS_ADS_File) Then ;$g_nSpotlightStyle = IniRead($sNTFS_ADS_File, "Settings", "SpotlightStyle", 1) $g_aINISettings = IniReadSection($sNTFS_ADS_File, "Settings") If @error Or $g_aINISettings[0][0] < 5 Then $g_aINISettings = 0 Return Else ;ConsoleWrite("FocusOn Key = " & $g_aINISettings[1][0] & ", value = " & $g_aINISettings[1][1] & @LF) $g_bFocusOn = Number($g_aINISettings[1][1]) ;ConsoleWrite("Spotlight Key = " & $g_aINISettings[2][0] & ", value = " & $g_aINISettings[2][1] & @LF) $g_bSpotlightOn = Number($g_aINISettings[2][1]) $g_nSpotlightStyle = Abs(Number($g_aINISettings[3][1])) ; 0 = Circle, 1 = Rounded Rect, 2 = Wide Rect ; Sanity Check If $g_nSpotlightStyle > 2 Then $g_nSpotlightStyle = 2 $g_nMouseCursorState = Number($g_aINISettings[4][1]) ; Sanity Check If $g_nMouseCursorState < 0 Then $g_nMouseCursorState = -1 ElseIf $g_nMouseCursorState > 0 Then $g_nMouseCursorState = 1 EndIf $g_nSpotlightXHairState = Abs(Number($g_aINISettings[5][1])) ; Sanity Check If $g_nSpotlightXHairState > 3 Then $g_nSpotlightXHairState = 0 EndIf EndIf EndIf EndFunc #Region INI_IN_EXE_FUNCS ; ############################################### ; ############################################### #Region SPOTLIGHT_FUNCTIONS ; ================================================================================================================= ; Func _SpotlightGUIUpdate($bForceRecreate = False) ; ; Author: Ascend4nt ; ================================================================================================================= Func _SpotlightGUIUpdate($bForceRecreate = False) If Not $g_bSpotlightOn Then Return ; Keep all data local Local Static $aLastMousePos = 0, $aMousePos = 0 ; Need this Global so we can delete the GUI outside of function ;Local Static $hSpotlightGUI = 0 If $g_aSpotLockDown[0] Then $aMousePos[0] = $g_aSpotLockDown[1] $aMousePos[1] = $g_aSpotLockDown[2] Else $aMousePos = MouseGetPos() EndIf ; Initializing? Or Force-Recreate Flag set (possibly Resolution Change)? If $g_hSpotlightGUI = 0 Or $bForceRecreate Then ConsoleWrite("Recreating GUI, $g_hSpotlightGUI = " & $g_hSpotlightGUI & ", $bForceRecreate = " & $bForceRecreate & @LF) ;$aMousePos = MouseGetPos() $aLastMousePos = $aMousePos ; Extra precaution for corner cases where GUI's might activate after a Display Change while no WM_DISPLAYCHANGE handler was in effect _VirtualScreenSizeUpdate() _SpotlightGUIRecreate($aMousePos) ; If we rebuilt the GUI, no need to check for changes in position Else ; Movement? If $aMousePos[0] <> $aLastMousePos[0] Or $aMousePos[1] <> $aLastMousePos[1] Then ;ConsoleWrite("<>") WinMove($g_hSpotlightGUI, "", $aMousePos[0] - $g_aVScrRect[2] + 1, $aMousePos[1] - $g_aVScrRect[3] + 1) ; (Topmost check in main loop as there can be flashing with other GUI's fighting for topmost status) ;WinSetOnTop($g_hSpotlightGUI, "", 1) $aLastMousePos = $aMousePos #cs ;~ Else ; Otherwise lets check the topmost status and adjust if necessary ; (Logic moved to main loop as there can be flashing with other GUI's fighting for topmost status) ;~ Local $hWnd = _WinAPI_GetTopWindow(0) ;~ If $g_hSpotlightGUI <> $hWnd Then ;~ ;ConsoleWrite("WinOnTop hWnd = " & $hWnd & ", Title = " & WinGetTitle($hWnd) & @LF) ;~ WinSetOnTop($g_hSpotlightGUI, "", 1) ;~ EndIf #ce EndIf EndIf EndFunc ; ================================================================================================================= ; Func _SpotlightGUIRecreate($aMousePos) ; ; Author: Ascend4nt ; ================================================================================================================= Func _SpotlightGUIRecreate($aMousePos) If $g_hSpotlightGUI Then GUIDelete($g_hSpotlightGUI) Local $iWidth, $iHeight ; Spotlight Style 0 = Circle, 1 = Round-REct, 2 = Wide-Rect. [Hmm.. Wide Circle?] If $g_nSpotlightStyle Then If $g_nSpotlightStyle = 1 Then $iWidth = $nSpotlightSqDiameter $iHeight = $nSpotlightSqDiameter Else $iWidth = $nSpotlightRectWidth $iHeight = $nSpotlightRectHeight EndIf Else $iWidth = $nSpotlightDiameter $iHeight = $iWidth EndIf ; If even width/height, add 1 so that boxes align to mouse cursor ; ( width of 2 would result in 1 pixel on mouse position, 1 off. otherwise an odd # would mean 2 outside, 1 on) $iWidth += BitXOR(BitAND($iWidth, 1), 1) $iHeight += BitXOR(BitAND($iHeight, 1), 1) $g_hSpotlightGUI = _GUIShapeCreateHolePunchGUI($aMousePos[0] - $g_aVScrRect[2] + 1, $aMousePos[1] - $g_aVScrRect[3] + 1, _ $g_aVScrRect[2] * 2 +1, $iWidth, $g_aVScrRect[3] * 2 +1, $nShadeColor, $iHeight) WinSetTrans($g_hSpotlightGUI, "", $g_bFocusOn ? ($nSpotlightTransparency / 2) : $nSpotlightTransparency) ;xx nvm Careful: We don't want to compete with a Focus-Window GUI ;xx If Not $g_bFocusOn Then WinSetOnTop($g_hSpotlightGUI, "", 1) ;GUISetState(@SW_SHOWNOACTIVATE, $g_hSpotlightGUI) WinSetState($g_hSpotlightGUI, "", @SW_SHOWNOACTIVATE) Return EndFunc ;==>_SpotlightGUIRecreate ; ================================================================================================================= ; Func _GUIShapeCreateHolePunchGUI($iX, $iY, $iBoxSzX, $iHoleXDiameter, $iBoxSzY = Default, $iBkColor = Default, ; $iHoleYDiameter = Default) ; ; Author: Ascend4nt ; ================================================================================================================= Func _GUIShapeCreateHolePunchGUI($iX, $iY, $iBoxSzX, $iHoleXDiameter, $iBoxSzY = Default, $iBkColor = Default, $iHoleYDiameter = Default) Local $hGUI, $hRectRgn = 0, $hEllipseHollowRgn = 0, $hXLineRgn = 0, $iErrFlag = 0 If $iBoxSzY = Default Then $iBoxSzY = $iBoxSzX If $iHoleYDiameter = Default Then $iHoleYDiameter = $iHoleXDiameter If $iHoleXDiameter < 0 Or $iHoleXDiameter > $iBoxSzX Then $iHoleXDiameter = 0 If $iHoleYDiameter < 0 Or $iHoleYDiameter > $iBoxSzY Then $iHoleYDiameter = 0 ; Styles: Basic: WS_POPUP (0x80000000), Extended: WS_EX_NOACTIVATE 0x08000000. ; $WS_EX_TOOLWINDOW (0x80) + $WS_EX_TRANSPARENT (click-through) $hGUI = GUICreate("", $iBoxSzX, $iBoxSzY, $iX, $iY, 0x80000000, 0x08000080 + 0x20) If @error Then Return SetError(1, @error, 0) Do If $iHoleXDiameter Or $iHoleYDiameter Then Local $iHoleXRadius = Int($iHoleXDiameter / 2), $iHoleYRadius = Int($iHoleYDiameter / 2) Local $iBoxHalfX = Int($iBoxSzX / 2), $iBoxHalfY = Int($iBoxSzY / 2) $iErrFlag = 10 ; Basic region (full extent of GUI) - needed for combining with Hollow region below $hRectRgn = _WinAPI_CreateRectRgn(0, 0, $iBoxSzX, $iBoxSzY) If $hRectRgn = 0 Then ExitLoop ; Ellipse_Region Start ; Spotlight Style of 0 = Circle If $g_nSpotlightStyle = 0 Then ; Create the Hollow interior region $hEllipseHollowRgn = _WinAPI_CreateEllipticRgn( _ _WinAPI_CreateRect($iBoxHalfX - $iHoleXRadius, $iBoxHalfY - $iHoleYRadius, $iBoxHalfX + $iHoleXRadius, $iBoxHalfY + $iHoleYRadius)) ; Spotlight Style non-zero is RoundRect. Could do more.. perhaps a Complex Region is best in the end Else ; MSDN: "Regions created by the Create<shape>Rgn methods (such as CreateRectRgn and CreatePolygonRgn) ; only include the interior of the shape; the shape's outline is excluded from the region" ; In practice: The uppermost and leftmost lines are not included, so 1 must be subtracted from both params to include the full rectangle $hEllipseHollowRgn = _WinAPI_CreateRoundRectRgn($iBoxHalfX - $iHoleXRadius - 1, $iBoxHalfY - $iHoleYRadius - 1, _ $iBoxHalfX + $iHoleXRadius, $iBoxHalfY + $iHoleYRadius, $nRoundRectCornerWidth, $nRoundRectCornerWidth) EndIf $iErrFlag += 1 If $hEllipseHollowRgn = 0 Then ExitLoop ; Ellipse_Region END ; CrossHairs_Region Start If $g_nSpotlightXHairState Then Local $iArrSt = 0, $iArrEnd = 3 Local $iXHairHollowRadius = Int($nSpotlightXHairDiameter / 2) Local $aXHairSides[4][4] = [ _ ; Upper side of X-Hair ( | ) [$iBoxHalfX - 1, $iBoxHalfY - $iHoleYRadius, $iBoxHalfX + 1, $iBoxHalfY - $iXHairHollowRadius], _ ; ( o ) [$iBoxHalfX - 1, $iBoxHalfY + $iXHairHollowRadius, $iBoxHalfX + 1, $iBoxHalfY + $iHoleYRadius - 1], _ ; Bottom side of X-Hair ( | ) [$iBoxHalfX - $iHoleXRadius, $iBoxHalfY - 1 + $nSpotlightXHairYOffset, _ $iBoxHalfX - $iXHairHollowRadius, $iBoxHalfY + 1 + $nSpotlightXHairYOffset], _ ; Left side of X-Hair (--o ) [$iBoxHalfX + $iXHairHollowRadius, $iBoxHalfY - 1 + $nSpotlightXHairYOffset, _ $iBoxHalfX + $iHoleXRadius - 1, $iBoxHalfY + 1 + $nSpotlightXHairYOffset] ] ; Right side of X-Hair ( o--) ; One-dimensional XHairs.. (1 = FULL, 2 = Horizontal, 3 = Vertical) If $g_nSpotlightXHairState = 2 Then $iArrSt = 2 ; $iArrEnd = 3 ElseIf $g_nSpotlightXHairState = 3 Then $iArrEnd = 1 ; $iArrSt = 0 EndIf For $i = $iArrSt To $iArrEnd ; MSDN: "Regions created by the Create<shape>Rgn methods (such as CreateRectRgn and CreatePolygonRgn) ; only include the interior of the shape; the shape's outline is excluded from the region" ; In practice: The uppermost and leftmost lines are not included, so 1 must be subtracted from both params to include the full rectangle $hXLineRgn = _WinAPI_CreateRectRgn($aXHairSides[$i][0] - 1, $aXHairSides[$i][1] - 1, $aXHairSides[$i][2], $aXHairSides[$i][3]) $iErrFlag += 1 If $hXLineRgn = 0 Then ExitLoop ;ConsoleWrite("XHair Region #"&$i&" X1: " & $aXHairSides[$i][0] & ", Y1: " & $aXHairSides[$i][1] & ", X2: " & $aXHairSides[$i][2] & ", Y2: " & $aXHairSides[$i][3] & @LF) $iErrFlag += 1 ; With the Ellipse Region, we can use either RGN_XOR or RGN_DIFF as we are 'removing' parts of the circle ; (RGN_AND = 1, RGN_OR = 2, RGN_XOR = 3, RGN_DIFF = 4, RGN_COPY = 5) If Not _WinAPI_CombineRgn($hEllipseHollowRgn, $hEllipseHollowRgn, $hXLineRgn, 4) Then ExitLoop 2 ; Exit out of For..Next AND Do..Until loop ; CombineRgn() Returns: 0 = ERROR, 1 = NULLREGION, 2 = SIMPLEREGION, 3 = COMPLEXREGION ; Don't need this Region after combined with the $hEllipseHollowRgn _WinAPI_DeleteObject($hXLineRgn) $hXLineRgn = 0 ; Primarily debug, as DeleteObject prior to function return (on error) will ignore both Next EndIf ; CrossHairs_Region END $iErrFlag = 20 ; Combine, put resulting region in $hRectRgn. RGN_DIFF = 4 If Not _WinAPI_CombineRgn($hRectRgn, $hRectRgn, $hEllipseHollowRgn, 4) Then ExitLoop ; Don't need this anymore (already combined with the Region injected into the GUI) _WinAPI_DeleteObject($hEllipseHollowRgn) $hEllipseHollowRgn = 0 ; Primarily debug, as DeleteObject prior to function return (on error) will ignore both $iErrFlag += 1 ; Set the region into the GUI. (GUI will then own it so there's no need to delete it) If Not _WinAPI_SetWindowRgn($hGUI, $hRectRgn, True) Then ExitLoop EndIf If $iBkColor <> Default Then GUISetBkColor($iBkColor) Return $hGUI ; If we wer to drop through, we'd need a clear ErrFlag count: ;$iErrFlag = 0 Until 1 ; Cleanup GUIDelete($hGUI) _WinAPI_DeleteObject($hRectRgn) _WinAPI_DeleteObject($hXLineRgn) _WinAPI_DeleteObject($hEllipseHollowRgn) Return SetError($iErrFlag, 0, 0) EndFunc ;==>_GUIShapeCreateHolePunchGUI #EndRegion SPOTLIGHT_FUNCTIONS ; ############################################### ; ############################################### #Region FOCUS_GUI_FUNCTIONS ; ================================================================================================================= ; Func _FocusGUIUpdate($iRezChgForce = 0) ; ; Author: Ascend4nt ; ================================================================================================================= Func _FocusGUIUpdate($iRezChgForce = 0) If Not $g_bFocusOn Then Return Local Const $TRANSITION_MAX = 100 ; Keep as much data local as possible (turning out to be tricky now!) Local Static $aLastWinPos = 0 ; Need this Global so that Lockdown can be used ; Local Static $hLastActiveWin = 0 ; Need this Global so it can be reset when GUI is deleted: ;Local Static $nTransitions = 0 ; Need this Global so we can delete it outside of this function ;Local Static $hFocusGUI = 0 Local $aActiveWinPos = 0, $hActiveWin = 0 Local $hTempGUIHandle = 0 ; Max-Transitions Exceeded? We don't want to continually eat up Windows RAM with Window Regions, ; so now and then we must purge the GUI and create a new one. This creates a temporary darkening effect now and then. ; (There's no known workaround for the Region bug - previous ones should be freed with each 'SetWindowRgn', but they aren't) If $g_nTransitions > $TRANSITION_MAX Then $g_nTransitions = $TRANSITION_MAX ; safety measure (issue with recreation & $nTransitions colliding) $hTempGUIHandle = $g_hFocusGUI $g_hFocusGUI = 0 EndIf ; Initializing? If $g_hFocusGUI = 0 Then ; Extra precaution for corner cases where GUI's might activate after a Display Change while no WM_DISPLAYCHANGE handler was in effect _VirtualScreenSizeUpdate() ; ----------------------------------------------------------------------------------------------------| ; Focus Window: Set off-screen 1st so when it finally is moved on-screen, it gives a nicer effect, ; as if lights are being shut off 1 by 1. ; ----------------------------------------------------------------------------------------------------| $g_hFocusGUI = GUICreate("", $g_aVScrRect[2], $g_aVScrRect[3], $g_aVScrRect[0] + $g_aVScrRect[2]-1, $g_aVScrRect[1] + $g_aVScrRect[3]-1, 0x80000000,0x08000080 + 0x20) WinSetTrans($g_hFocusGUI, "", $g_bSpotlightOn ? ($nFocusTransparency / 2): $nFocusTransparency) WinSetOnTop($g_hFocusGUI, "", 1) GUISetBkColor(0) $g_hLastActiveWin = WinGetHandle("[ACTIVE]") $hActiveWin = $g_hLastActiveWin $aActiveWinPos = WinGetPos($hActiveWin) $aLastWinPos = $aActiveWinPos ; Move focus-window's 'hole' to/with active window _GuiHole($g_hFocusGUI, $aActiveWinPos[0] - $g_aVScrRect[0], $aActiveWinPos[1] - $g_aVScrRect[1], $aActiveWinPos[2], $aActiveWinPos[3]) ; Now move and show it (this move AFTER the gui 'hole' has been set causes less disruption) WinMove($g_hFocusGUI, "", $g_aVScrRect[0], $g_aVScrRect[1]) WinSetState($g_hFocusGUI, "", @SW_SHOWNOACTIVATE) If $g_nTransitions = $TRANSITION_MAX Then ConsoleWrite("Transition count exceeded, recreating GUI.." & @LF) GUIDelete($hTempGUIHandle) EndIf ; Reset in both cases $g_nTransitions = 0 ; Don't fall-through Return EndIf ; Adjust if screen resized ;If $g_iResolutionChangeMsg Or $iRezChgForce Then If $iRezChgForce Then ConsoleWrite("Resolution changed, resizing window"&@LF) WinMove($g_hFocusGUI, "", $g_aVScrRect[0], $g_aVScrRect[1], $g_aVScrRect[2], $g_aVScrRect[3]) ;WinMove($g_hFocusGUI, "", Default, Default, $g_aVScrRect[0] + $g_aVScrRect[2], $g_aVScrRect[1] + $g_aVScrRect[3]) ; Force _GuiHole call (down below) $g_hLastActiveWin = -1 ;$g_iResolutionChangeMsg = 0 ; old behavior EndIf ; Active Window changing? (Lockdown skips this test, unless the Window no longer exists) If $g_hFocusLockDown <= 0 Or Not WinExists($g_hFocusLockDown) Then $hActiveWin = WinGetHandle("[ACTIVE]") Else $hActiveWin = $g_hFocusLockDown EndIf $aActiveWinPos = WinGetPos($hActiveWin) ; Workaround for certain scenarios where position isn't able to be retrieved If @error Then $aActiveWinPos = $aLastWinPos $hActiveWin = $g_hLastActiveWin ; Different active window, or different size/position? ElseIf ($hActiveWin <> $g_hLastActiveWin) Or ($aActiveWinPos[0] <> $aLastWinPos[0] Or $aActiveWinPos[1] <> $aLastWinPos[1] Or _ $aActiveWinPos[2] <> $aLastWinPos[2] Or $aActiveWinPos[3] <> $aLastWinPos[3]) Then ;ConsoleWrite("New active window or position: Win:"&WinGetTitle($hActiveWin)&@CRLF) $g_nTransitions += 1 ;_GuiHole($g_hFocusGUI, $aActiveWinPos[0], $aActiveWinPos[1], $aActiveWinPos[2], $aActiveWinPos[3]) _GuiHole($g_hFocusGUI, $aActiveWinPos[0] - $g_aVScrRect[0], $aActiveWinPos[1] - $g_aVScrRect[1], $aActiveWinPos[2], $aActiveWinPos[3]) ; Reset as Topmost GUI (Logic taken to main loop; otherwise causes flashing when competing for topmost GUI) ;WinSetOnTop($g_hFocusGUI, "", 1) $g_hLastActiveWin = $hActiveWin $aLastWinPos = $aActiveWinPos EndIf EndFunc ; =============================================================================================================================== ; Func _GuiHole($h_win, $i_x, $i_y, $i_sizew, $i_sizeh) ; ; Places an empty 'see-through' region inside a GUI, hence 'gui hole' ; ; Author: KaFu, Ascend4nt (error handling, cleanup, API call fixes) ; =============================================================================================================================== Func _GuiHole($h_win, $i_x, $i_y, $i_sizew, $i_sizeh) Local $pos, $set_rgn, $inner_rgn $pos = WinGetPos($h_win) If @error Then Return SetError(1,@error,0) $set_rgn = DllCall($g_hGDI32DLL, "handle", "CreateRectRgn", "long", 0, "long", 0, "long", $pos[2], "long", $pos[3]) If @error Then Return SetError(2,@error,0) $inner_rgn = DllCall($g_hGDI32DLL, "handle", "CreateRectRgn", "long", $i_x, "long", $i_y, "long", $i_x + $i_sizew, "long", $i_y + $i_sizeh) If @error Then DllCall($g_hGDI32DLL, "bool", "DeleteObject", "handle", $set_rgn[0]) Return SetError(2, @error, 0) EndIf ; Unnecessary: ;~ $combined_rgn = DllCall($g_hGDI32DLL, "handle", "CreateRectRgn", "long", 0, "long", 0, "long", 0, "long", 0) ; $RGN_DIFF = 4 DllCall($g_hGDI32DLL, "long", "CombineRgn", "handle", $set_rgn[0], "handle", $set_rgn[0], "handle", $inner_rgn[0], "int", 4) ; Inner Region no longer required once combined with another region DllCall($g_hGDI32DLL, "bool", "DeleteObject", "handle", $inner_rgn[0]) ; After Set, a Region should not be deleted (so we don't touch $set_rgn after) DllCall($g_hUSER32DLL, "long", "SetWindowRgn", "hwnd", $h_win, "handle", $set_rgn[0], "bool", 1) Return 1 EndFunc ;==>_GuiHole #EndRegion FOCUS_GUI_FUNCTIONS ; ############################################### ; ############################################### #Region MOUSE_FUNCTIONS_PARTIAL_UDF ; ==================================================================================================== ; Func _MouseReplaceAllCursors($bDontReplaceResizeCursors = False) ; ; Replaces all cursors with a crosshair cursor (or X style cursor). ; ; ; AND mask XOR mask Display ; --------|-----------|--------- ; 0 0 Black ; 0 1 White ; 1 0 Screen ; 1 1 Reverse screen ; --------|-----------|--------- ; ; Author: Ascend4nt ; ==================================================================================================== Func _MouseReplaceAllCursors($bDontReplaceResizeCursors = False, $bUseXHairCross = True) If $MCF_bCursorsReplaced = 1 Then Return True ; Had a different type of Cursor Replacement? Restore first! If $MCF_bCursorsReplaced Then _MouseRestoreAllCursors() Local $i, $iErrCount = 0, $hCrossHair, $hTempCopy, $stCursor, $aRet Local $iCursorsToReplace = UBound($MCF_aSysCursors) - 1 If $bDontReplaceResizeCursors Then $iCursorsToReplace -= 5 EndIf ; Lets make a 32x32 cursor [1bpp] (32/8=4*32=128) $stCursor = DllStructCreate("ubyte[128];ubyte[128]") ; 32x32 cursor - each bit corresponds to a pixel (4 pixels per hex #) DllStructSetData($stCursor, 1, "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF") If $bUseXHairCross Then ; each bit corresponds to a pixel (4 pixels per hex #) (the rest we'll leave zeroed) DllStructSetData($stCursor, 2, "0x" & _ "01000000" & _ "01000000" & _ "01000000" & _ "01000000" & _ "01000000" & _ "01000000" & _ "01000000" & _ "FEFE0000" & _ ; Line 8 = horizonal line; center bit cleared (same bit set for other rows) "01000000" & _ "01000000" & _ "01000000" & _ "01000000" & _ "01000000" & _ "01000000" & _ "01000000" & _ "00000000") ; Center pixel (7,7 for 15x15 [or 16x16 officially]) $hCrossHair = DllCall($g_hUSER32DLL, "handle", "CreateCursor", "handle", 0, "int", 7, "int", 7, "int", 32, "int", 32, _ "ptr", DllStructGetPtr($stCursor, 1), "ptr", DllStructGetPtr($stCursor, 2)) Else ; $bXHairDiagonal DllStructSetData($stCursor, 2, "0x" & _ "00000000" & _ ; "01000400" & .. ; to make 15x15 "00000000" & _ ; "00800800" & .. ; to make 13x13 "00401000" & _ ; 11x11 "00202000" & _ "00104000" & _ "00088000" & _ "00050000" & _ "00000000" & _ ; Line 8 = center point; center bit cleared "00050000" & _ "00088000" & _ "00104000" & _ "00202000" & _ "00401000" & _ "00000000" & _ ; "00800800" & .. "00000000" & _ ; "01000400" & .. "00000000") $hCrossHair = DllCall($g_hUSER32DLL, "handle", "CreateCursor", "handle", 0, "int", 14, "int", 7, "int", 32, "int", 32, _ "ptr", DllStructGetPtr($stCursor, 1), "ptr", DllStructGetPtr($stCursor, 2)) EndIf If @error Then Return SetError(2, @error, False) If Not $hCrossHair[0] Then Return SetError(3, 0, 0) $hCrossHair = $hCrossHair[0] ;~ ConsoleWrite("cursor:"&$hCrossHair&@CRLF) ; Make copy, one for each cursor to be replaced [don't ask me why I can't reuse one - it just doesn't work] ; (REQUIRED for SetSystemCursor calls) ; (*CopyCursor is a macro for CopyIcon) For $i = 0 To $iCursorsToReplace $hTempCopy = DllCall($g_hUSER32DLL, "handle", "CopyIcon", "handle", $hCrossHair) If @error Or Not $hTempCopy[0] Then $iErrCount += 1 ContinueLoop EndIf $MCF_aSysCursors[$i][1] = $hTempCopy[0] ; Replace with copy of crosshair $aRet = DllCall($g_hUSER32DLL, "bool", "SetSystemCursor", "handle", $hTempCopy[0], "dword", $MCF_aSysCursors[$i][0]) If @error Or Not $aRet[0] Then $iErrCount += 1 ;~ ConsoleWrite("@error="&@error&" for SetSystemCursor"&@CRLF) EndIf ;~ ConsoleWrite("Return for #"&$i&":"&$aRet[0]&", ID:"&$MCF_aSysCursors[$i][0]&" Handle:"&$MCF_aSysCursors[$i][1]&" Msg:"&_WinAPI_GetLastErrorMessage()) Next ; Destroy cursor created (and copied) DllCall($g_hUSER32DLL, "bool", "DestroyCursor", "handle", $hCrossHair) If $iErrCount = 16 Then Return SetError(4, -1, False) ;~ ConsoleWrite("Total Errors:"&$iErrCount&" for _MouseReplaceAllCursors"&@CRLF) $MCF_bCursorsReplaced = 1 EndFunc ;==>_MouseReplaceAllCursors ; ==================================================================================================== ; Func _MouseHideAllCursors($bDontReplaceResizeCursors = False) ; ; Hides all cursors. ; ; Author: Ascend4nt ; ==================================================================================================== Func _MouseHideAllCursors($bDontReplaceResizeCursors = False) If $MCF_bCursorsReplaced = -1 Then Return True ; Had a different type of Cursor Replacement? Restore first! If $MCF_bCursorsReplaced Then _MouseRestoreAllCursors() Local $i, $iErrCount = 0, $hTempCopy, $aRet, $stCursor, $hCursor Local $iCursorsToReplace = UBound($MCF_aSysCursors) - 1 If $bDontReplaceResizeCursors Then $iCursorsToReplace -= 5 EndIf $stCursor = DllStructCreate("ubyte[128];ubyte[128]") ; Create an invisible cursor -> 32x32 (8x8 works but gives artifacts when manipulating items with mouse) DllStructSetData($stCursor, 1, "0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF") DllStructSetData($stCursor, 2, 0) $hCursor = DllCall($g_hUSER32DLL, "handle", "CreateCursor", "handle", 0, "int", 0, "int", 0, "int", 32, "int", 32, "ptr", DllStructGetPtr($stCursor, 1), "ptr", DllStructGetPtr($stCursor, 2)) If @error Then Return SetError(2, @error, False) ;ConsoleWrite("hCursor result:" & $hCursor[0] & @CRLF) If Not $hCursor[0] Then Return SetError(3, 0, 0) ;ConsoleWrite("hCursor result:" & $hCursor[0] & @CRLF) $hCursor = $hCursor[0] ;~ ConsoleWrite("cursor:"&$hCursor&@CRLF) ; Make copy, one for each icon to be replaced [don't ask me why I can't reuse one - it just doesn't work] ; (REQUIRED for SetSystemCursor calls) (*CopyCursor is a macro for CopyIcon) For $i = 0 To $iCursorsToReplace $hTempCopy = DllCall($g_hUSER32DLL, "handle", "CopyIcon", "handle", $hCursor) If @error Or Not $hTempCopy[0] Then $iErrCount += 1 ContinueLoop EndIf $MCF_aSysCursors[$i][1] = $hTempCopy[0] ; Replace with copy of 'invisible cursor' $aRet = DllCall($g_hUSER32DLL, "bool", "SetSystemCursor", "handle", $hTempCopy[0], "dword", $MCF_aSysCursors[$i][0]) If @error Or Not $aRet[0] Then $iErrCount += 1 ;~ If Not @error Then ConsoleWrite("Return for #"&$i&":"&$aRet[0]&", ID:"&$MCF_aSysCursors[$i][0]&" Handle:"&$MCF_aSysCursors[$i][1]&" Msg:"&_WinAPI_GetLastErrorMessage()) Next ; Destroy cursor created (and copied) DllCall($g_hUSER32DLL, "bool", "DestroyCursor", "handle", $hCursor) If $iErrCount = 16 Then Return SetError(2, -1, False) ;~ ConsoleWrite("Total Errors:"&$iErrCount&" for _MouseHideAllCursors"&@CRLF) $MCF_bCursorsReplaced = -1 EndFunc ;==>_MouseHideAllCursors ; ==================================================================================================== ; Func _MouseRestoreAllCursors() ; ; Restores all the current default system cursors. ; ; Author: Ascend4nt ; ==================================================================================================== Func _MouseRestoreAllCursors() If Not $MCF_bCursorsReplaced Then Return True Local $i, $iErrCount = 0, $aRet ; SPI_SETCURSORS 0x0057 ; Restores system default cursors $aRet = DllCall($g_hUSER32DLL, "bool", "SystemParametersInfoW", "dword", 0x57, "dword", 0, "ptr", 0, "dword", 0) For $i = 0 To UBound($MCF_aSysCursors) - 1 ; Destroy copy $aRet = DllCall($g_hUSER32DLL, "bool", "DestroyCursor", "handle", $MCF_aSysCursors[$i][1]) If @error Or Not $aRet[0] Then $iErrCount += 1 ContinueLoop EndIf $MCF_aSysCursors[$i][1] = 0 Next If $iErrCount = 16 Then Return SetError(4, -1, False) ;~ ConsoleWrite("Total Errors:"&$iErrCount&" for _MouseRestoreAllCursors"&@CRLF) $MCF_bCursorsReplaced = 0 EndFunc ;==>_MouseRestoreAllCursors #EndRegion MOUSE_FUNCTIONS_PARTIAL_UDF ; ############################################### WindowsSpotlightFocusGUI.au3 ~prev downloads: 44 WindowsSpotlightFocusGUI.au3
-
My first project outside of work Since I have literally hundreds of games and programs installed on my pc, even using the start menu can get me lost when looking for a specific thing. With this, you can drag/drop any file or shortcut onto the GUI. Then you can open any file from the convienient GUI sitting on your desktop. 5 different "tabs" or lists allow you to sort and organize your files to make them easier to find when your lists get long. Latest Version 3.0.2.2<-11/8/13 (or 8/11/13 for the European people) You can get the included help file here for a more indepth look at what this program can do and how it works. I've removed the purchase requirement (it's free again) and added a donate button to the installer. Bugs, suggestions and comments are welcome!
-
Mak Context Entry Creator v1.2 Mak Context Entry Creator ver 1.2 Change Log: Added My Computer, Recycle Bin, XBMC and Skype. Fixed Some bugs. Now delete registry key directly from MCEC. New Style. ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬ »MCEC v1.1 Link >here. MCEC new key remove option allow you to directly delete the un-necessary link. To delete click on the link say, "MCEC". Click on MCEC and then click "delete" button. Please Note: Do not delete "Display" and "Personalize" and "any other default key". If you like this application please comment and share with your friend. And if you like to help me yo're welcome. Windows XP users, Please let me know the registry key for Desktop Background so that it can support Windows XP and Windows Vista. Supports Windows 7, Checked on Win 7 HB and Ultimate. »» Download MCEC »» mcec.zip ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
-
Mak Context Entry Creator +|=========================================|+ Mak Context Entry Creator is a small autoit compiled tool which allow user to create a executable shortcut at their desktop right click. The main purpose of this software is to make desktop clean and minimal. Majority of user link their useful shortcuts to their desktop and also at their taskbar. Desktop shortcut looks somewhat dirty so i created an app which let you to be minimal but also without compromising the favorite or useful shortcut. Mak Context Entry creator adds your favorite or useful software to your right click by creating a registry key. You can add as many shortcut you want but it takes some CPU memory too. So by using this software your desktop remain minimal, hide your desktop shortcut or remove them. Open your shortcut using right click. How to Use? The application itself open with administrator privilege. Click on Select Path button and choose your executable path. The first text field display the executable name as it is, so in same cases you have to edit the name. The second text-field display the executable path(don't edit it). After then click Create Context Menu. You can also use auto-built features, these are Add Registry, Add CP. Also included the Services.msc. The only drawback of this application is that you can not delete the registry value using this application, but you can use the registry editing tutorial given in the read me file. Also a backup file is also given. If you like this application please comment and share with your friend. And if you like to help me yo're welcome. This is my first application here and first GUI application i created. Mak Context Entry Creator v1.1.7z
-
- context
- context menu
- (and 8 more)
-
I can get the 'workarea' of the primary monitor using: Func _GetDesktopArea() Local Const $SPI_GETWORKAREA = 48 Local $tWorkArea = DllStructCreate($tagRECT) _WinAPI_SystemParametersInfo($SPI_GETWORKAREA, 0, DllStructGetPtr($tWorkArea)) Local $aReturn[4] = [DllStructGetData($tWorkArea, "Left"), DllStructGetData($tWorkArea, "Top"), _ DllStructGetData($tWorkArea, "Right") - DllStructGetData($tWorkArea, "Left"), DllStructGetData($tWorkArea, "Bottom") - DllStructGetData($tWorkArea, "Top")] Return $aReturn EndFunc ;==>_GetDesktopArea MSDN says to use GetMonitorInfo() to get workarea of monitors other than the Primary. However, when I do this the rect I receive from this function for Primary or Secondary is not a workarea, but a fullscreen rect. #include <WinApi.au3> #include <Array.au3> #include <StructureConstants.au3> ;get monitor handles Local $edm=_WinAPI_EnumDisplayMonitors();$hDC = 0, $tRECT = 0 If @Error Then MsgBox(0,'Error','_WinAPI_EnumDisplayMonitors') Local $mh1=$edm[2][0]; 1 for first handle, 2 for second Local $mr1=$edm[1][1]; supposedly a rect ; use my handle to get monitor infos Local $vh=_WinAPI_GetMonitorInfo($mh1) If @Error Then MsgBox(0,'Error','_WinAPI_GetMonitorInfo') ; $vh now filled with ; [0] - $tagRECT structure that specifies the display monitor rectangle, in virtual-screen coordinates. ; [1] - $tagRECT structure that specifies the work area rectangle of the display monitor that can be used by applications, in virtual-screen coordinates. ; [2] - 1 (True) for the primary display monitor, or 0 (False) otherwise. ; [3] - The device name of the monitor being used, e.g. "\\.\DISPLAY1". Local $aReturn[4] = [DllStructGetData($vh[1], 'Left') _ ,DllStructGetData($vh[1], 'Top') _ ,DllStructGetData($vh[1], 'Right') - DllStructGetData($vh[1], 'Left') _ ,DllStructGetData($vh[1], 'Bottom') - DllStructGetData($vh[1], 'Top') _ ] _ArrayDisplay($aReturn) Exit So to reiterate- the MonitorInfo workarea rect does not jive with the one gotten with SPI for the Primary monitor, therefore it doesn't work for the Secondary monitor either - it just gets the true (virtual) dimensions. I smell a Microsoft thing. I have looked on StackOverflow with no success. Can anyone get a workarea!=desktop with this code?
-
I started this a couple of months ago and figured that maybe others would like to contribute or just criticize whatever does it for you. I'm having to start from scratch and re-research everything but if someone has some code to contribute or ideas please share them. Everyone else start coding like freaking crazy. For those lost on the subject please lookup emerge desktop as some of it may be incorporated into this version. It won't be if I can help it though. To get some conversation started what features are the most desired? Should (AutoIt Desktop Shell) be the name? Ideas? Registering the shell is simple enough - HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\Shell I will be needing to touch on some sensitive subjects. How can we intercept the same hotkeys as explorer for the start menu and etc... If this is unacceptable then mods please due inform me. I'm not asking now, just speculating on this project's development.
-
Been stuck in this for a day now. As far as i know, the desktop's a syslistview32 control, where icons on the desktop is items, right? Therefore i should be able to get the icon text using LVM_GETITEMTEXT? using this code: for item in GetListViewItems(hList) debugout(consolewrite, GetItemText(hList, item)) nextwhere GetItemText is: And hList is a class SysListView32 belonging to the progman window. Output is: 0x01000000 + item + 000000000000000000000000000000 3C007D06FF (pointer to buffer at end) ... (zero'es) [chars = 0] The operation completed successfully. [empty string] Does anybody know what's going on? I'll admit i dont have a lot of knowledge about listviews, but this is the way that both msdn and general searching suggests (check out this link: http://social.msdn.microsoft.com/Forums/eu/winforms/thread/d7df8a4d-fc0f-4b62-80c9-7768756456e6) Using autoit beta x64 (irrelevant though, tried in other languages too), and windows 7 x64. Any help appreciated ..
-
Hello everybody, this is my first post and I'm quite new to the world of AutoIt. I already manage to change programmatically my desktop background via this one-liner: DllCall("user32.dll", "int", "SystemParametersInfo", "int", 20, "int", 0, "str", $CmdLine[1], "int", 0) (via drag 'n' drop of the desired wallpaper onto the compiled script). However, this code does even too much for my needs. In fact I have another software that changes the desktop but, for some unknown-to-me reasons, fails to send the WM_SETTINGCHANGE message (I can see the key HKCU\Control Panel\Desktop\Wallpaper getting updated in fact, by the way). So I ask you: how can I write a simple script that sends this message and thus triggers the wallpaper refresh? And will it work or the first script is the only "real"/"correct" way to proceed programmatically? I tried this but it doesn't work: #include-once Global $MAX_VALUE_NAME = 1024 Global $HWND_BROADCAST = 0xffff Global $WM_SETTINGCHANGE = 0x001A Global $SMTO_ABORTIFHUNG = 0x0002 Global $SMTO_NORMAL = 0x0000 Global $MSG_TIMEOUT = 5000 DllCall("user32.dll", "lresult", "SendMessageTimeoutW", _ "hwnd", $HWND_BROADCAST, _ "dword", $WM_SETTINGCHANGE, _ "ptr", 0, _ "wstr", "Environment", _ "dword", $SMTO_ABORTIFHUNG, _ "dword", $MSG_TIMEOUT, _ "dword_ptr*", 0) Many thanks in advance to whomever will help me!
- 8 replies
-
- WM_SETTINGCHANGE
- refresh
-
(and 1 more)
Tagged with:
-
Do exist a example to arrange labels to desktop? I would like to maintain the same proportions of characters and positions in a fullscreen screensaver.