Minimizes the new Outlook (olk.exe) to the system tray when you close the window, instead of exiting the application.
- Intercepts window close and hides Outlook instead of closing it
- System tray icon with right-click menu
- Left-click tray icon to restore Outlook
- Option to run at Windows startup
- Lightweight and runs in the background
- Windows 10/11 (64-bit)
- New Outlook app (olk.exe)
- MSYS2 with MinGW-w64 (for building)
- Install MSYS2
- Open MSYS2 terminal and install the toolchain:
pacman -S mingw-w64-x86_64-gcc mingw-w64-x86_64-make
- Add
C:\msys64\mingw64\binto your Windows PATH
-
Clone the repository:
git clone https://github.com/YOUR_USERNAME/OutlookToTray.git cd OutlookToTray -
Run the build script:
build.bat
-
The output files will be in the
bin/folder:OutlookToTray.exe- Main applicationOutlookToTray.dll- Hook library
- Copy both
OutlookToTray.exeandOutlookToTray.dllto the same folder - Run
OutlookToTray.exe - A gear icon will appear in your system tray
- Open Outlook and use it normally
- When you close Outlook's window, it will hide to the tray instead of exiting
- Left-click the tray icon to restore Outlook
- Right-click the tray icon for options:
- Restore Outlook - Show the hidden window
- Run at Startup - Toggle automatic startup with Windows
- About - Version information
- Exit - Close the application
The application uses a Windows hook (WH_CALLWNDPROC) to intercept window messages. When Outlook's main window receives a WM_CLOSE message, the hook hides the window instead of allowing it to close. A memory-mapped file is used for cross-process communication between the hook DLL and the main application.
OutlookToTray/
├── OutlookToTray.Dll/ # Hook DLL
│ └── OutlookToTray.Dll.cpp # Hook implementation
├── OutlookToTray.Exe/ # Main application
│ ├── OutlookToTray.Exe.cpp # Tray app implementation
│ ├── resource.h # Resource definitions
│ └── OutlookToTray.rc # Resource script
├── build.bat # Build script for MinGW
├── Makefile # Alternative Makefile
└── OutlookToTray.sln # Visual Studio solution (optional)
MIT License - feel free to use and modify as you like.