Close tabs on exit button when minimize to tray enabled
-
lavshyak
- Posts: 2
- Joined: 25 Aug 2026 10:51
Close tabs on exit button when minimize to tray enabled
Close all tabs and forget tree state on exit button when minimize to tray enabled, I use "minimize to tray" only so it opens quickly next time.
-
Native2904
- Posts: 148
- Joined: 23 Apr 2025 18:48
- Location: Aachen
Re: Close tabs on exit button when minimize to tray enabled
Hi, normally with XYplorer you can script pretty much everything yourself. If there isn't a command for something, you can create a button and assign a script (ID) to it, which can then execute several commands one after another in a single step.
For what you want, it should be something like:
- Optimize Tree
- tab([closeothers])
- exit
Hope this helps you a little further.
For what you want, it should be something like:
- Optimize Tree
- tab([closeothers])
- exit
Hope this helps you a little further.
-
lavshyak
- Posts: 2
- Joined: 25 Aug 2026 10:51
Re: Close tabs on exit button when minimize to tray enabled
Code: Select all
focus "P1";
goto "%computer%";
tab("closeothers");
#484;
focus "P2";
goto "%computer%";
tab("closeothers");
#484;
focus "P1";
run """%WINDIR%\System32\WindowsPowerShell\v1.0\powershell.exe"" -NoProfile -ExecutionPolicy Bypass -File ""C:\XyplorerExit.ps1"" <hwnd>";
Code: Select all
try {
Add-Type @'
using System;
using System.Runtime.InteropServices;
public class Win32 {
[DllImport("user32.dll")]
public static extern IntPtr SendMessage(
IntPtr hWnd,
uint Msg,
IntPtr wParam,
IntPtr lParam
);
}
'@
$hwnd = [IntPtr]([Int64]$args[0])
Write-Host "HWND: $hwnd"
if ($hwnd -eq [IntPtr]::Zero) {
throw "Invalid HWND"
}
$result = [Win32]::SendMessage(
$hwnd,
0x0112,
[IntPtr]0xF060,
[IntPtr]0
)
Write-Host "Result: $result"
}
catch {
Write-Host ""
Write-Host "ERROR:" -ForegroundColor Red
Write-Host $_.Exception.Message -ForegroundColor Red
Write-Host ""
Write-Host $_.ScriptStackTrace
}
Last edited by lavshyak on 08 Sep 2026 03:29, edited 1 time in total.
-
jupe
- Posts: 3483
- Joined: 20 Oct 2017 21:14
- Location: Win10 22H2 120dpi
Re: Close tabs on exit button when minimize to tray enabled
It seems like just disabling these would fulfill your request:
Configuration | General | Startup & Exit | Save Settings | Include most-recently-used lists on save >> [ ] Tabs
Configuration | General | Tree and List | Tree | [ ] Remember state of tree
Configuration | General | Startup & Exit | Save Settings | Include most-recently-used lists on save >> [ ] Tabs
Configuration | General | Tree and List | Tree | [ ] Remember state of tree
XYplorer Beta Club