mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 14:43:02 +00:00
- use PostMessage(WM_SYSCOMMAND) instead of ShowWindowAsync(SW_MINIMIZE) to minimize application windows when clicking on the taskbar
-> for example mIRC needs this to "minimize to the tray" - fix determination of the last foreground window svn path=/trunk/; revision=7858
This commit is contained in:
parent
19f91f8fd9
commit
1d58bfad3b
1 changed files with 5 additions and 3 deletions
|
@ -192,12 +192,12 @@ void TaskBar::ActivateApp(TaskBarMap::iterator it, bool can_minimize)
|
||||||
HWND hwnd = it->first;
|
HWND hwnd = it->first;
|
||||||
|
|
||||||
if (can_minimize && (hwnd==GetForegroundWindow() || hwnd==_last_foreground_wnd)) {
|
if (can_minimize && (hwnd==GetForegroundWindow() || hwnd==_last_foreground_wnd)) {
|
||||||
ShowWindowAsync(hwnd, SW_MINIMIZE);
|
PostMessage(hwnd, WM_SYSCOMMAND, SC_MINIMIZE, 0);
|
||||||
_last_foreground_wnd = 0;
|
_last_foreground_wnd = 0;
|
||||||
} else {
|
} else {
|
||||||
// switch to selected application window
|
// switch to selected application window
|
||||||
if (IsIconic(hwnd))
|
if (IsIconic(hwnd))
|
||||||
ShowWindowAsync(hwnd, SW_RESTORE);
|
PostMessage(hwnd, WM_SYSCOMMAND, SC_RESTORE, 0);
|
||||||
|
|
||||||
SetForegroundWindow(hwnd);
|
SetForegroundWindow(hwnd);
|
||||||
|
|
||||||
|
@ -297,8 +297,10 @@ BOOL CALLBACK TaskBar::EnumWndProc(HWND hwnd, LPARAM lparam)
|
||||||
++entry._used;
|
++entry._used;
|
||||||
btn.idCommand = entry._id;
|
btn.idCommand = entry._id;
|
||||||
|
|
||||||
if (hwnd == GetForegroundWindow())
|
if (hwnd == GetForegroundWindow()) {
|
||||||
btn.fsState |= TBSTATE_PRESSED|TBSTATE_CHECKED;
|
btn.fsState |= TBSTATE_PRESSED|TBSTATE_CHECKED;
|
||||||
|
pThis->_last_foreground_wnd = hwnd;
|
||||||
|
}
|
||||||
|
|
||||||
if (!last_id) {
|
if (!last_id) {
|
||||||
// create new toolbar buttons for new windows
|
// create new toolbar buttons for new windows
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue