diff -Nur source/MainFrm.cpp source.patch/MainFrm.cpp
old
|
new
|
|
254 | 254 | m_pDragWnd = NULL; |
255 | 255 | m_DropTarget = _T(""); |
256 | 256 | |
| 257 | m_bMaxBeforeTray = false; |
| 258 | |
257 | 259 | m_bSwitchPaneLayout = FALSE; |
258 | 260 | } |
259 | 261 | |
… |
… |
|
3614 | 3616 | WINDOWPLACEMENT placement; |
3615 | 3617 | placement.length = sizeof(WINDOWPLACEMENT); |
3616 | 3618 | placement.rcNormalPosition = m_PosData.NormalRect; |
3617 | | placement.showCmd = SW_RESTORE; |
| 3619 | if (m_bMaxBeforeTray) |
| 3620 | placement.showCmd = SW_SHOWMAXIMIZED; |
| 3621 | else |
| 3622 | placement.showCmd = SW_RESTORE; |
3618 | 3623 | SetWindowPlacement(&placement); |
3619 | 3624 | m_PosData.state = 0; |
3620 | 3625 | } |
3621 | 3626 | else |
3622 | | CFrameWnd::OnSysCommand( nID, lParam ); |
3623 | | if (nID == SC_MINIMIZE) |
3624 | 3627 | { |
3625 | | if (COptions::GetOptionVal(OPTION_MINIMIZETOTRAY) == 1) |
| 3628 | if (nID == SC_MINIMIZE || nID == SC_MINIMIZETRAY) |
3626 | 3629 | { |
3627 | 3630 | WINDOWPLACEMENT placement; |
3628 | 3631 | BOOL res=GetWindowPlacement(&placement); |
… |
… |
|
3630 | 3633 | m_bMaxBeforeTray = true; |
3631 | 3634 | else |
3632 | 3635 | m_bMaxBeforeTray = false; |
| 3636 | } |
| 3637 | CFrameWnd::OnSysCommand( nID, lParam ); |
| 3638 | } |
| 3639 | if (nID == SC_MINIMIZE) |
| 3640 | { |
| 3641 | if (COptions::GetOptionVal(OPTION_MINIMIZETOTRAY) == 1) |
| 3642 | { |
3633 | 3643 | ShowWindow(SW_HIDE); |
3634 | 3644 | m_TrayIcon.AddIcon(); |
3635 | 3645 | m_TrayIcon.ShowIcon(); |
… |
… |
|
3637 | 3647 | } |
3638 | 3648 | else if (nID == SC_MINIMIZETRAY) |
3639 | 3649 | { |
3640 | | WINDOWPLACEMENT placement; |
3641 | | BOOL res=GetWindowPlacement(&placement); |
3642 | | if (placement.showCmd==SW_MAXIMIZE || placement.showCmd==SW_SHOWMAXIMIZED) |
3643 | | m_bMaxBeforeTray = true; |
3644 | | else |
3645 | | m_bMaxBeforeTray = false; |
3646 | 3650 | ShowWindow(SW_HIDE); |
3647 | 3651 | m_TrayIcon.AddIcon(); |
3648 | 3652 | m_TrayIcon.ShowIcon(); |
3649 | 3653 | } |
3650 | 3654 | else if (nID == SC_RESTORE) |
3651 | 3655 | { |
3652 | | ShowWindow(SW_SHOW); |
| 3656 | if (m_bMaxBeforeTray) |
| 3657 | ShowWindow(SW_SHOWMAXIMIZED); |
| 3658 | else |
| 3659 | ShowWindow(SW_SHOW); |
| 3660 | m_bMaxBeforeTray = false; |
3653 | 3661 | m_TrayIcon.HideIcon(); |
3654 | 3662 | } |
3655 | 3663 | } |
… |
… |
|
3845 | 3853 | ShowWindow(SW_SHOWMAXIMIZED); |
3846 | 3854 | else |
3847 | 3855 | ShowWindow(SW_SHOW); |
| 3856 | m_bMaxBeforeTray = false; |
3848 | 3857 | m_TrayIcon.HideIcon(); |
3849 | 3858 | } |
3850 | 3859 | |