better foreground window handling (VCL applications had problems with the old one)

svn path=/trunk/; revision=8106
This commit is contained in:
Martin Fuchs 2004-02-08 22:47:25 +00:00
parent a320c0cca9
commit 9a53ebcb92

View file

@ -297,7 +297,10 @@ BOOL CALLBACK TaskBar::EnumWndProc(HWND hwnd, LPARAM lparam)
++entry._used;
btn.idCommand = entry._id;
if (hwnd == GetForegroundWindow()) {
HWND foreground = GetForegroundWindow();
HWND foreground_owner = GetWindow(foreground, GW_OWNER);
if (hwnd==foreground || hwnd==foreground_owner) {
btn.fsState |= TBSTATE_PRESSED|TBSTATE_CHECKED;
pThis->_last_foreground_wnd = hwnd;
}
@ -311,6 +314,7 @@ BOOL CALLBACK TaskBar::EnumWndProc(HWND hwnd, LPARAM lparam)
entry._btn_idx = SendMessage(pThis->_htoolbar, TB_BUTTONCOUNT, 0, 0);
SendMessage(pThis->_htoolbar, TB_INSERTBUTTON, entry._btn_idx, (LPARAM)&btn);
SendMessage(pThis->_htoolbar, TB_AUTOSIZE, 0, 0); ///@todo useless?
} else {
// refresh attributes of existing buttons
if (btn.fsState != entry._fsState)
@ -365,6 +369,7 @@ void TaskBar::Refresh()
}
}
if (!btn_idx_to_delete.empty()) {
// remove buttons from right to left
for(set<int>::reverse_iterator it=btn_idx_to_delete.rbegin(); it!=btn_idx_to_delete.rend(); ++it) {
int idx = *it;
@ -379,6 +384,9 @@ void TaskBar::Refresh()
--entry._btn_idx;
}
}
SendMessage(_htoolbar, TB_AUTOSIZE, 0, 0); ///@todo useless?
}
}
TaskBarMap::iterator TaskBarMap::find_id(int id)