mirror of
https://github.com/reactos/reactos.git
synced 2025-02-25 09:50:02 +00:00
fix foreground window handling when clicking on notification area icons
svn path=/trunk/; revision=8408
This commit is contained in:
parent
8fe7e083b3
commit
75f575e7dd
1 changed files with 11 additions and 8 deletions
|
@ -87,7 +87,7 @@ LRESULT TaskBar::Init(LPCREATESTRUCT pcs)
|
||||||
CCS_TOP|CCS_NODIVIDER | TBSTYLE_LIST|TBSTYLE_TOOLTIPS|TBSTYLE_WRAPABLE,
|
CCS_TOP|CCS_NODIVIDER | TBSTYLE_LIST|TBSTYLE_TOOLTIPS|TBSTYLE_WRAPABLE,
|
||||||
IDW_TASKTOOLBAR, 0, 0, 0, NULL, 0, 0, 0, 16, 16, sizeof(TBBUTTON));
|
IDW_TASKTOOLBAR, 0, 0, 0, NULL, 0, 0, 0, 16, 16, sizeof(TBBUTTON));
|
||||||
|
|
||||||
SendMessage(_htoolbar, TB_SETBUTTONWIDTH, 0, MAKELONG(TASKBUTTONWIDTH_MIN,TASKBUTTONWIDTH_MAX));
|
SendMessage(_htoolbar, TB_SETBUTTONWIDTH, 0, MAKELONG(TASKBUTTONWIDTH_MAX,TASKBUTTONWIDTH_MAX));
|
||||||
//SendMessage(_htoolbar, TB_SETEXTENDEDSTYLE, 0, TBSTYLE_EX_MIXEDBUTTONS);
|
//SendMessage(_htoolbar, TB_SETEXTENDEDSTYLE, 0, TBSTYLE_EX_MIXEDBUTTONS);
|
||||||
//SendMessage(_htoolbar, TB_SETDRAWTEXTFLAGS, DT_CENTER|DT_VCENTER, DT_CENTER|DT_VCENTER);
|
//SendMessage(_htoolbar, TB_SETDRAWTEXTFLAGS, DT_CENTER|DT_VCENTER, DT_CENTER|DT_VCENTER);
|
||||||
//SetWindowFont(_htoolbar, GetStockFont(ANSI_VAR_FONT), FALSE);
|
//SetWindowFont(_htoolbar, GetStockFont(ANSI_VAR_FONT), FALSE);
|
||||||
|
@ -321,6 +321,7 @@ BOOL CALLBACK TaskBar::EnumWndProc(HWND hwnd, LPARAM lparam)
|
||||||
entry._btn_idx = SendMessage(pThis->_htoolbar, TB_BUTTONCOUNT, 0, 0);
|
entry._btn_idx = SendMessage(pThis->_htoolbar, TB_BUTTONCOUNT, 0, 0);
|
||||||
|
|
||||||
SendMessage(pThis->_htoolbar, TB_INSERTBUTTON, entry._btn_idx, (LPARAM)&btn);
|
SendMessage(pThis->_htoolbar, TB_INSERTBUTTON, entry._btn_idx, (LPARAM)&btn);
|
||||||
|
|
||||||
pThis->ResizeButtons();
|
pThis->ResizeButtons();
|
||||||
} else {
|
} else {
|
||||||
// refresh attributes of existing buttons
|
// refresh attributes of existing buttons
|
||||||
|
@ -437,13 +438,15 @@ void TaskBar::ResizeButtons()
|
||||||
int btns = _map.size();
|
int btns = _map.size();
|
||||||
|
|
||||||
if (btns > 0) {
|
if (btns > 0) {
|
||||||
int width = ClientRect(_hwnd).right / btns;
|
int bar_width = ClientRect(_hwnd).right;
|
||||||
if (width < TASKBUTTONWIDTH_MIN)
|
int btn_width = bar_width / btns;
|
||||||
width = TASKBUTTONWIDTH_MIN;
|
|
||||||
else if (width > TASKBUTTONWIDTH_MAX)
|
|
||||||
width = TASKBUTTONWIDTH_MAX;
|
|
||||||
|
|
||||||
SendMessage(_htoolbar, TB_SETBUTTONWIDTH, 0, MAKELONG(TASKBUTTONWIDTH_MIN,width));
|
if (btn_width < TASKBUTTONWIDTH_MIN)
|
||||||
// SendMessage(_htoolbar, TB_AUTOSIZE, 0, 0);
|
btn_width = TASKBUTTONWIDTH_MIN;
|
||||||
|
else if (btn_width > TASKBUTTONWIDTH_MAX)
|
||||||
|
btn_width = TASKBUTTONWIDTH_MAX;
|
||||||
|
|
||||||
|
SendMessage(_htoolbar, TB_SETBUTTONWIDTH, 0, MAKELONG(btn_width,btn_width));
|
||||||
|
SendMessage(_htoolbar, TB_AUTOSIZE, 0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue