Werty Posted March 14 Share Posted March 14 On 1/14/2024 at 8:55 AM, ioa747 said: ; Title...........: ShellTrayRefresh.au3 I doubt this will work with hidden taskbar. Some guy's script + some other guy's script = my script! Link to comment Share on other sites More sharing options...
UEZ Posted April 6 Share Posted April 6 (edited) Get the binary type for exe / dll file. expandcollapse popup;Coded by UEZ build 2024-04-08 #AutoIt3Wrapper_UseX64 = y #include <WinAPIFiles.au3> #include <WinAPIProc.au3> Global $sFile = FileOpenDialog("Select a DLL file", "", "File (*.dll;*.exe)", $FD_FILEMUSTEXIST) If @error Then Exit MsgBox($MB_ICONINFORMATION, "File Binary Type", StringRegExpReplace($sFile, ".+\\(.+)", "$1") & " = " & _WinAPI_GetBinaryType2($sFile)) ; #FUNCTION# ==================================================================================================================== ; Author.........: UEZ ; Modified.......: ; =============================================================================================================================== Func _WinAPI_GetBinaryType2($sFile) Local Const $hFile = _WinAPI_CreateFile($sFile, 2, 2) If Not $hFile Or @error Then Return SetError(1, 0, 0) Local Const $hMapping = _WinAPI_CreateFileMapping($hFile, 0, Null, $PAGE_READONLY, Null) If Not $hMapping Then _WinAPI_CloseHandle($hFile) Return SetError(2, 0, 0) EndIf Local Const $pAddress = _WinAPI_MapViewOfFile($hMapping, 0, 0, $FILE_MAP_READ) If Not $pAddress Or @error Then __ReturnGBT2($hMapping, $hFile, 3) Local $aHeader = DllCall("Dbghelp.dll", "ptr", "ImageNtHeader", "ptr", $pAddress) If @error Or IsArray($aHeader) = 0 Then Return __ReturnGBT2($hMapping, $hFile, 4) Local $tIMAGE_NT_HEADERS = DllStructCreate("dword Signature;ptr FileHeader;ptr OptionalHeader;", $aHeader[0]) If @error Or Not IsDllStruct($tIMAGE_NT_HEADERS) Then Return __ReturnGBT2($hMapping, $hFile, 5) Local $tIMAGE_FILE_HEADER = DllStructCreate("word Machine;word NumberOfSections;dword TimeDateStamp;dword PointerToSymbolTable;dword NumberOfSymbols;word SizeOfOptionalHeader;word Characteristics;", DllStructGetPtr($tIMAGE_NT_HEADERS) + 4) If @error Or Not IsDllStruct($tIMAGE_FILE_HEADER) Then Return __ReturnGBT2($hMapping, $hFile, 6) __ReturnGBT2($hMapping, $hFile, 0) Switch $tIMAGE_FILE_HEADER.Machine Case 0x014c Return "x86" Case 0x0200 Return "Intel Itanium" Case 0x8664 Return "x64" Case Else Return "Error" EndSwitch EndFunc ;==>_WinAPI_GetBinaryType2 Func __ReturnGBT2($hMapping, $hFile, $iError) _WinAPI_CloseHandle($hMapping) _WinAPI_CloseHandle($hFile) If $iError Then Return SetError($iError, 0, 0) EndFunc ;==>__ReturnGBT2 Edited April 9 by UEZ small modifications ioa747, argumentum and TheDcoder 3 Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ Link to comment Share on other sites More sharing options...
Popular Post Nine Posted August 27 Popular Post Share Posted August 27 Wonder how to have a progress in your window task bar, here you go : expandcollapse popup#include <GUIConstantsEx.au3> Global Const $sCLSID_TaskbarList = "{56FDF344-FD6D-11D0-958A-006097C9A090}" Global Const $sIID_ITaskbarList3 = "{EA1AFB91-9E28-4B86-90E9-9E9F8A5EEFAF}" Global Const $tagITaskbarList3 = _ "HrInit hresult();" & _ "AddTab hresult(hwnd);" & _ "DeleteTab hresult(hwnd);" & _ "ActivateTab hresult(hwnd);" & _ "SetActiveAlt hresult(hwnd);" & _ "MarkFullscreenWindow hresult(hwnd;boolean);" & _ "SetProgressValue hresult(hwnd;uint64;uint64);" & _ "SetProgressState hresult(hwnd;int);" & _ "RegisterTab hresult(hwnd;hwnd);" & _ "UnregisterTab hresult(hwnd);" & _ "SetTabOrder hresult(hwnd;hwnd);" & _ "SetTabActive hresult(hwnd;hwnd;dword);" & _ "ThumbBarAddButtons hresult(hwnd;uint;ptr);" & _ "ThumbBarUpdateButtons hresult(hwnd;uint;ptr);" & _ "ThumbBarSetImageList hresult(hwnd;ptr);" & _ "SetOverlayIcon hresult(hwnd;ptr;wstr);" & _ "SetThumbnailTooltip hresult(hwnd;wstr);" & _ "SetThumbnailClip hresult(hwnd;ptr);" Example() Func Example() Local $hGUI = GUICreate("AutoIt v3", 400, 100) GUISetState() Local $oTaskBar = TB_Init() For $i = 1 To 100 TB_SetProgress($oTaskBar, $hGUI, $i, 100) Sleep(25) Next TB_Flash($oTaskBar, $hGUI, 4, 300) While True Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd EndFunc ;==>Example Func TB_Init() Local $oTB = ObjCreateInterface($sCLSID_TaskbarList, $sIID_ITaskbarList3, $tagITaskbarList3) $oTB.HrInit() Return $oTB EndFunc ;==>TB_Init Func TB_SetProgress(ByRef $oTB, $hWnd, $iCurrent, $iCompleted) $oTB.SetProgressValue($hWnd, $iCurrent, $iCompleted) EndFunc ;==>TB_SetProgress Func TB_Flash(ByRef $oTB, $hWnd, $iTimes, $iDelay) For $i = 1 To $iTimes $oTB.SetProgressState($hWnd, 0) Sleep($iDelay) $oTB.SetProgressValue($hWnd, 100, 100) Sleep($iDelay) Next $oTB.SetProgressState($hWnd, 0) EndFunc ;==>TB_Flash TheDcoder, mLipok, argumentum and 3 others 3 3 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
argumentum Posted August 28 Share Posted August 28 2 hours ago, Nine said: Wonder how to have a progress in your window task bar, here you go ... Local $oTaskBar = TB_Init() $oTaskBar.SetThumbnailTooltip($hGUI, "1st line" & @CRLF & "2nd line") ... would you post an example for each in the $tag ? ( that'd be super cool ) Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
Nine Posted August 28 Share Posted August 28 55 minutes ago, argumentum said: would you post an example for each in the $tag ? nope “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
TheDcoder Posted August 28 Share Posted August 28 6 hours ago, Nine said: Wonder how to have a progress in your window task bar Is that even a thing in Windows 11 anymore? I used to love those effects in Windows 7 (Ah the nostalgia) EasyCodeIt - A cross-platform AutoIt implementation - Fund the development! (GitHub will double your donations for a limited time) DcodingTheWeb Forum - Follow for updates and Join for discussion Link to comment Share on other sites More sharing options...
argumentum Posted August 28 Share Posted August 28 11 minutes ago, TheDcoder said: Is that even a thing in Windows 11 anymore? Win10 - Win11 I like the Win10 better. TheDcoder 1 Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
seadoggie01 Posted August 28 Share Posted August 28 Expanding on Nine's task bar adventures... The overlay icon and tooltip were the only other interesting task bar things to me, so I added those + examples expandcollapse popup#include <GUIConstantsEx.au3> #include <WinAPIIcons.au3> ; For _WinAPI_DestroyIcon #include <WinAPIShellEx.au3> ; For _WinAPI_ShellExtractIcon Global Const $sCLSID_TaskbarList = "{56FDF344-FD6D-11D0-958A-006097C9A090}" Global Const $sIID_ITaskbarList3 = "{EA1AFB91-9E28-4B86-90E9-9E9F8A5EEFAF}" Global Const $tagITaskbarList3 = _ "HrInit hresult();" & _ "AddTab hresult(hwnd);" & _ "DeleteTab hresult(hwnd);" & _ "ActivateTab hresult(hwnd);" & _ "SetActiveAlt hresult(hwnd);" & _ "MarkFullscreenWindow hresult(hwnd;boolean);" & _ "SetProgressValue hresult(hwnd;uint64;uint64);" & _ "SetProgressState hresult(hwnd;int);" & _ "RegisterTab hresult(hwnd;hwnd);" & _ "UnregisterTab hresult(hwnd);" & _ "SetTabOrder hresult(hwnd;hwnd);" & _ "SetTabActive hresult(hwnd;hwnd;dword);" & _ "ThumbBarAddButtons hresult(hwnd;uint;ptr);" & _ "ThumbBarUpdateButtons hresult(hwnd;uint;ptr);" & _ "ThumbBarSetImageList hresult(hwnd;ptr);" & _ "SetOverlayIcon hresult(hwnd;ptr;wstr);" & _ "SetThumbnailTooltip hresult(hwnd;wstr);" & _ "SetThumbnailClip hresult(hwnd;ptr);" Example() Func Example() Local $hGUI = GUICreate("AutoIt v3", 400, 100) GUISetState() Local $oTaskBar = TB_Init() TB_ToolTip($oTaskBar, $hGUI, "Working...") ; Load an icon -- this is a blue refresh on Win11 Local $hIcon = _WinAPI_ShellExtractIcon(@SystemDir & "\shell32.dll", 238, 32, 32) TB_SetOverlayIcon($oTaskBar, $hGUI, $hIcon, "Blue refresh") For $i = 1 To 100 TB_SetProgress($oTaskBar, $hGUI, $i, 100) Sleep(25) Next ; Destroy the old icon _WinAPI_DestroyIcon($hIcon) Local $hSecondIcon = _WinAPI_ShellExtractIcon(@SystemDir & "\shell32.dll", 300, 32, 32) TB_SetOverlayIcon($oTaskBar, $hGUI, $hSecondIcon, "Green checkmark") TB_Flash($oTaskBar, $hGUI, 4, 300) TB_ToolTip($oTaskBar, $hGUI, "Waiting for you to close the window") While True Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd ; Clear the icon overlay TB_SetOverlayIcon($oTaskBar, $hGUI, Null) _WinAPI_DestroyIcon($hSecondIcon) EndFunc ;==>Example Func TB_Init() Local $oTB = ObjCreateInterface($sCLSID_TaskbarList, $sIID_ITaskbarList3, $tagITaskbarList3) $oTB.HrInit() Return $oTB EndFunc ;==>TB_Init Func TB_SetProgress(ByRef $oTB, $hWnd, $iCurrent, $iCompleted) $oTB.SetProgressValue($hWnd, $iCurrent, $iCompleted) EndFunc ;==>TB_SetProgress Func TB_Flash(ByRef $oTB, $hWnd, $iTimes, $iDelay) For $i = 1 To $iTimes $oTB.SetProgressState($hWnd, 0) Sleep($iDelay) $oTB.SetProgressValue($hWnd, 100, 100) Sleep($iDelay) Next $oTB.SetProgressState($hWnd, 0) EndFunc ;==>TB_Flash ; These are icons added to your taskbar icon, showing status usually. Each window only gets 1. Set $hIcon to NULL to clear. ; (Win11) Teams uses this to show your status (busy, free, inactive) and Outlook uses it to show if you have an unread email Func TB_SetOverlayIcon(ByRef $oTB, $hWnd, $hIcon, $sAltText = "") $oTB.SetOverlayIcon($hWnd, $hIcon, $sAltText) EndFunc ;==>TB_SetOverlayIcon ; Depending on settings and version, this may be difficult to see. On Win11 with taskbar previews, it is only visible after hovering over the preview window. Func TB_ToolTip(ByRef $oTB, $hWnd, $sTooltip) $oTB.SetThumbnailTooltip($hWnd, $sTooltip) EndFunc ;==>TB_ToolTip Nine, ioa747, argumentum and 1 other 4 All my code provided is Public Domain... but it may not work. Use it, change it, break it, whatever you want. Spoiler My Humble Contributions:Personal Function Documentation - A personal HelpFile for your functionsAcro.au3 UDF - Automating Acrobat ProToDo Finder - Find #ToDo: lines in your scriptsUI-SimpleWrappers UDF - Use UI Automation more Simply-erKeePass UDF - Automate KeePass, a password managerInputBoxes - Simple Input boxes for various variable types Link to comment Share on other sites More sharing options...
Nine Posted August 30 Share Posted August 30 If you want to modify the appearance of any blocking functions, here one way : #include <WindowsConstants.au3> #include <WinAPISys.au3> OnAutoItExitRegister(OnAutoItExit) Global $hForm = GUICreate('Example') GUIRegisterMsg(_WinAPI_RegisterWindowMessage('SHELLHOOK'), WM_SHELLHOOK) _WinAPI_RegisterShellHookWindow($hForm) MsgBox($MB_OK, "MsgBox", "Message") InputBox("InputBox", "Prompt") FileOpenDialog("FileOpenDialog", @ScriptDir, "au3 (*.au3)") Func WM_SHELLHOOK($hWnd, $iMsg, $wParam, $lParam) If $wParam <> $HSHELL_WINDOWCREATED Then Return Switch WinGetTitle($lParam) Case "MsgBox" ControlSetText($lParam, "", "Static1", "Cool Stuff") ControlSetText($lParam, "", "Button1", "New") Case "InputBox" Local $hCtrl = ControlGetHandle($lParam, "", "Edit1") Local $hFont = _WinAPI_CreateFont(16, 0, 0, 0, 600) _SendMessage($hCtrl, $WM_SETFONT, $hFont, False) _WinAPI_DeleteObject($hFont) Case "FileOpenDialog" ControlHide($lParam, "", "Button2") EndSwitch EndFunc ;==>WM_SHELLHOOK Func OnAutoItExit() _WinAPI_DeregisterShellHookWindow($hForm) EndFunc ;==>OnAutoItExit argumentum and pixelsearch 2 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
argumentum Posted October 28 Share Posted October 28 (edited) ConsoleWrite('--- ProcessStartDate: ' & ProcessStartDate('SciTE.exe') & @CRLF) ; --- ProcessStartDate: 2024/10/28 09:45:50 Func ProcessStartDate($sProcessOrPID, $iRet_tSYSTEMTIME = 0, $iLocalTime = 0) Local $aFT, $tFT, $tST, $iID = ProcessExists($sProcessOrPID) If $iID Then ; https://www.autoitscript.com/forum/index.php?showtopic=139260&view=findpost&p=1538034 $aFT = _WinAPI_GetProcessTimes($iID) If @error Or UBound($aFT) <> 3 Then Return SetError(@error, _WinAPI_GetLastError(), "GetProcessTimes FAILED") $tST = _Date_Time_FileTimeToSystemTime($iLocalTime ? _Date_Time_FileTimeToLocalFileTime($aFT[0]) : $aFT[0]) If $iRet_tSYSTEMTIME Then Return $tST Return _Date_Time_SystemTimeToDateTimeStr($tST, 1) EndIf Return SetError(11, 0, "Process does not exist") EndFunc ;==>ProcessStartDate I have a bunch of RDP running and wanted to identify which is which and thought of the Process date and PID, to know that the given process was from X connection because when it disconnects the popup window does not have any info. in regards to what disconnected ... , am working on it. And thought that the function was a good snippet to share. Edited October 28 by argumentum SOLVE-SMART, TheDcoder and robertocm 3 Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now