From ab002cad52abec97d9d1d96c84e5697db895d2e2 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 10 Sep 2019 22:08:11 +0300 Subject: Scriver: rollback of malicious changes, original order of things restored --- plugins/Scriver/src/chat_window.cpp | 114 ++++++++--------------------- plugins/Scriver/src/msgdialog.cpp | 138 +++++++++++++++++++++++++++++------- plugins/Scriver/src/msgoptions.cpp | 9 +-- plugins/Scriver/src/tabs.cpp | 33 +++------ 4 files changed, 155 insertions(+), 139 deletions(-) (limited to 'plugins') diff --git a/plugins/Scriver/src/chat_window.cpp b/plugins/Scriver/src/chat_window.cpp index 5b3d886ccf..401bb3d1f4 100644 --- a/plugins/Scriver/src/chat_window.cpp +++ b/plugins/Scriver/src/chat_window.cpp @@ -193,81 +193,37 @@ void CMsgDialog::UpdateNickList() void CMsgDialog::UpdateOptions() { - m_bUseRtl = g_plugin.getByte(m_hContact, "UseRTL", 0) != 0; - m_bUseIEView = (g_dat.ieviewInstalled && g_dat.flags.bUseIeview && !isChat()); - - if (m_bUseIEView && m_hwndIeview == nullptr) { - IEVIEWWINDOW ieWindow = { sizeof(ieWindow) }; - ieWindow.iType = IEW_CREATE; - ieWindow.dwMode = IEWM_SCRIVER; - ieWindow.parent = m_hwnd; - ieWindow.cx = 200; - ieWindow.cy = 300; - CallService(MS_IEVIEW_WINDOW, 0, (LPARAM)& ieWindow); - m_hwndIeview = ieWindow.hwnd; - if (m_hwndIeview == nullptr) - m_bUseIEView = false; - } - else if (!m_bUseIEView && m_hwndIeview != nullptr) { - if (m_hwndIeview != nullptr) { - IEVIEWWINDOW ieWindow = { sizeof(ieWindow) }; - ieWindow.iType = IEW_DESTROY; - ieWindow.hwnd = m_hwndIeview; - CallService(MS_IEVIEW_WINDOW, 0, (LPARAM)& ieWindow); - } - m_hwndIeview = nullptr; - } + m_btnNickList.SendMsg(BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(m_bNicklistEnabled ? IDI_NICKLIST : IDI_NICKLIST2)); + m_btnFilter.SendMsg(BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(m_bFilterEnabled ? IDI_FILTER : IDI_FILTER2)); - SendMessage(m_hwnd, DM_GETAVATAR, 0, 0); - SetDialogToType(); - - COLORREF colour = g_plugin.getDword(SRMSGSET_BKGCOLOUR, SRMSGDEFSET_BKGCOLOUR); - m_log.SendMsg(EM_SETBKGNDCOLOR, 0, colour); - colour = g_plugin.getDword(SRMSGSET_INPUTBKGCOLOUR, SRMSGDEFSET_INPUTBKGCOLOUR); - m_message.SendMsg(EM_SETBKGNDCOLOR, 0, colour); - InvalidateRect(m_message.GetHwnd(), nullptr, FALSE); - - LOGFONT lf; - LoadMsgDlgFont(MSGFONTID_MESSAGEAREA, &lf, &colour); - - CHARFORMAT2 cf2; - memset(&cf2, 0, sizeof(cf2)); - cf2.cbSize = sizeof(cf2); - cf2.dwMask = CFM_COLOR | CFM_FACE | CFM_CHARSET | CFM_SIZE | CFM_WEIGHT | CFM_BOLD | CFM_ITALIC; - cf2.crTextColor = colour; - cf2.bCharSet = lf.lfCharSet; - wcsncpy(cf2.szFaceName, lf.lfFaceName, LF_FACESIZE); - cf2.dwEffects = ((lf.lfWeight >= FW_BOLD) ? CFE_BOLD : 0) | (lf.lfItalic ? CFE_ITALIC : 0); - cf2.wWeight = (WORD)lf.lfWeight; - cf2.bPitchAndFamily = lf.lfPitchAndFamily; - cf2.yHeight = abs(lf.lfHeight) * 1440 / g_dat.logPixelSY; - m_message.SendMsg(EM_SETCHARFORMAT, SCF_ALL, (LPARAM)& cf2); - m_message.SendMsg(EM_SETLANGOPTIONS, 0, (LPARAM)m_message.SendMsg(EM_GETLANGOPTIONS, 0, 0) & ~IMF_AUTOKEYBOARD); - - PARAFORMAT2 pf2; - memset(&pf2, 0, sizeof(pf2)); - pf2.cbSize = sizeof(pf2); - pf2.dwMask = PFM_OFFSET; - pf2.dxOffset = (g_dat.flags.bIndentText) ? g_dat.indentSize * 1440 / g_dat.logPixelSX : 0; - - ClearLog(); - m_log.SendMsg(EM_SETPARAFORMAT, 0, (LPARAM)& pf2); - m_log.SendMsg(EM_SETLANGOPTIONS, 0, (LPARAM)m_log.SendMsg(EM_GETLANGOPTIONS, 0, 0) & ~(IMF_AUTOKEYBOARD | IMF_AUTOFONTSIZEADJUST)); - - if (isChat()) { - m_btnNickList.SendMsg(BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(m_bNicklistEnabled ? IDI_NICKLIST : IDI_NICKLIST2)); - m_btnFilter.SendMsg(BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(m_bFilterEnabled ? IDI_FILTER : IDI_FILTER2)); - - m_btnBold.Enable(m_si->pMI->bBold); - m_btnItalic.Enable(m_si->pMI->bItalics); - m_btnUnderline.Enable(m_si->pMI->bUnderline); - m_btnColor.Enable(m_si->pMI->bColor); - m_btnBkColor.Enable(m_si->pMI->bBkgColor); - if (m_si->iType == GCW_CHATROOM) - m_btnChannelMgr.Enable(m_si->pMI->bChanMgr); - - FixTabIcons(); + m_btnBold.Enable(m_si->pMI->bBold); + m_btnItalic.Enable(m_si->pMI->bItalics); + m_btnUnderline.Enable(m_si->pMI->bUnderline); + m_btnColor.Enable(m_si->pMI->bColor); + m_btnBkColor.Enable(m_si->pMI->bBkgColor); + if (m_si->iType == GCW_CHATROOM) + m_btnChannelMgr.Enable(m_si->pMI->bChanMgr); + UpdateStatusBar(); + UpdateTitle(); + FixTabIcons(); + + m_log.SendMsg(EM_SETBKGNDCOLOR, 0, g_Settings.crLogBackground); + + // messagebox + COLORREF crFore; + LoadMsgDlgFont(MSGFONTID_MESSAGEAREA, nullptr, &crFore); + + CHARFORMAT2 cf; + cf.cbSize = sizeof(CHARFORMAT2); + cf.dwMask = CFM_COLOR | CFM_BOLD | CFM_UNDERLINE | CFM_BACKCOLOR; + cf.dwEffects = 0; + cf.crTextColor = crFore; + cf.crBackColor = g_plugin.getDword(SRMSGSET_INPUTBKGCOLOUR, SRMSGDEFSET_INPUTBKGCOLOUR); + m_message.SendMsg(EM_SETBKGNDCOLOR, 0, g_plugin.getDword(SRMSGSET_INPUTBKGCOLOUR, SRMSGDEFSET_INPUTBKGCOLOUR)); + m_message.SendMsg(WM_SETFONT, (WPARAM)g_Settings.MessageBoxFont, MAKELPARAM(TRUE, 0)); + m_message.SendMsg(EM_SETCHARFORMAT, SCF_ALL, (LPARAM)&cf); + { // nicklist int ih = Chat_GetTextPixelSize(L"AQG_glo'", g_Settings.UserListFont, false); int ih2 = Chat_GetTextPixelSize(L"AQG_glo'", g_Settings.UserListHeadingsFont, false); @@ -279,19 +235,10 @@ void CMsgDialog::UpdateOptions() m_nickList.SendMsg(LB_SETITEMHEIGHT, 0, height > font ? height : font); InvalidateRect(m_nickList.GetHwnd(), nullptr, TRUE); - - RedrawLog2(); } - else { - UpdateTabControl(); - SetupInfobar(); - } - - UpdateTitle(); - UpdateStatusBar(); - m_message.SendMsg(EM_REQUESTRESIZE, 0, 0); Resize(); + RedrawLog2(); } ///////////////////////////////////////////////////////////////////////////////////////// @@ -384,7 +331,6 @@ void ShowRoom(SESSION_INFO *si) else pDlg = si->pDlg; pDlg->UpdateTabControl(); - pDlg->PopupWindow(); SendMessage(pDlg->GetHwnd(), WM_MOUSEACTIVATE, 0, 0); SetFocus(GetDlgItem(pDlg->GetHwnd(), IDC_SRMM_MESSAGE)); } diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp index 547f745cfc..685d892e24 100644 --- a/plugins/Scriver/src/msgdialog.cpp +++ b/plugins/Scriver/src/msgdialog.cpp @@ -229,8 +229,8 @@ bool CMsgDialog::OnInitDialog() m_lastEventTime = time(0); m_startTime = time(0); - m_pParent->AddChild(this); - UpdateOptions(); + m_bUseRtl = g_plugin.getByte(m_hContact, "UseRTL", 0) != 0; + m_bUseIEView = g_dat.ieviewInstalled ? g_dat.flags.bUseIeview : false; PARAFORMAT2 pf2; memset(&pf2, 0, sizeof(pf2)); @@ -307,18 +307,37 @@ bool CMsgDialog::OnInitDialog() m_message.SendMsg(EM_EXLIMITTEXT, 0, nMax); } + // get around a lame bug in the Windows template resource code where richedits are limited to 0x7FFF + m_log.SendMsg(EM_LIMITTEXT, sizeof(wchar_t) * 0x7FFFFFFF, 0); + ::DragAcceptFiles(m_message.GetHwnd(), TRUE); + CreateInfobar(); + + if (m_bUseIEView) { + IEVIEWWINDOW ieWindow = { sizeof(IEVIEWWINDOW) }; + ieWindow.iType = IEW_CREATE; + ieWindow.dwMode = IEWM_SCRIVER; + ieWindow.parent = m_hwnd; + ieWindow.cx = 200; + ieWindow.cy = 300; + CallService(MS_IEVIEW_WINDOW, 0, (LPARAM)&ieWindow); + m_hwndIeview = ieWindow.hwnd; + if (m_hwndIeview == nullptr) + m_bUseIEView = false; + } + if (isChat()) { + UpdateOptions(); UpdateStatusBar(); UpdateTitle(); UpdateNickList(); + + m_pParent->AddChild(this); + m_pParent->PopupWindow(m_hwnd, false); } else { m_nickList.Hide(); m_splitterX.Hide(); - ::DragAcceptFiles(m_message.GetHwnd(), TRUE); - CreateInfobar(); - bool notifyUnread = false; if (m_hContact) { int historyMode = g_plugin.iHistoryMode; @@ -376,6 +395,8 @@ bool CMsgDialog::OnInitDialog() } } + m_pParent->AddChild(this); + MEVENT hdbEvent = db_event_last(m_hContact); if (hdbEvent) { DBEVENTINFO dbei = {}; @@ -388,7 +409,8 @@ bool CMsgDialog::OnInitDialog() } while ((hdbEvent = db_event_prev(m_hContact, hdbEvent))); } - SendMessage(m_hwnd, DM_REMAKELOG, 0, 0); + SendMessage(m_hwnd, DM_OPTIONSAPPLIED, 0, 0); + m_pParent->PopupWindow(m_hwnd, m_bIncoming); if (notifyUnread) { if (GetForegroundWindow() != m_hwndParent || m_pParent->m_hwndActive != m_hwnd) { @@ -404,7 +426,6 @@ bool CMsgDialog::OnInitDialog() SendMessage(m_hwnd, DM_SHOWMESSAGESENDING, 0, 0); } - PopupWindow(m_bIncoming); NotifyEvent(MSG_WINDOW_EVT_OPEN); return true; } @@ -860,10 +881,7 @@ void CMsgDialog::SetDialogToType() } m_message.Show(); - - bool bLogEnabled = (m_hwndIeview == nullptr); - m_log.Show(bLogEnabled); - m_log.Enable(bLogEnabled); + m_log.Show(m_hwndIeview == nullptr); m_splitterY.Show(); m_btnOk.Enable(m_message.GetRichTextLength() != 0); @@ -907,44 +925,47 @@ void CMsgDialog::UpdateStatusBar() if (m_pParent->m_hwndActive != m_hwnd) return; - wchar_t szTemp[512]; - - StatusBarData sbd = {}; - sbd.iFlags = SBDF_TEXT | SBDF_ICON; - sbd.pszText = szTemp; - if (isChat()) { + wchar_t szTemp[512]; mir_snwprintf(szTemp, L"%s : %s", m_si->pMI->ptszModDispName, m_si->ptszStatusbarText ? m_si->ptszStatusbarText : L""); + StatusBarData sbd; sbd.iItem = 0; sbd.iFlags = SBDF_TEXT | SBDF_ICON; sbd.hIcon = m_si->wStatus == ID_STATUS_ONLINE ? m_si->pMI->hOnlineIcon : m_si->pMI->hOfflineIcon; + sbd.pszText = szTemp; m_pParent->UpdateStatusBar(sbd, m_hwnd); sbd.iItem = 1; sbd.hIcon = nullptr; - szTemp[0] = 0; + sbd.pszText = L""; m_pParent->UpdateStatusBar(sbd, m_hwnd); Srmm_SetIconFlags(m_hContact, SRMM_MODULE, 0, 0); } else { + wchar_t szText[256]; + StatusBarData sbd = { 0 }; + sbd.iFlags = SBDF_TEXT | SBDF_ICON; if (m_iMessagesInProgress && g_dat.flags.bShowProgress) { sbd.hIcon = g_plugin.getIcon(IDI_TIMESTAMP); - mir_snwprintf(szTemp, TranslateT("Sending in progress: %d message(s) left..."), m_iMessagesInProgress); + sbd.pszText = szText; + mir_snwprintf(szText, TranslateT("Sending in progress: %d message(s) left..."), m_iMessagesInProgress); } else if (m_nTypeSecs) { sbd.hIcon = g_plugin.getIcon(IDI_TYPING); - mir_snwprintf(szTemp, TranslateT("%s is typing a message..."), Clist_GetContactDisplayName(m_hContact)); + sbd.pszText = szText; + mir_snwprintf(szText, TranslateT("%s is typing a message..."), Clist_GetContactDisplayName(m_hContact)); m_nTypeSecs--; } else if (m_lastMessage) { wchar_t date[64], time[64]; TimeZone_PrintTimeStamp(nullptr, m_lastMessage, L"d", date, _countof(date), 0); TimeZone_PrintTimeStamp(nullptr, m_lastMessage, L"t", time, _countof(time), 0); - mir_snwprintf(szTemp, TranslateT("Last message received on %s at %s."), date, time); + mir_snwprintf(szText, TranslateT("Last message received on %s at %s."), date, time); + sbd.pszText = szText; } - else szTemp[0] = 0; + else sbd.pszText = L""; m_pParent->UpdateStatusBar(sbd, m_hwnd); UpdateReadChars(); @@ -1043,7 +1064,8 @@ void CMsgDialog::UpdateTitle() tbd.pszText = wszTitle.GetBuffer(); m_pParent->UpdateTitleBar(tbd, m_hwnd); - UpdateTabControl(); + if (isChat()) + UpdateTabControl(); } ///////////////////////////////////////////////////////////////////////////////////////// @@ -1596,6 +1618,74 @@ INT_PTR CMsgDialog::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) } break; + case DM_OPTIONSAPPLIED: + m_bUseIEView = g_dat.ieviewInstalled ? g_dat.flags.bUseIeview : false; + if (m_bUseIEView && m_hwndIeview == nullptr) { + IEVIEWWINDOW ieWindow = { sizeof(ieWindow) }; + ieWindow.iType = IEW_CREATE; + ieWindow.dwMode = IEWM_SCRIVER; + ieWindow.parent = m_hwnd; + ieWindow.cx = 200; + ieWindow.cy = 300; + CallService(MS_IEVIEW_WINDOW, 0, (LPARAM)&ieWindow); + m_hwndIeview = ieWindow.hwnd; + if (m_hwndIeview == nullptr) + m_bUseIEView = false; + } + else if (!m_bUseIEView && m_hwndIeview != nullptr) { + if (m_hwndIeview != nullptr) { + IEVIEWWINDOW ieWindow = { sizeof(ieWindow) }; + ieWindow.iType = IEW_DESTROY; + ieWindow.hwnd = m_hwndIeview; + CallService(MS_IEVIEW_WINDOW, 0, (LPARAM)&ieWindow); + } + m_hwndIeview = nullptr; + } + + SendMessage(m_hwnd, DM_GETAVATAR, 0, 0); + SetDialogToType(); + { + COLORREF colour = g_plugin.getDword(SRMSGSET_BKGCOLOUR, SRMSGDEFSET_BKGCOLOUR); + m_log.SendMsg(EM_SETBKGNDCOLOR, 0, colour); + colour = g_plugin.getDword(SRMSGSET_INPUTBKGCOLOUR, SRMSGDEFSET_INPUTBKGCOLOUR); + m_message.SendMsg(EM_SETBKGNDCOLOR, 0, colour); + InvalidateRect(m_message.GetHwnd(), nullptr, FALSE); + + LOGFONT lf; + LoadMsgDlgFont(MSGFONTID_MESSAGEAREA, &lf, &colour); + + CHARFORMAT2 cf2; + memset(&cf2, 0, sizeof(cf2)); + cf2.cbSize = sizeof(cf2); + cf2.dwMask = CFM_COLOR | CFM_FACE | CFM_CHARSET | CFM_SIZE | CFM_WEIGHT | CFM_BOLD | CFM_ITALIC; + cf2.crTextColor = colour; + cf2.bCharSet = lf.lfCharSet; + wcsncpy(cf2.szFaceName, lf.lfFaceName, LF_FACESIZE); + cf2.dwEffects = ((lf.lfWeight >= FW_BOLD) ? CFE_BOLD : 0) | (lf.lfItalic ? CFE_ITALIC : 0); + cf2.wWeight = (WORD)lf.lfWeight; + cf2.bPitchAndFamily = lf.lfPitchAndFamily; + cf2.yHeight = abs(lf.lfHeight) * 1440 / g_dat.logPixelSY; + m_message.SendMsg(EM_SETCHARFORMAT, SCF_ALL, (LPARAM)&cf2); + m_message.SendMsg(EM_SETLANGOPTIONS, 0, (LPARAM)m_message.SendMsg(EM_GETLANGOPTIONS, 0, 0) & ~IMF_AUTOKEYBOARD); + } + + memset(&pf2, 0, sizeof(pf2)); + pf2.cbSize = sizeof(pf2); + pf2.dwMask = PFM_OFFSET; + pf2.dxOffset = (g_dat.flags.bIndentText) ? g_dat.indentSize * 1440 / g_dat.logPixelSX : 0; + + ClearLog(); + m_log.SendMsg(EM_SETPARAFORMAT, 0, (LPARAM)&pf2); + m_log.SendMsg(EM_SETLANGOPTIONS, 0, (LPARAM)m_log.SendMsg(EM_GETLANGOPTIONS, 0, 0) & ~(IMF_AUTOKEYBOARD | IMF_AUTOFONTSIZEADJUST)); + + SendMessage(m_hwnd, DM_REMAKELOG, 0, 0); + UpdateTitle(); + UpdateTabControl(); + UpdateStatusBar(); + m_message.SendMsg(EM_REQUESTRESIZE, 0, 0); + SetupInfobar(); + break; + case DM_USERNAMETOCLIP: if (m_hContact) { char buf[128]; @@ -1790,7 +1880,7 @@ INT_PTR CMsgDialog::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) if (g_dat.flags2.bSwitchToActive && (IsIconic(m_hwndParent) || GetActiveWindow() != m_hwndParent) && IsWindowVisible(m_hwndParent)) m_pParent->ActivateChild(m_hwnd); if (IsAutoPopup(m_hContact)) - PopupWindow(true); + m_pParent->PopupWindow(m_hwnd, true); } if (hDbEvent != m_hDbEventFirst && db_event_next(m_hContact, hDbEvent) == 0) diff --git a/plugins/Scriver/src/msgoptions.cpp b/plugins/Scriver/src/msgoptions.cpp index 062e19990a..45660ba6bc 100644 --- a/plugins/Scriver/src/msgoptions.cpp +++ b/plugins/Scriver/src/msgoptions.cpp @@ -79,8 +79,7 @@ int FontServiceFontsChanged(WPARAM, LPARAM) { LoadMsgLogIcons(); LoadInfobarFonts(); - for (auto &it : g_arDialogs) - it->UpdateOptions(); + Srmm_Broadcast(DM_OPTIONSAPPLIED, 0, 0); return 0; } @@ -183,8 +182,7 @@ class CBaseOptionDlg : public CDlgBase { ReloadGlobals(); WindowList_Broadcast(g_dat.hParentWindowList, DM_OPTIONSAPPLIED, 0, 0); - for (auto &it : g_arDialogs) - it->UpdateOptions(); + Srmm_Broadcast(DM_OPTIONSAPPLIED, 0, 0); Chat_UpdateOptions(); } @@ -841,8 +839,7 @@ static INT_PTR CALLBACK DlgProcTypeOptions(HWND hwndDlg, UINT msg, WPARAM wParam g_plugin.bShowTypingClist = IsDlgButtonChecked(hwndDlg, IDC_NOTIFYTRAY); g_plugin.bShowTypingSwitch = IsDlgButtonChecked(hwndDlg, IDC_TYPINGSWITCH); ReloadGlobals(); - for (auto &it : g_arDialogs) - it->UpdateOptions(); + Srmm_Broadcast(DM_OPTIONSAPPLIED, 0, 0); } break; } diff --git a/plugins/Scriver/src/tabs.cpp b/plugins/Scriver/src/tabs.cpp index e6fb6a798a..dbeabcd992 100644 --- a/plugins/Scriver/src/tabs.cpp +++ b/plugins/Scriver/src/tabs.cpp @@ -795,6 +795,7 @@ static INT_PTR CALLBACK DlgProcParentWindow(HWND hwndDlg, UINT msg, WPARAM wPara MoveWindow(dat->m_hwndActive, dat->childRect.left, dat->childRect.top, dat->childRect.right - dat->childRect.left, dat->childRect.bottom - dat->childRect.top, TRUE); else { RECT rcStatus, rcChild, rcWindow, rc; + SIZE size; dat->bMinimized = 0; GetClientRect(hwndDlg, &rc); GetWindowRect(hwndDlg, &rcWindow); @@ -805,20 +806,18 @@ static INT_PTR CALLBACK DlgProcParentWindow(HWND hwndDlg, UINT msg, WPARAM wPara } MoveWindow(dat->m_hwndTabs, 0, 2, (rc.right - rc.left), (rc.bottom - rc.top) - (rcStatus.bottom - rcStatus.top) - 2, FALSE); RedrawWindow(dat->m_hwndTabs, nullptr, nullptr, RDW_INVALIDATE | RDW_FRAME | RDW_ERASE); - - SIZE size; GetMinimunWindowSize(dat, &size); if ((rcWindow.bottom - rcWindow.top) < size.cy || (rcWindow.right - rcWindow.left) < size.cx) { - SetTimer(hwndDlg, TIMERID_RESIZE, 50, nullptr); - break; + if ((rcWindow.bottom - rcWindow.top) < size.cy) + rcWindow.bottom = rcWindow.top + size.cy; + if ((rcWindow.right - rcWindow.left) < size.cx) + rcWindow.right = rcWindow.left + size.cx; + MoveWindow(hwndDlg, rcWindow.left, rcWindow.top, rcWindow.right - rcWindow.left, rcWindow.bottom - rcWindow.top, TRUE); } - dat->GetChildWindowRect(&rcChild); dat->childRect = rcChild; - if (dat->m_hwndActive) { - MoveWindow(dat->m_hwndActive, rcChild.left, rcChild.top, rcChild.right - rcChild.left, rcChild.bottom - rcChild.top, TRUE); - RedrawWindow(GetDlgItem(dat->m_hwndActive, IDC_SRMM_LOG), nullptr, nullptr, RDW_INVALIDATE); - } + MoveWindow(dat->m_hwndActive, rcChild.left, rcChild.top, rcChild.right - rcChild.left, rcChild.bottom - rcChild.top, TRUE); + RedrawWindow(GetDlgItem(dat->m_hwndActive, IDC_SRMM_LOG), nullptr, nullptr, RDW_INVALIDATE); if (dat->flags2.bShowStatusBar) { SendMessage(dat->m_hwndStatus, WM_SIZE, 0, 0); RedrawWindow(dat->m_hwndStatus, nullptr, nullptr, RDW_INVALIDATE | RDW_UPDATENOW | RDW_ERASE); @@ -951,22 +950,6 @@ static INT_PTR CALLBACK DlgProcParentWindow(HWND hwndDlg, UINT msg, WPARAM wPara FlashWindow(hwndDlg, FALSE); } } - if (wParam == TIMERID_RESIZE) { - KillTimer(hwndDlg, TIMERID_RESIZE); - - RECT rcWindow; - GetWindowRect(hwndDlg, &rcWindow); - - SIZE size; - GetMinimunWindowSize(dat, &size); - if ((rcWindow.bottom - rcWindow.top) < size.cy || (rcWindow.right - rcWindow.left) < size.cx) { - if ((rcWindow.bottom - rcWindow.top) < size.cy) - rcWindow.bottom = rcWindow.top + size.cy; - if ((rcWindow.right - rcWindow.left) < size.cx) - rcWindow.right = rcWindow.left + size.cx; - MoveWindow(hwndDlg, rcWindow.left, rcWindow.top, rcWindow.right - rcWindow.left, rcWindow.bottom - rcWindow.top, TRUE); - } - } break; case WM_CONTEXTMENU: -- cgit v1.2.3