Nikolas92 Posted December 15, 2016 Share Posted December 15, 2016 This worked in windows 7, but doesnt work in windows 10. Any way to delete Safely Remove Hardware and Eject Media tray icon in windows 10? #NoTrayIcon #RequireAdmin #include <APIShellExConstants.au3> #include <WinAPIShellEx.au3> Global $tNOTIFYICONDATA = DllStructCreate($tagNOTIFYICONDATA) DllStructSetData($tNOTIFYICONDATA, 'Size', DllStructGetSize($tNOTIFYICONDATA)) DllStructSetData($tNOTIFYICONDATA, 'Flags', $NIF_ICON) DllStructSetData($tNOTIFYICONDATA, 'ID', 1226) $systray = WinGetHandle("[Class:SystemTray_Main]") DllStructSetData($tNOTIFYICONDATA, 'hWnd', $systray) $result = _WinAPI_ShellNotifyIcon($NIM_DELETE, $tNOTIFYICONDATA) If $result = 1 Then MsgBox(0,'','Icon removed.') Else MsgBox(0,'','Icon not found.') EndIf Link to comment Share on other sites More sharing options...
careca Posted December 15, 2016 Share Posted December 15, 2016 I thought changing the class to Shell_TrayWnd would work, but still doesn't. Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe Link to comment Share on other sites More sharing options...
spudw2k Posted December 15, 2016 Share Posted December 15, 2016 Was looking for a way to enumerate icon IDs in the systray...not having much luck, but I'd expect the ID is hard coded like 1226 is for Win 7 (unless I;m misinterpretting that values purpose). Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX Builder Misc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retrieve SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose Array Projects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalc Cool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
Nikolas92 Posted December 15, 2016 Author Share Posted December 15, 2016 (edited) 1 hour ago, spudw2k said: Was looking for a way to enumerate icon IDs in the systray... I found here script for that: https://www.autoitscript.com/forum/topic/134538-get-systray-icons-solved/?do=findComment&comment=948301 I changed it a little to show ID instead of process name: Systray Info.au3 Edited December 15, 2016 by Nikolas92 Link to comment Share on other sites More sharing options...
spudw2k Posted December 15, 2016 Share Posted December 15, 2016 Nice, so if you run that script, can you see the ID for the icon? I'm not at a Win 10 machine to test myself. Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX Builder Misc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retrieve SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose Array Projects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalc Cool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
Nikolas92 Posted December 15, 2016 Author Share Posted December 15, 2016 (edited) id is same (1226), but for Module instead of stobject.dll (on windows 7) it shows explorer.exe on windows 10 Edited December 15, 2016 by Nikolas92 Link to comment Share on other sites More sharing options...
Nikolas92 Posted December 16, 2016 Author Share Posted December 16, 2016 Any way to delete Safely Remove Hardware and Eject Media tray icon in windows 10 or not? Link to comment Share on other sites More sharing options...
spudw2k Posted December 21, 2016 Share Posted December 21, 2016 probably, just no one's replied who knows how...including me. Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX Builder Misc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retrieve SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose Array Projects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalc Cool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
careca Posted December 21, 2016 Share Posted December 21, 2016 Im interested in this, but can't help further. Sry. Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe Link to comment Share on other sites More sharing options...
Nikolas92 Posted December 25, 2016 Author Share Posted December 25, 2016 (edited) It looks that this works. expandcollapse popup; www.autoitscript.com/forum/topic/186068-how-to-delete-safely-remove-hardware-and-eject-media-tray-icon-in-windows-10/ #NoTrayIcon #RequireAdmin #include <APIShellExConstants.au3> #include <WinAPIShellEx.au3> #include <WinAPIProc.au3> #include <WinAPI.au3> Global $aAdjust, $hToken Global $tNOTIFYICONDATA = DllStructCreate($tagNOTIFYICONDATA) DllStructSetData($tNOTIFYICONDATA, 'Size', DllStructGetSize($tNOTIFYICONDATA)) DllStructSetData($tNOTIFYICONDATA, 'Flags', $NIF_ICON) DllStructSetData($tNOTIFYICONDATA, 'ID', 1124) $hToken = _WinAPI_OpenProcessToken(BitOR($TOKEN_ADJUST_PRIVILEGES, $TOKEN_QUERY)) _WinAPI_AdjustTokenPrivileges($hToken, $SE_DEBUG_NAME, $SE_PRIVILEGE_ENABLED, $aAdjust) $aProcessList = ProcessList('RunDll32.exe') For $i = 1 To $aProcessList[0][0] If _WinAPI_GetProcessCommandLine($aProcessList[$i][1]) = 'hotplug.dll,HotPlugSafeRemovalDriveNotification' Then ProcessClose($aProcessList[$i][1]) Next _WinAPI_AdjustTokenPrivileges($hToken, $aAdjust, 0, $aAdjust) _WinAPI_CloseHandle($hToken) $iPid = Run('RunDll32.exe' & ' hotplug.dll,HotPlugSafeRemovalDriveNotification') $Hotplug = '' Do Sleep(10) $aData = _WinAPI_EnumProcessWindows($iPid, False) If @error = 0 Then For $x = 1 To $aData[0][0] If _WinAPI_GetClassName($aData[$x][0]) = 'HotPlugClass' Then $Hotplug = $aData[$x][0] ExitLoop EndIf Next EndIf Until $Hotplug <> '' DllStructSetData($tNOTIFYICONDATA, 'hWnd', $Hotplug) $result = _WinAPI_ShellNotifyIcon($NIM_DELETE, $tNOTIFYICONDATA) If $result = 1 Then MsgBox(0,'','Icon removed.') Else MsgBox(0,'','Icon not found.') EndIf expandcollapse popup; www.autoitscript.com/forum/topic/186068-how-to-delete-safely-remove-hardware-and-eject-media-tray-icon-in-windows-10/ #NoTrayIcon #RequireAdmin #include <APIShellExConstants.au3> #include <WinAPIShellEx.au3> #include <WinAPIProc.au3> #include <WinAPI.au3> Opt("WinWaitDelay", 0) Opt("MouseClickDelay", 0) Opt("MouseClickDownDelay", 0) Opt("MouseClickDragDelay", 0) Opt("SendKeyDelay", 0) Opt("SendKeyDownDelay", 0) Opt("WinTitleMatchMode", 3) Global $iPid Global $result Global $aAdjust, $hToken Global $tNOTIFYICONDATA = DllStructCreate($tagNOTIFYICONDATA) DllStructSetData($tNOTIFYICONDATA, 'Size', DllStructGetSize($tNOTIFYICONDATA)) DllStructSetData($tNOTIFYICONDATA, 'Flags', $NIF_ICON) DllStructSetData($tNOTIFYICONDATA, 'ID', 1124) _DeleteSafelyRemoveHardwareTrayIcon() AdlibRegister('_CheckProcess') While 1 Sleep(1000) WEnd Func _CheckProcess() If not ProcessExists($iPid) Then _DeleteSafelyRemoveHardwareTrayIcon() EndFunc Func _DeleteSafelyRemoveHardwareTrayIcon() $hToken = _WinAPI_OpenProcessToken(BitOR($TOKEN_ADJUST_PRIVILEGES, $TOKEN_QUERY)) _WinAPI_AdjustTokenPrivileges($hToken, $SE_DEBUG_NAME, $SE_PRIVILEGE_ENABLED, $aAdjust) $aProcessList = ProcessList('RunDll32.exe') For $i = 1 To $aProcessList[0][0] If _WinAPI_GetProcessCommandLine($aProcessList[$i][1]) = 'hotplug.dll,HotPlugSafeRemovalDriveNotification' Then ProcessClose($aProcessList[$i][1]) Next _WinAPI_AdjustTokenPrivileges($hToken, $aAdjust, 0, $aAdjust) _WinAPI_CloseHandle($hToken) $iPid = Run('RunDll32.exe' & ' hotplug.dll,HotPlugSafeRemovalDriveNotification') $Hotplug = '' Do Sleep(10) $aData = _WinAPI_EnumProcessWindows($iPid, False) If @error = 0 Then For $x = 1 To $aData[0][0] If _WinAPI_GetClassName($aData[$x][0]) = 'HotPlugClass' Then $Hotplug = $aData[$x][0] ExitLoop EndIf Next EndIf Until $Hotplug <> '' DllStructSetData($tNOTIFYICONDATA, 'hWnd', $Hotplug) $result = _WinAPI_ShellNotifyIcon($NIM_DELETE, $tNOTIFYICONDATA) If $result = 1 Then MsgBox(0,'','Icon removed.') Else MsgBox(0,'','Icon not found.') EndIf Return $result EndFunc Edited December 25, 2016 by Nikolas92 Link to comment Share on other sites More sharing options...
careca Posted December 26, 2016 Share Posted December 26, 2016 In my win 10 gave error of not able to find the hotplug module dll. Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe Link to comment Share on other sites More sharing options...
kosamja Posted July 12, 2019 Share Posted July 12, 2019 searched recently how to remove this icon, just adding it here since its not easy to find: ; forum.exetools.com/showthread.php?t=9378 #NoTrayIcon #include <GUIConstants.au3> #include <SendMessage.au3> While 1 $SystrayHandle = WinWait('[CLASS:SystemTray_Main]') _SendMessage($SystrayHandle, $WM_USER + 220, 2, 0) WinWaitClose($SystrayHandle) WEnd Earthshine 1 Link to comment Share on other sites More sharing options...
Earthshine Posted July 12, 2019 Share Posted July 12, 2019 you could post it in AutoIt Snippets because that is better than resurrecting dead threads, nice post though My resources are limited. You must ask the right questions 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