summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-03-19 20:49:46 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-03-19 20:49:46 +0000
commitb9c6f2f3a368274a21cee17d4e3ffe2f9980ec7d (patch)
tree927fdba2cbe494844d9427533800cf418e7d9fb3 /plugins
parent065cfd5dee2d8fbbfe2b8780d17871c090dd952b (diff)
- minor optimizations;
- code cleaning; git-svn-id: http://svn.miranda-ng.org/main/trunk@4116 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rw-r--r--plugins/TabSRMM/src/buttonsbar.cpp36
-rw-r--r--plugins/TabSRMM/src/chat/colorchooser.cpp2
-rw-r--r--plugins/TabSRMM/src/chat/log.cpp2
-rw-r--r--plugins/TabSRMM/src/chat/manager.cpp2
-rw-r--r--plugins/TabSRMM/src/chat/message.cpp2
-rw-r--r--plugins/TabSRMM/src/chat/options.cpp36
-rw-r--r--plugins/TabSRMM/src/chat/services.cpp2
-rw-r--r--plugins/TabSRMM/src/chat/tools.cpp2
-rw-r--r--plugins/TabSRMM/src/chat/window.cpp143
-rw-r--r--plugins/TabSRMM/src/contactcache.cpp2
-rw-r--r--plugins/TabSRMM/src/container.cpp1367
-rw-r--r--plugins/TabSRMM/src/containeroptions.cpp2
-rw-r--r--plugins/TabSRMM/src/controls.cpp2
-rw-r--r--plugins/TabSRMM/src/eventpopups.cpp6
-rw-r--r--plugins/TabSRMM/src/generic_msghandlers.cpp166
-rw-r--r--plugins/TabSRMM/src/globals.cpp4
-rw-r--r--plugins/TabSRMM/src/hotkeyhandler.cpp20
-rw-r--r--plugins/TabSRMM/src/infopanel.cpp6
-rw-r--r--plugins/TabSRMM/src/msgdialog.cpp1183
-rw-r--r--plugins/TabSRMM/src/msgdlgutils.cpp24
-rw-r--r--plugins/TabSRMM/src/msglog.cpp8
-rw-r--r--plugins/TabSRMM/src/msgoptions.cpp40
-rw-r--r--plugins/TabSRMM/src/msgoptions_plus.cpp8
-rw-r--r--plugins/TabSRMM/src/msgs.cpp8
-rw-r--r--plugins/TabSRMM/src/selectcontainer.cpp12
-rw-r--r--plugins/TabSRMM/src/sendqueue.cpp8
-rw-r--r--plugins/TabSRMM/src/tabctrl.cpp6
-rw-r--r--plugins/TabSRMM/src/templates.cpp30
-rw-r--r--plugins/TabSRMM/src/themes.cpp6
-rw-r--r--plugins/TabSRMM/src/userprefs.cpp14
30 files changed, 1503 insertions, 1646 deletions
diff --git a/plugins/TabSRMM/src/buttonsbar.cpp b/plugins/TabSRMM/src/buttonsbar.cpp
index 2d05a0a9e1..02188f93c9 100644
--- a/plugins/TabSRMM/src/buttonsbar.cpp
+++ b/plugins/TabSRMM/src/buttonsbar.cpp
@@ -352,7 +352,7 @@ static INT_PTR CB_GetButtonState(WPARAM wParam, LPARAM lParam)
if (!realbutton) return 1;
hwndDlg = M->FindWindow((HANDLE)wParam);
- bbdi->bbbFlags = (IsDlgButtonChecked(hwndDlg, tempCID) ? BBSF_PUSHED : BBSF_RELEASED) | (IsWindowVisible(GetDlgItem(hwndDlg, tempCID)) ? 0 : BBSF_HIDDEN) | (IsWindowEnabled(GetDlgItem(hwndDlg, tempCID)) ? 0 : BBSF_DISABLED);
+ bbdi->bbbFlags = (IsDlgButtonChecked(hwndDlg, tempCID) ? BBSF_PUSHED : BBSF_RELEASED) | (IsWindowVisible( GetDlgItem(hwndDlg, tempCID)) ? 0 : BBSF_HIDDEN) | (IsWindowEnabled( GetDlgItem(hwndDlg, tempCID)) ? 0 : BBSF_DISABLED);
return 0;
}
@@ -384,12 +384,12 @@ static INT_PTR CB_SetButtonState(WPARAM wParam, LPARAM lParam)
hwndDlg = M->FindWindow((HANDLE)wParam);
if (hwndDlg && realbutton && bbdi->hIcon)
- SendMessage(GetDlgItem(hwndDlg, tempCID), BM_SETIMAGE, IMAGE_ICON, (LPARAM)Skin_GetIconByHandle(bbdi->hIcon));
+ SendMessage( GetDlgItem(hwndDlg, tempCID), BM_SETIMAGE, IMAGE_ICON, (LPARAM)Skin_GetIconByHandle(bbdi->hIcon));
if (hwndDlg && realbutton && bbdi->pszTooltip) {
if (bbdi->bbbFlags&BBBF_ANSITOOLTIP)
- SendMessage(GetDlgItem(hwndDlg, tempCID), BUTTONADDTOOLTIP, (WPARAM)mir_a2u(bbdi->pszTooltip), 0);
+ SendMessage( GetDlgItem(hwndDlg, tempCID), BUTTONADDTOOLTIP, (WPARAM)mir_a2u(bbdi->pszTooltip), 0);
else
- SendMessage(GetDlgItem(hwndDlg, tempCID), BUTTONADDTOOLTIP, (WPARAM)bbdi->ptszTooltip, 0);
+ SendMessage( GetDlgItem(hwndDlg, tempCID), BUTTONADDTOOLTIP, (WPARAM)bbdi->ptszTooltip, 0);
}
if (hwndDlg && realbutton && bbdi->bbbFlags) {
Utils::showDlgControl(hwndDlg, tempCID, (bbdi->bbbFlags&BBSF_HIDDEN) ? SW_HIDE : SW_SHOW);
@@ -544,7 +544,7 @@ void TSAPI BB_InitDlgButtons(TWindowData *dat)
isThemed = FALSE;
}
- GetWindowRect(GetDlgItem(hdlg, (dat->bType == SESSIONTYPE_IM) ? IDC_SPLITTER : IDC_SPLITTERY), &rcSplitter);
+ GetWindowRect( GetDlgItem(hdlg, (dat->bType == SESSIONTYPE_IM) ? IDC_SPLITTER : IDC_SPLITTERY), &rcSplitter);
ptSplitter.x = 0;
ptSplitter.y = rcSplitter.top;
ScreenToClient(hdlg, &ptSplitter);
@@ -579,8 +579,8 @@ void TSAPI BB_InitDlgButtons(TWindowData *dat)
if (hwndBtn && cbd->bPushButton)
SendMessage(hwndBtn, BUTTONSETASPUSHBTN, TRUE, 0);
}
- } else if (GetDlgItem(hdlg, cbd->dwButtonCID))
- DestroyWindow(GetDlgItem(hdlg, cbd->dwButtonCID));
+ } else if ( GetDlgItem(hdlg, cbd->dwButtonCID))
+ DestroyWindow( GetDlgItem(hdlg, cbd->dwButtonCID));
if (cbd->bDisabled)
EnableWindow(hwndBtn, 0);
@@ -617,8 +617,8 @@ void TSAPI BB_InitDlgButtons(TWindowData *dat)
if (hwndBtn && cbd->bPushButton)
SendMessage(hwndBtn, BUTTONSETASPUSHBTN, TRUE, 0);
}
- } else if (GetDlgItem(hdlg, cbd->dwButtonCID))
- DestroyWindow(GetDlgItem(hdlg, cbd->dwButtonCID));
+ } else if ( GetDlgItem(hdlg, cbd->dwButtonCID))
+ DestroyWindow( GetDlgItem(hdlg, cbd->dwButtonCID));
if (cbd->bDisabled)
EnableWindow(hwndBtn, 0);
@@ -668,7 +668,7 @@ BOOL TSAPI BB_SetButtonsPos(TWindowData *dat)
int splitterY, iOff;
BYTE gap = DPISCALEX_S(PluginConfig.g_iButtonsBarGap);
int foravatar = 0;
- BOOL showToolbar = dat->pContainer->dwFlags & CNT_HIDETOOLBAR ? 0 : 1;
+ BOOL bShowToolbar = dat->pContainer->dwFlags & CNT_HIDETOOLBAR ? 0 : 1;
BOOL bBottomToolbar = dat->pContainer->dwFlags & CNT_BOTTOMTOOLBAR ? 1 : 0;
int tempL = dat->bbLSideWidth;
int tempR = dat->bbRSideWidth;
@@ -679,11 +679,11 @@ BOOL TSAPI BB_SetButtonsPos(TWindowData *dat)
if (!dat || !IsWindowVisible(hwnd))
return 0;
- ShowWindow(hwndToggleSideBar, (showToolbar && dat->pContainer->SideBar->isActive()) ? SW_SHOW : SW_HIDE);
+ ShowWindow(hwndToggleSideBar, (bShowToolbar && dat->pContainer->SideBar->isActive()) ? SW_SHOW : SW_HIDE);
EnterCriticalSection(&ToolBarCS);
- GetWindowRect(GetDlgItem(hwnd, (dat->bType == SESSIONTYPE_IM) ? IDC_SPLITTER : IDC_SPLITTERY), &rcSplitter);
+ GetWindowRect( GetDlgItem(hwnd, (dat->bType == SESSIONTYPE_IM) ? IDC_SPLITTER : IDC_SPLITTERY), &rcSplitter);
ptSplitter.x = 0;
ptSplitter.y = rcSplitter.top;
ScreenToClient(hwnd, &ptSplitter);
@@ -717,7 +717,7 @@ BOOL TSAPI BB_SetButtonsPos(TWindowData *dat)
hwndBtn = GetDlgItem(hwnd, cbd->dwButtonCID);
- if (!showToolbar) {
+ if (!bShowToolbar) {
ShowWindow(hwndBtn, SW_HIDE);
DeferWindowPos(hdwp, hwndBtn , NULL, lwidth, splitterY - iOff,
0, 0, SWP_NOZORDER | SWP_NOSIZE);// | SWP_NOCOPYBITS);
@@ -770,7 +770,7 @@ BOOL TSAPI BB_SetButtonsPos(TWindowData *dat)
hwndBtn = GetDlgItem(hwnd, cbd->dwButtonCID);
- if (!showToolbar) {
+ if (!bShowToolbar) {
ShowWindow(hwndBtn, SW_HIDE);
if (IsWindowVisible(hwndBtn) || (cbd->bDummy && !(cbd->bAutoHidden || cbd->bHidden)))
rwidth += cbd->iButtonWidth + gap;
@@ -918,11 +918,11 @@ void BB_RefreshTheme(const TWindowData *dat)
for (i=0; i < RButtonsList->realCount; i++) {
CustomButtonData* cbd = (CustomButtonData *)RButtonsList->items[i];
- SendMessage(GetDlgItem(dat->hwnd, cbd->dwButtonCID), WM_THEMECHANGED, 0, 0);
+ SendMessage( GetDlgItem(dat->hwnd, cbd->dwButtonCID), WM_THEMECHANGED, 0, 0);
}
for (i=0; i < LButtonsList->realCount; i++) {
CustomButtonData* cbd = (CustomButtonData *)LButtonsList->items[i];
- SendMessage(GetDlgItem(dat->hwnd, cbd->dwButtonCID), WM_THEMECHANGED, 0, 0);
+ SendMessage( GetDlgItem(dat->hwnd, cbd->dwButtonCID), WM_THEMECHANGED, 0, 0);
}
}
@@ -1604,9 +1604,9 @@ INT_PTR CALLBACK DlgProcToolBar(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l
break;
case WM_DESTROY: {
- HIMAGELIST hIml = TreeView_GetImageList(GetDlgItem(hwndDlg, IDC_TOOLBARTREE), TVSIL_NORMAL);
+ HIMAGELIST hIml = TreeView_GetImageList( GetDlgItem(hwndDlg, IDC_TOOLBARTREE), TVSIL_NORMAL);
ImageList_Destroy(hIml);
- hIml = TreeView_GetImageList(GetDlgItem(hwndDlg, IDC_TOOLBARTREE), TVSIL_STATE);
+ hIml = TreeView_GetImageList( GetDlgItem(hwndDlg, IDC_TOOLBARTREE), TVSIL_STATE);
ImageList_Destroy(hIml);
break;
}
diff --git a/plugins/TabSRMM/src/chat/colorchooser.cpp b/plugins/TabSRMM/src/chat/colorchooser.cpp
index 53a0ae67cc..dbb89bb53b 100644
--- a/plugins/TabSRMM/src/chat/colorchooser.cpp
+++ b/plugins/TabSRMM/src/chat/colorchooser.cpp
@@ -104,7 +104,7 @@ INT_PTR CALLBACK DlgProcColorToolWindow(HWND hwndDlg, UINT msg, WPARAM wParam, L
pCC->yPosition -= height;
SetDlgItemText(hwndDlg, IDC_COLORTEXT, pCC->bForeground ? TranslateT("Text color") : TranslateT("Background color"));
- SetWindowPos(GetDlgItem(hwndDlg, IDC_COLORTEXT), NULL, 0, 0, width, 20, 0);
+ SetWindowPos( GetDlgItem(hwndDlg, IDC_COLORTEXT), NULL, 0, 0, width, 20, 0);
SetWindowPos(hwndDlg, NULL, pCC->xPosition, pCC->yPosition, width, height, SWP_SHOWWINDOW);
}
break;
diff --git a/plugins/TabSRMM/src/chat/log.cpp b/plugins/TabSRMM/src/chat/log.cpp
index cf58bec369..7bf366641b 100644
--- a/plugins/TabSRMM/src/chat/log.cpp
+++ b/plugins/TabSRMM/src/chat/log.cpp
@@ -986,7 +986,7 @@ void Log_StreamInEvent(HWND hwndDlg, LOGINFO* lin, SESSION_INFO* si, BOOL bRedr
stream.dwCookie = (DWORD_PTR) & streamData;
scroll.cbSize = sizeof(SCROLLINFO);
scroll.fMask = SIF_RANGE | SIF_POS | SIF_PAGE;
- GetScrollInfo(GetDlgItem(hwndDlg, IDC_CHAT_LOG), SB_VERT, &scroll);
+ GetScrollInfo( GetDlgItem(hwndDlg, IDC_CHAT_LOG), SB_VERT, &scroll);
SendMessage(hwndRich, EM_GETSCROLLPOS, 0, (LPARAM) &point);
// do not scroll to bottom if there is a selection
diff --git a/plugins/TabSRMM/src/chat/manager.cpp b/plugins/TabSRMM/src/chat/manager.cpp
index 090f4ce119..70efbbc8ab 100644
--- a/plugins/TabSRMM/src/chat/manager.cpp
+++ b/plugins/TabSRMM/src/chat/manager.cpp
@@ -213,7 +213,7 @@ BOOL SM_SetStatusEx(const TCHAR* pszID, const char* pszModule, const TCHAR* pszT
if ((!pszID || !lstrcmpi(pTemp->ptszID, pszID)) && !lstrcmpiA(pTemp->pszModule, pszModule)) {
UM_SetStatusEx(pTemp->pUsers, pszText, flags);
if (pTemp->hWnd)
- RedrawWindow(GetDlgItem(pTemp->hWnd, IDC_LIST), NULL, NULL, RDW_INVALIDATE);
+ RedrawWindow( GetDlgItem(pTemp->hWnd, IDC_LIST), NULL, NULL, RDW_INVALIDATE);
if (pszID)
return TRUE;
}
diff --git a/plugins/TabSRMM/src/chat/message.cpp b/plugins/TabSRMM/src/chat/message.cpp
index 0b6e0b00a4..21e2d6b8af 100644
--- a/plugins/TabSRMM/src/chat/message.cpp
+++ b/plugins/TabSRMM/src/chat/message.cpp
@@ -328,6 +328,6 @@ char* Chat_Message_GetFromStream(HWND hwndDlg, SESSION_INFO* si)
stream.dwCookie = (DWORD_PTR) & pszText; // pass pointer to pointer
dwFlags = SF_RTFNOOBJS | SFF_PLAINRTF | SF_USECODEPAGE | (CP_UTF8 << 16);
- SendMessage(GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE), EM_STREAMOUT, dwFlags, (LPARAM) & stream);
+ SendMessage( GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE), EM_STREAMOUT, dwFlags, (LPARAM) & stream);
return pszText; // pszText contains the text
}
diff --git a/plugins/TabSRMM/src/chat/options.cpp b/plugins/TabSRMM/src/chat/options.cpp
index d74e321c5d..18314b5f6d 100644
--- a/plugins/TabSRMM/src/chat/options.cpp
+++ b/plugins/TabSRMM/src/chat/options.cpp
@@ -501,21 +501,21 @@ INT_PTR CALLBACK DlgProcOptions1(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
if (PluginConfig.m_chat_enabled) {
- SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_CHECKBOXES), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_CHECKBOXES), GWL_STYLE) | TVS_NOHSCROLL | TVS_CHECKBOXES);
+ SetWindowLongPtr( GetDlgItem(hwndDlg, IDC_CHECKBOXES), GWL_STYLE, GetWindowLongPtr( GetDlgItem(hwndDlg, IDC_CHECKBOXES), GWL_STYLE) | TVS_NOHSCROLL | TVS_CHECKBOXES);
HIMAGELIST himlOptions = (HIMAGELIST)SendDlgItemMessage(hwndDlg, IDC_CHECKBOXES, TVM_SETIMAGELIST, TVSIL_STATE, (LPARAM)CreateStateImageList());
ImageList_Destroy(himlOptions);
- hListHeading1 = InsertBranch(GetDlgItem(hwndDlg, IDC_CHECKBOXES), TranslateT("Appearance and functionality of chat room windows"), TRUE);
- hListHeading2 = InsertBranch(GetDlgItem(hwndDlg, IDC_CHECKBOXES), TranslateT("Appearance of the message log"), TRUE);
+ hListHeading1 = InsertBranch( GetDlgItem(hwndDlg, IDC_CHECKBOXES), TranslateT("Appearance and functionality of chat room windows"), TRUE);
+ hListHeading2 = InsertBranch( GetDlgItem(hwndDlg, IDC_CHECKBOXES), TranslateT("Appearance of the message log"), TRUE);
- FillBranch(GetDlgItem(hwndDlg, IDC_CHECKBOXES), hListHeading1, branch1, SIZEOF(branch1), 0x0000);
- FillBranch(GetDlgItem(hwndDlg, IDC_CHECKBOXES), hListHeading2, branch2, SIZEOF(branch2), 0x0000);
+ FillBranch( GetDlgItem(hwndDlg, IDC_CHECKBOXES), hListHeading1, branch1, SIZEOF(branch1), 0x0000);
+ FillBranch( GetDlgItem(hwndDlg, IDC_CHECKBOXES), hListHeading2, branch2, SIZEOF(branch2), 0x0000);
{
TCHAR* pszGroup = NULL;
InitSetting(&pszGroup, "AddToGroup", _T("Chat rooms"));
- SetWindowText(GetDlgItem(hwndDlg, IDC_GROUP), pszGroup);
+ SetWindowText( GetDlgItem(hwndDlg, IDC_GROUP), pszGroup);
mir_free(pszGroup);
Utils::showDlgControl(hwndDlg, IDC_STATIC_MESSAGE, SW_HIDE);
}
@@ -583,7 +583,7 @@ INT_PTR CALLBACK DlgProcOptions1(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
TCHAR *pszText = NULL;
BYTE b;
- iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_GROUP));
+ iLen = GetWindowTextLength( GetDlgItem(hwndDlg, IDC_GROUP));
if (iLen > 0) {
pszText = (TCHAR *)realloc(pszText, (iLen + 2) * sizeof(TCHAR));
GetDlgItemText(hwndDlg, IDC_GROUP, pszText, iLen + 1);
@@ -597,8 +597,8 @@ INT_PTR CALLBACK DlgProcOptions1(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
free(pszText);
b = M->GetByte("Chat", "Tabs", 1);
- SaveBranch(GetDlgItem(hwndDlg, IDC_CHECKBOXES), branch1, sizeof(branch1) / sizeof(branch1[0]));
- SaveBranch(GetDlgItem(hwndDlg, IDC_CHECKBOXES), branch2, sizeof(branch2) / sizeof(branch2[0]));
+ SaveBranch( GetDlgItem(hwndDlg, IDC_CHECKBOXES), branch1, sizeof(branch1) / sizeof(branch1[0]));
+ SaveBranch( GetDlgItem(hwndDlg, IDC_CHECKBOXES), branch2, sizeof(branch2) / sizeof(branch2[0]));
LoadGlobalSettings();
MM_FontsChanged();
@@ -613,9 +613,9 @@ INT_PTR CALLBACK DlgProcOptions1(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
break;
case WM_DESTROY:
- BYTE b = TreeView_GetItemState(GetDlgItem(hwndDlg, IDC_CHECKBOXES), hListHeading1, TVIS_EXPANDED) & TVIS_EXPANDED ? 1 : 0;
+ BYTE b = TreeView_GetItemState( GetDlgItem(hwndDlg, IDC_CHECKBOXES), hListHeading1, TVIS_EXPANDED) & TVIS_EXPANDED ? 1 : 0;
M->WriteByte("Chat", "Branch1Exp", b);
- b = TreeView_GetItemState(GetDlgItem(hwndDlg, IDC_CHECKBOXES), hListHeading2, TVIS_EXPANDED) & TVIS_EXPANDED ? 1 : 0;
+ b = TreeView_GetItemState( GetDlgItem(hwndDlg, IDC_CHECKBOXES), hListHeading2, TVIS_EXPANDED) & TVIS_EXPANDED ? 1 : 0;
M->WriteByte("Chat", "Branch2Exp", b);
}
return FALSE;
@@ -913,7 +913,7 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
_T("%yyyy%"), TranslateT("year with century, 1901-9999"),
_T("%wday%"), TranslateT("abbreviated weekday name"),
_T("%weekday%"), TranslateT("full weekday name"));
- hPathTip = CreateToolTip(GetDlgItem(hwndDlg, IDC_LOGDIRECTORY), tszTooltipText, TranslateT("Variables"));
+ hPathTip = CreateToolTip( GetDlgItem(hwndDlg, IDC_LOGDIRECTORY), tszTooltipText, TranslateT("Variables"));
}
}
else {
@@ -1005,7 +1005,7 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
SHGetPathFromIDList(idList, tszDirectory);
lstrcat(tszDirectory, _T("\\"));
M->pathToRelative(tszDirectory, tszTemp, const_cast<TCHAR *>(szUserDir));
- SetWindowText(GetDlgItem(hwndDlg, IDC_LOGDIRECTORY), lstrlen(tszTemp) > 1 ? tszTemp : DEFLOGFILENAME);
+ SetWindowText( GetDlgItem(hwndDlg, IDC_LOGDIRECTORY), lstrlen(tszTemp) > 1 ? tszTemp : DEFLOGFILENAME);
}
psMalloc->Free(idList);
psMalloc->Release();
@@ -1035,7 +1035,7 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
if (PluginConfig.m_chat_enabled) {
- iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_LOGDIRECTORY));
+ iLen = GetWindowTextLength( GetDlgItem(hwndDlg, IDC_LOGDIRECTORY));
if (iLen > 0) {
TCHAR *pszText1 = (TCHAR *)malloc(iLen*sizeof(TCHAR) + 2);
GetDlgItemText(hwndDlg, IDC_LOGDIRECTORY, pszText1, iLen + 1);
@@ -1058,28 +1058,28 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
else
DBDeleteContactSetting(NULL, "Chat", "NicklistRowDist");
- iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_LOGTIMESTAMP));
+ iLen = GetWindowTextLength( GetDlgItem(hwndDlg, IDC_LOGTIMESTAMP));
if (iLen > 0) {
pszText = (char *)realloc(pszText, iLen + 1);
GetDlgItemTextA(hwndDlg, IDC_LOGTIMESTAMP, pszText, iLen + 1);
DBWriteContactSettingString(NULL, "Chat", "LogTimestamp", pszText);
} else DBDeleteContactSetting(NULL, "Chat", "LogTimestamp");
- iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_TIMESTAMP));
+ iLen = GetWindowTextLength( GetDlgItem(hwndDlg, IDC_TIMESTAMP));
if (iLen > 0) {
pszText = (char *)realloc(pszText, iLen + 1);
GetDlgItemTextA(hwndDlg, IDC_TIMESTAMP, pszText, iLen + 1);
DBWriteContactSettingString(NULL, "Chat", "HeaderTime", pszText);
} else DBDeleteContactSetting(NULL, "Chat", "HeaderTime");
- iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_INSTAMP));
+ iLen = GetWindowTextLength( GetDlgItem(hwndDlg, IDC_INSTAMP));
if (iLen > 0) {
pszText = (char *)realloc(pszText, iLen + 1);
GetDlgItemTextA(hwndDlg, IDC_INSTAMP, pszText, iLen + 1);
DBWriteContactSettingString(NULL, "Chat", "HeaderIncoming", pszText);
} else DBDeleteContactSetting(NULL, "Chat", "HeaderIncoming");
- iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_OUTSTAMP));
+ iLen = GetWindowTextLength( GetDlgItem(hwndDlg, IDC_OUTSTAMP));
if (iLen > 0) {
pszText = (char *)realloc(pszText, iLen + 1);
GetDlgItemTextA(hwndDlg, IDC_OUTSTAMP, pszText, iLen + 1);
diff --git a/plugins/TabSRMM/src/chat/services.cpp b/plugins/TabSRMM/src/chat/services.cpp
index ed4907467a..016e3de851 100644
--- a/plugins/TabSRMM/src/chat/services.cpp
+++ b/plugins/TabSRMM/src/chat/services.cpp
@@ -267,7 +267,7 @@ INT_PTR Service_NewChat(WPARAM wParam, LPARAM lParam)
if (si2->hContact)
Chat_SetFilters(si2);
if (si2->hWnd)
- RedrawWindow(GetDlgItem(si2->hWnd, IDC_LIST), NULL, NULL, RDW_INVALIDATE);
+ RedrawWindow( GetDlgItem(si2->hWnd, IDC_LIST), NULL, NULL, RDW_INVALIDATE);
}
}
diff --git a/plugins/TabSRMM/src/chat/tools.cpp b/plugins/TabSRMM/src/chat/tools.cpp
index 254459ccd7..ace9606822 100644
--- a/plugins/TabSRMM/src/chat/tools.cpp
+++ b/plugins/TabSRMM/src/chat/tools.cpp
@@ -935,7 +935,7 @@ UINT CreateGCMenu(HWND hwndDlg, HMENU *hMenu, int iIndex, POINT pt, SESSION_INFO
gcmi.pszUID = pszUID;
if (iIndex == 1) {
- int i = GetRichTextLength(GetDlgItem(hwndDlg, IDC_CHAT_LOG));
+ int i = GetRichTextLength( GetDlgItem(hwndDlg, IDC_CHAT_LOG));
EnableMenuItem(*hMenu, ID_CLEARLOG, MF_ENABLED);
EnableMenuItem(*hMenu, ID_COPYALL, MF_ENABLED);
diff --git a/plugins/TabSRMM/src/chat/window.cpp b/plugins/TabSRMM/src/chat/window.cpp
index 51b11840fa..21b88080ba 100644
--- a/plugins/TabSRMM/src/chat/window.cpp
+++ b/plugins/TabSRMM/src/chat/window.cpp
@@ -315,7 +315,7 @@ static void Chat_UpdateWindowState(TWindowData *dat, UINT msg)
else
SendMessage(hwndDlg, DM_SETLOCALE, 0, 0);
}
- SetFocus(GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE));
+ SetFocus( GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE));
dat->dwLastActivity = GetTickCount();
dat->pContainer->dwLastActivity = dat->dwLastActivity;
dat->pContainer->MenuBar->configureMenu();
@@ -378,7 +378,7 @@ static void Chat_ResizeIeView(const TWindowData *dat)
HWND hwndDlg = dat->hwnd;
ZeroMemory(&ieWindow, sizeof(ieWindow));
- GetWindowRect(GetDlgItem(hwndDlg, IDC_CHAT_LOG), &rcRichEdit);
+ GetWindowRect( GetDlgItem(hwndDlg, IDC_CHAT_LOG), &rcRichEdit);
pt.x = rcRichEdit.left;
pt.y = rcRichEdit.top;
ScreenToClient(hwndDlg, &pt);
@@ -444,7 +444,7 @@ static int RoomWndResize(HWND hwndDlg, LPARAM lParam, UTILRESIZECONTROL *urc)
Utils::enableDlgControl(hwndDlg, IDC_FILTER, FALSE);
Utils::enableDlgControl(hwndDlg, IDC_CHANMGR, FALSE);
}
- //ShowWindow(GetDlgItem(hwndDlg, IDC_CHAT_TOGGLESIDEBAR), dat->pContainer->dwFlags & CNT_SIDEBAR ? SW_SHOW : SW_HIDE);
+ //ShowWindow( GetDlgItem(hwndDlg, IDC_CHAT_TOGGLESIDEBAR), dat->pContainer->dwFlags & CNT_SIDEBAR ? SW_SHOW : SW_HIDE);
switch (urc->wId) {
case IDC_PANELSPLITTER:
@@ -543,6 +543,7 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam,
SESSION_INFO* Parentsi;
struct TWindowData *mwdat;
HWND hwndParent = GetParent(hwnd);
+ int iSelection;
mwdat = (struct TWindowData *)GetWindowLongPtr(hwndParent, GWLP_USERDATA);
Parentsi = (SESSION_INFO *)mwdat->si;
@@ -575,7 +576,6 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam,
MODULEINFO* mi = MM_FindModule(Parentsi->pszModule);
HMENU hMenu, hSubMenu;
CHARRANGE sel, all = { 0, -1};
- int iSelection;
int iPrivateBG = M->GetByte(mwdat->hContact, "private_bg", 0);
MessageWindowPopupData mwpd;
POINT pt;
@@ -801,7 +801,7 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam,
} else if (wParam == VK_DOWN)
wp = MAKEWPARAM(SB_LINEDOWN, 0);
- SendMessage(GetDlgItem(hwndParent, IDC_CHAT_LOG), WM_VSCROLL, wp, 0);
+ SendMessage( GetDlgItem(hwndParent, IDC_CHAT_LOG), WM_VSCROLL, wp, 0);
return 0;
}
}
@@ -945,9 +945,9 @@ static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam,
RedrawWindow(hwnd, NULL, NULL, RDW_INVALIDATE);
if (!fCompleted && !PluginConfig.m_AllowTab) {
if ((GetSendButtonState(mwdat->hwnd) != PBS_DISABLED))
- SetFocus(GetDlgItem(mwdat->hwnd, IDOK));
+ SetFocus( GetDlgItem(mwdat->hwnd, IDOK));
else
- SetFocus(GetDlgItem(mwdat->hwnd, IDC_CHAT_LOG));
+ SetFocus( GetDlgItem(mwdat->hwnd, IDC_CHAT_LOG));
}
return 0;
} else if (wParam != VK_RIGHT && wParam != VK_LEFT) {
@@ -1346,7 +1346,7 @@ static LRESULT CALLBACK LogSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR
SendMessage(hwnd, WM_COPY, 0, 0);
sel.cpMin = sel.cpMax ;
SendMessage(hwnd, EM_EXSETSEL, 0, (LPARAM) & sel);
- SetFocus(GetDlgItem(hwndParent, IDC_CHAT_MESSAGE));
+ SetFocus( GetDlgItem(hwndParent, IDC_CHAT_MESSAGE));
}
}
}
@@ -1395,8 +1395,8 @@ static LRESULT CALLBACK LogSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR
break;
case WM_CHAR:
- SetFocus(GetDlgItem(hwndParent, IDC_CHAT_MESSAGE));
- SendMessage(GetDlgItem(hwndParent, IDC_CHAT_MESSAGE), WM_CHAR, wParam, lParam);
+ SetFocus( GetDlgItem(hwndParent, IDC_CHAT_MESSAGE));
+ SendMessage( GetDlgItem(hwndParent, IDC_CHAT_MESSAGE), WM_CHAR, wParam, lParam);
break;
}
@@ -1706,7 +1706,7 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam,
item &= 0xFFFF;
ui = SM_GetUserFromIndex(parentdat->ptszID, parentdat->pszModule, item);
- // ui = (USERINFO *)SendMessage(GetDlgItem(hwndParent, IDC_LIST), LB_GETITEMDATA, item, 0);
+ // ui = (USERINFO *)SendMessage( GetDlgItem(hwndParent, IDC_LIST), LB_GETITEMDATA, item, 0);
if (ui) {
HMENU hMenu = 0;
UINT uID;
@@ -1837,7 +1837,7 @@ static LRESULT CALLBACK NicklistSubclassProc(HWND hwnd, UINT msg, WPARAM wParam,
GetCursorPos(&pt);
ScreenToClient(hwnd, &pt);
- DWORD nItemUnderMouse = (DWORD)SendMessage(GetDlgItem(dat->hwnd, IDC_LIST), LB_ITEMFROMPOINT, 0, MAKELPARAM(pt.x, pt.y));
+ DWORD nItemUnderMouse = (DWORD)SendMessage( GetDlgItem(dat->hwnd, IDC_LIST), LB_ITEMFROMPOINT, 0, MAKELPARAM(pt.x, pt.y));
if (HIWORD(nItemUnderMouse) == 1)
nItemUnderMouse = (DWORD)(-1);
else
@@ -1978,7 +1978,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
BB_InitDlgButtons(dat);
DM_InitTip(dat);
- SendMessage(GetDlgItem(hwndDlg,IDC_COLOR), BUTTONSETASPUSHBTN, TRUE, 0);
+ SendMessage( GetDlgItem(hwndDlg,IDC_COLOR), BUTTONSETASPUSHBTN, TRUE, 0);
mir_subclassWindow( GetDlgItem(hwndDlg, IDC_SPLITTERX), SplitterSubclassProc);
mir_subclassWindow( GetDlgItem(hwndDlg, IDC_SPLITTERY), SplitterSubclassProc);
@@ -1991,7 +1991,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
SendDlgItemMessage(hwndDlg, IDC_CHAT_MESSAGE, EM_SUBCLASSED, 0, 0);
SendDlgItemMessage(hwndDlg, IDC_CHAT_LOG, EM_AUTOURLDETECT, 1, 0);
- SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_PANELSPLITTER), GWLP_WNDPROC, (LONG_PTR) SplitterSubclassProc);
+ SetWindowLongPtr( GetDlgItem(hwndDlg, IDC_PANELSPLITTER), GWLP_WNDPROC, (LONG_PTR) SplitterSubclassProc);
TABSRMM_FireEvent(dat->hContact, hwndDlg, MSG_WINDOW_EVT_OPENING, 0);
mask = (int)SendDlgItemMessage(hwndDlg, IDC_CHAT_LOG, EM_GETEVENTMASK, 0, 0);
@@ -2013,7 +2013,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
UpdateTrayMenu(0, dat->wStatus, dat->szProto, dat->szStatus, dat->hContact, FALSE);
DM_ThemeChanged(dat);
- SendMessage(GetDlgItem(hwndDlg, IDC_CHAT_LOG), EM_HIDESELECTION, TRUE, 0);
+ SendMessage( GetDlgItem(hwndDlg, IDC_CHAT_LOG), EM_HIDESELECTION, TRUE, 0);
CreateWindowEx(0, _T("TSButtonClass"), _T(""), WS_CHILD | WS_VISIBLE | WS_TABSTOP, 0, 0, 6, DPISCALEY_S(20),
hwndDlg, (HMENU)IDC_CHAT_TOGGLESIDEBAR, g_hInst, NULL);
@@ -2048,7 +2048,7 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
break;
Chat_UpdateWindowState(dat, WM_SETFOCUS);
- SetFocus(GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE));
+ SetFocus( GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE));
return 1;
case WM_TIMECHANGE:
@@ -2070,8 +2070,8 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
DM_InitRichEdit(dat);
SendDlgItemMessage(hwndDlg, IDOK, BUTTONSETASNORMAL, TRUE, 0);
{
- SendMessage(GetDlgItem(hwndDlg, IDC_LIST), LB_SETITEMHEIGHT, 0, (LPARAM)g_Settings.iNickListFontHeight);
- InvalidateRect(GetDlgItem(hwndDlg, IDC_LIST), NULL, TRUE);
+ SendMessage( GetDlgItem(hwndDlg, IDC_LIST), LB_SETITEMHEIGHT, 0, (LPARAM)g_Settings.iNickListFontHeight);
+ InvalidateRect( GetDlgItem(hwndDlg, IDC_LIST), NULL, TRUE);
}
SendDlgItemMessage(hwndDlg, IDC_FILTER, BUTTONSETOVERLAYICON,
(LPARAM)(si->bFilterEnabled ? PluginConfig.g_iconOverlayEnabled : PluginConfig.g_iconOverlayDisabled), 0);
@@ -2461,9 +2461,9 @@ INT_PTR CALLBACK RoomWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPar
}break;
//
case GC_UPDATENICKLIST: {
- int i = SendMessage(GetDlgItem(hwndDlg, IDC_LIST), LB_GETTOPINDEX, 0, 0);
- SendMessage(GetDlgItem(hwndDlg, IDC_LIST), LB_SETCOUNT, si->nUsersInNicklist, 0);
- SendMessage(GetDlgItem(hwndDlg, IDC_LIST), LB_SETTOPINDEX, i, 0);
+ int i = SendMessage( GetDlgItem(hwndDlg, IDC_LIST), LB_GETTOPINDEX, 0, 0);
+ SendMessage( GetDlgItem(hwndDlg, IDC_LIST), LB_SETCOUNT, si->nUsersInNicklist, 0);
+ SendMessage( GetDlgItem(hwndDlg, IDC_LIST), LB_SETTOPINDEX, i, 0);
SendMessage(hwndDlg, GC_UPDATETITLE, 0, 0);
}
break;
@@ -2529,11 +2529,11 @@ LABEL_SHOWWINDOW:
POINT pt;
RECT rc;
RECT rcLog;
- BOOL bFormat = TRUE; //IsWindowVisible(GetDlgItem(hwndDlg,IDC_SMILEY));
+ BOOL bFormat = TRUE; //IsWindowVisible( GetDlgItem(hwndDlg,IDC_SMILEY));
static int x = 0;
- GetWindowRect(GetDlgItem(hwndDlg, IDC_CHAT_LOG), &rcLog);
+ GetWindowRect( GetDlgItem(hwndDlg, IDC_CHAT_LOG), &rcLog);
if ((HWND)lParam == GetDlgItem(hwndDlg, IDC_SPLITTERX)) {
int oldSplitterX;
GetClientRect(hwndDlg, &rc);
@@ -2572,7 +2572,7 @@ LABEL_SHOWWINDOW:
pt.x = 0;
pt.y = wParam;
ScreenToClient(hwndDlg, &pt);
- GetClientRect(GetDlgItem(hwndDlg, IDC_CHAT_LOG), &rc);
+ GetClientRect( GetDlgItem(hwndDlg, IDC_CHAT_LOG), &rc);
if ((pt.y + 2 >= MIN_PANELHEIGHT + 2) && (pt.y + 2 < 100) && (pt.y + 2 < rc.bottom - 30))
dat->Panel->setHeight(pt.y + 2);
dat->panelWidth = -1;
@@ -2613,7 +2613,7 @@ LABEL_SHOWWINDOW:
TranslateDialogDefault(si->hwndFilter);
GetClientRect(si->hwndFilter, &rcFilter);
- GetWindowRect(GetDlgItem(hwndDlg, IDC_CHAT_LOG), &rcLog);
+ GetWindowRect( GetDlgItem(hwndDlg, IDC_CHAT_LOG), &rcLog);
pt.x = rcLog.right;
pt.y = rcLog.bottom;
ScreenToClient(dat->pContainer->hwnd, &pt);
@@ -2633,11 +2633,11 @@ LABEL_SHOWWINDOW:
BOOL bFG = lParam == IDC_COLOR ? TRUE : FALSE;
COLORCHOOSER *pCC = (COLORCHOOSER *)mir_alloc(sizeof(COLORCHOOSER));
- GetWindowRect(GetDlgItem(hwndDlg, bFG ? IDC_COLOR : IDC_BKGCOLOR), &rc);
+ GetWindowRect( GetDlgItem(hwndDlg, bFG ? IDC_COLOR : IDC_BKGCOLOR), &rc);
pCC->hWndTarget = GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE);
pCC->pModule = MM_FindModule(si->pszModule);
pCC->xPosition = rc.left + 3;
- pCC->yPosition = IsWindowVisible(GetDlgItem(hwndDlg, IDC_COLOR)) ? rc.top - 1 : rc.top + 20;
+ pCC->yPosition = IsWindowVisible( GetDlgItem(hwndDlg, IDC_COLOR)) ? rc.top - 1 : rc.top + 20;
pCC->bForeground = bFG;
pCC->si = si;
@@ -2700,7 +2700,7 @@ LABEL_SHOWWINDOW:
}
if (msg == WM_KEYDOWN) {
if ((wp == VK_INSERT && isShift && !isCtrl && !isMenu) || (wp == 'V' && !isShift && !isMenu && isCtrl)) {
- SendMessage(GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE), EM_PASTESPECIAL, CF_TEXTT, 0);
+ SendMessage( GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE), EM_PASTESPECIAL, CF_TEXTT, 0);
((MSGFILTER *) lParam)->msg = WM_NULL;
((MSGFILTER *) lParam)->wParam = 0;
((MSGFILTER *) lParam)->lParam = 0;
@@ -2727,7 +2727,7 @@ LABEL_SHOWWINDOW:
return(_dlgReturn(hwndDlg, 1));
case TABSRMM_HK_FILTERTOGGLE:
SendMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(IDC_FILTER, BN_CLICKED), 0);
- InvalidateRect(GetDlgItem(hwndDlg, IDC_FILTER), NULL, TRUE);
+ InvalidateRect( GetDlgItem(hwndDlg, IDC_FILTER), NULL, TRUE);
return(_dlgReturn(hwndDlg, 1));
case TABSRMM_HK_LISTTOGGLE:
SendMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(IDC_SHOWNICKLIST, BN_CLICKED), 0);
@@ -2743,7 +2743,7 @@ LABEL_SHOWWINDOW:
if (msg == WM_KEYDOWN && wp == VK_TAB) {
if (((NMHDR *)lParam)->idFrom == IDC_CHAT_LOG) {
- SetFocus(GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE));
+ SetFocus( GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE));
return(_dlgReturn(hwndDlg, 1));
}
}
@@ -2767,14 +2767,14 @@ LABEL_SHOWWINDOW:
pszWord[0] = '\0';
ptl.x = (LONG)pt.x;
ptl.y = (LONG)pt.y;
- ScreenToClient(GetDlgItem(hwndDlg, IDC_CHAT_LOG), (LPPOINT)&ptl);
- iCharIndex = SendMessage(GetDlgItem(hwndDlg, IDC_CHAT_LOG), EM_CHARFROMPOS, 0, (LPARAM) & ptl);
+ ScreenToClient( GetDlgItem(hwndDlg, IDC_CHAT_LOG), (LPPOINT)&ptl);
+ iCharIndex = SendMessage( GetDlgItem(hwndDlg, IDC_CHAT_LOG), EM_CHARFROMPOS, 0, (LPARAM) & ptl);
if (iCharIndex < 0)
break;
- iLineIndex = SendMessage(GetDlgItem(hwndDlg, IDC_CHAT_LOG), EM_EXLINEFROMCHAR, 0, (LPARAM)iCharIndex);
- iChars = SendMessage(GetDlgItem(hwndDlg, IDC_CHAT_LOG), EM_LINEINDEX, (WPARAM)iLineIndex, 0);
- start = SendMessage(GetDlgItem(hwndDlg, IDC_CHAT_LOG), EM_FINDWORDBREAK, WB_LEFT, iCharIndex);//-iChars;
- end = SendMessage(GetDlgItem(hwndDlg, IDC_CHAT_LOG), EM_FINDWORDBREAK, WB_RIGHT, iCharIndex);//-iChars;
+ iLineIndex = SendMessage( GetDlgItem(hwndDlg, IDC_CHAT_LOG), EM_EXLINEFROMCHAR, 0, (LPARAM)iCharIndex);
+ iChars = SendMessage( GetDlgItem(hwndDlg, IDC_CHAT_LOG), EM_LINEINDEX, (WPARAM)iLineIndex, 0);
+ start = SendMessage( GetDlgItem(hwndDlg, IDC_CHAT_LOG), EM_FINDWORDBREAK, WB_LEFT, iCharIndex);//-iChars;
+ end = SendMessage( GetDlgItem(hwndDlg, IDC_CHAT_LOG), EM_FINDWORDBREAK, WB_RIGHT, iCharIndex);//-iChars;
if (end - start > 0) {
TEXTRANGE tr;
@@ -2786,7 +2786,7 @@ LABEL_SHOWWINDOW:
cr.cpMax = end;
tr.chrg = cr;
tr.lpstrText = (TCHAR *)pszWord;
- iRes = SendMessage(GetDlgItem(hwndDlg, IDC_CHAT_LOG), EM_GETTEXTRANGE, 0, (LPARAM) & tr);
+ iRes = SendMessage( GetDlgItem(hwndDlg, IDC_CHAT_LOG), EM_GETTEXTRANGE, 0, (LPARAM) & tr);
if (iRes > 0) {
int iLen = lstrlen(pszWord) - 1;
@@ -2929,14 +2929,14 @@ LABEL_SHOWWINDOW:
SetClipboardData(CF_UNICODETEXT, hData);
}
CloseClipboard();
- SetFocus(GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE));
+ SetFocus( GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE));
break;
}
mir_free(tr.lpstrText);
return TRUE;
} else if (((ENLINK *) lParam)->msg == WM_LBUTTONUP) {
CallService(MS_UTILS_OPENURL, OUF_NEWWINDOW|OUF_TCHAR, (LPARAM) tr.lpstrText);
- SetFocus(GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE));
+ SetFocus( GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE));
mir_free(tr.lpstrText);
return TRUE;
}
@@ -3017,7 +3017,7 @@ LABEL_SHOWWINDOW:
free((void*) tszAppeal);
}
}
- SetFocus(GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE));
+ SetFocus( GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE));
mir_free(tr.lpstrText);
return TRUE;
}
@@ -3087,14 +3087,14 @@ LABEL_SHOWWINDOW:
hti.pt.x = (short)LOWORD(GetMessagePos());
hti.pt.y = (short)HIWORD(GetMessagePos());
- ScreenToClient(GetDlgItem(hwndDlg, IDC_LIST), &hti.pt);
+ ScreenToClient( GetDlgItem(hwndDlg, IDC_LIST), &hti.pt);
- item = LOWORD(SendMessage(GetDlgItem(hwndDlg, IDC_LIST), LB_ITEMFROMPOINT, 0, MAKELPARAM(hti.pt.x, hti.pt.y)));
+ item = LOWORD(SendMessage( GetDlgItem(hwndDlg, IDC_LIST), LB_ITEMFROMPOINT, 0, MAKELPARAM(hti.pt.x, hti.pt.y)));
ui = UM_FindUserFromIndex(si->pUsers, item);
//ui = SM_GetUserFromIndex(si->pszID, si->pszModule, item);
if (ui) {
if (g_Settings.DoubleClick4Privat ? GetKeyState(VK_SHIFT) & 0x8000 : !(GetKeyState(VK_SHIFT) & 0x8000)) {
- LRESULT lResult = (LRESULT)SendMessage(GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE), EM_GETSEL, 0, 0);
+ LRESULT lResult = (LRESULT)SendMessage( GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE), EM_GETSEL, 0, 0);
int start = LOWORD(lResult);
TCHAR* pszName = (TCHAR*)alloca(sizeof(TCHAR) * (lstrlen(ui->pszUID) + 3));
if (start == 0)
@@ -3102,15 +3102,15 @@ LABEL_SHOWWINDOW:
else
mir_sntprintf(pszName, lstrlen(ui->pszUID) + 2, _T("%s "), ui->pszUID);
- SendMessage(GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE), EM_REPLACESEL, FALSE, (LPARAM) pszName);
+ SendMessage( GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE), EM_REPLACESEL, FALSE, (LPARAM) pszName);
PostMessage(hwndDlg, WM_MOUSEACTIVATE, 0, 0);
- SetFocus(GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE));
+ SetFocus( GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE));
} else DoEventHookAsync(hwndDlg, si->ptszID, si->pszModule, GC_USER_PRIVMESS, ui->pszUID, NULL, 0);
}
return TRUE;
} else if (HIWORD(wParam) == LBN_KILLFOCUS)
- RedrawWindow(GetDlgItem(hwndDlg, IDC_LIST), NULL, NULL, RDW_INVALIDATE);
+ RedrawWindow( GetDlgItem(hwndDlg, IDC_LIST), NULL, NULL, RDW_INVALIDATE);
break;
case IDC_CHAT_TOGGLESIDEBAR:
@@ -3153,12 +3153,12 @@ LABEL_SHOWWINDOW:
if (fSound && !nen_options.iNoSounds && !(dat->pContainer->dwFlags & CNT_NOSOUND))
SkinPlaySound("ChatSent");
- SetFocus(GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE));
+ SetFocus( GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE));
}
break;
case IDC_SHOWNICKLIST:
- if (!IsWindowEnabled(GetDlgItem(hwndDlg, IDC_SHOWNICKLIST)))
+ if (!IsWindowEnabled( GetDlgItem(hwndDlg, IDC_SHOWNICKLIST)))
break;
if (si->iType == GCW_SERVER)
break;
@@ -3180,8 +3180,8 @@ LABEL_SHOWWINDOW:
UpdateReadChars(dat);
dat->dwLastActivity = GetTickCount();
dat->pContainer->dwLastActivity = dat->dwLastActivity;
- SendDlgItemMessage(hwndDlg, IDOK, BUTTONSETASNORMAL, GetRichTextLength(GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE)) != 0, 0);
- Utils::enableDlgControl(hwndDlg, IDOK, GetRichTextLength(GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE)) != 0);
+ SendDlgItemMessage(hwndDlg, IDOK, BUTTONSETASNORMAL, GetRichTextLength( GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE)) != 0, 0);
+ Utils::enableDlgControl(hwndDlg, IDOK, GetRichTextLength( GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE)) != 0);
}
break;
@@ -3191,7 +3191,7 @@ LABEL_SHOWWINDOW:
RECT rc;
if (lParam == 0)
- GetWindowRect(GetDlgItem(hwndDlg, IDC_SMILEYBTN), &rc);
+ GetWindowRect( GetDlgItem(hwndDlg, IDC_SMILEYBTN), &rc);
else
GetWindowRect((HWND)lParam, &rc);
smaddInfo.cbSize = sizeof(SMADD_SHOWSEL3);
@@ -3212,7 +3212,7 @@ LABEL_SHOWWINDOW:
case IDC_CHAT_HISTORY: {
MODULEINFO * pInfo = MM_FindModule(si->pszModule);
- if (!IsWindowEnabled(GetDlgItem(hwndDlg, IDC_CHAT_HISTORY)))
+ if (!IsWindowEnabled( GetDlgItem(hwndDlg, IDC_CHAT_HISTORY)))
break;
if (ServiceExists("MSP/HTMLlog/ViewLog") && strstr(si->pszModule, "IRC")) {
@@ -3231,13 +3231,13 @@ LABEL_SHOWWINDOW:
break;
case IDC_CHANMGR:
- if (!IsWindowEnabled(GetDlgItem(hwndDlg, IDC_CHANMGR)))
+ if (!IsWindowEnabled( GetDlgItem(hwndDlg, IDC_CHANMGR)))
break;
DoEventHookAsync(hwndDlg, si->ptszID, si->pszModule, GC_USER_CHANMGR, NULL, NULL, 0);
break;
case IDC_FILTER:
- if (!IsWindowEnabled(GetDlgItem(hwndDlg, IDC_FILTER)))
+ if (!IsWindowEnabled( GetDlgItem(hwndDlg, IDC_FILTER)))
break;
if (si->iLogFilterFlags == 0 && !si->bFilterEnabled) {
@@ -3264,7 +3264,7 @@ LABEL_SHOWWINDOW:
cf.cbSize = sizeof(CHARFORMAT2);
cf.dwEffects = 0;
- if (!IsWindowEnabled(GetDlgItem(hwndDlg, IDC_BKGCOLOR)))
+ if (!IsWindowEnabled( GetDlgItem(hwndDlg, IDC_BKGCOLOR)))
break;
if (IsDlgButtonChecked(hwndDlg, IDC_BKGCOLOR)) {
@@ -3288,7 +3288,7 @@ LABEL_SHOWWINDOW:
cf.cbSize = sizeof(CHARFORMAT2);
cf.dwEffects = 0;
- if (!IsWindowEnabled(GetDlgItem(hwndDlg, IDC_COLOR)))
+ if (!IsWindowEnabled( GetDlgItem(hwndDlg, IDC_COLOR)))
break;
if (IsDlgButtonChecked(hwndDlg, IDC_COLOR)) {
@@ -3318,11 +3318,11 @@ LABEL_SHOWWINDOW:
cf.dwMask = CFM_BOLD | CFM_ITALIC | CFM_UNDERLINE;
cf.dwEffects = 0;
- if (LOWORD(wParam) == IDC_CHAT_BOLD && !IsWindowEnabled(GetDlgItem(hwndDlg, IDC_CHAT_BOLD)))
+ if (LOWORD(wParam) == IDC_CHAT_BOLD && !IsWindowEnabled( GetDlgItem(hwndDlg, IDC_CHAT_BOLD)))
break;
- if (LOWORD(wParam) == IDC_ITALICS && !IsWindowEnabled(GetDlgItem(hwndDlg, IDC_ITALICS)))
+ if (LOWORD(wParam) == IDC_ITALICS && !IsWindowEnabled( GetDlgItem(hwndDlg, IDC_ITALICS)))
break;
- if (LOWORD(wParam) == IDC_CHAT_UNDERLINE && !IsWindowEnabled(GetDlgItem(hwndDlg, IDC_CHAT_UNDERLINE)))
+ if (LOWORD(wParam) == IDC_CHAT_UNDERLINE && !IsWindowEnabled( GetDlgItem(hwndDlg, IDC_CHAT_UNDERLINE)))
break;
if (IsDlgButtonChecked(hwndDlg, IDC_CHAT_BOLD))
cf.dwEffects |= CFE_BOLD;
@@ -3337,7 +3337,7 @@ LABEL_SHOWWINDOW:
break;
case WM_KEYDOWN:
- SetFocus(GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE));
+ SetFocus( GetDlgItem(hwndDlg, IDC_CHAT_MESSAGE));
break;
case WM_MOVE:
@@ -3375,7 +3375,7 @@ LABEL_SHOWWINDOW:
item = &SkinItems[item_ids[i]];
if (!item->IGNORED) {
- GetWindowRect(GetDlgItem(hwndDlg, ctl_ids[i]), &rcWindow);
+ GetWindowRect( GetDlgItem(hwndDlg, ctl_ids[i]), &rcWindow);
pt.x = rcWindow.left;
pt.y = rcWindow.top;
ScreenToClient(hwndDlg, &pt);
@@ -3442,9 +3442,6 @@ LABEL_SHOWWINDOW:
case WM_RBUTTONUP: {
POINT pt;
- int iSelection;
- HMENU subMenu;
- int isHandled;
int menuID = 0;
GetCursorPos(&pt);
@@ -3452,11 +3449,11 @@ LABEL_SHOWWINDOW:
if (dat->Panel->invokeConfigDialog(pt))
break;
- subMenu = GetSubMenu(dat->pContainer->hMenuContext, 0);
+ HMENU subMenu = GetSubMenu(dat->pContainer->hMenuContext, 0);
MsgWindowUpdateMenu(dat, subMenu, MENU_TABCONTEXT);
- iSelection = TrackPopupMenu(subMenu, TPM_RETURNCMD, pt.x, pt.y, 0, hwndDlg, NULL);
+ int iSelection = TrackPopupMenu(subMenu, TPM_RETURNCMD, pt.x, pt.y, 0, hwndDlg, NULL);
if (iSelection >= IDM_CONTAINERMENU) {
DBVARIANT dbv = {0};
char szIndex[10];
@@ -3471,15 +3468,14 @@ LABEL_SHOWWINDOW:
break;
}
- isHandled = MsgWindowMenuHandler(dat, iSelection, MENU_TABCONTEXT);
+ MsgWindowMenuHandler(dat, iSelection, MENU_TABCONTEXT);
break;
}
- case WM_LBUTTONDBLCLK: {
+ case WM_LBUTTONDBLCLK:
if (LOWORD(lParam) < 30)
PostMessage(hwndDlg, GC_SCROLLTOBOTTOM, 0, 0);
break;
- }
case WM_CLOSE:
if (wParam == 0 && lParam == 0) {
@@ -3539,9 +3535,7 @@ LABEL_SHOWWINDOW:
iTabs = TabCtrl_GetItemCount(hwndTab);
if (iTabs == 1) {
- if (/*!bForced && */CMimAPI::m_shutDown == 0) {
- //DestroyWindow(GetParent(GetParent(hwndDlg)));
- //PostMessage(hwndDlg, WM_CLOSE, 0, 1);
+ if (CMimAPI::m_shutDown == 0) {
SendMessage(GetParent(GetParent(hwndDlg)), WM_CLOSE, 0, 1);
return 1;
}
@@ -3573,8 +3567,7 @@ LABEL_SHOWWINDOW:
SetFocus(dat->pContainer->hwndActive);
SendMessage(dat->pContainer->hwnd, WM_SIZE, 0, 0);
}
- //SM_SetTabbedWindowHwnd(0, 0);
- //DestroyWindow(hwndDlg);
+
if (iTabs == 1)
SendMessage(GetParent(GetParent(hwndDlg)), WM_CLOSE, 0, 1);
else {
@@ -3644,7 +3637,7 @@ LABEL_SHOWWINDOW:
case DM_ADDDIVIDER:
if (!(dat->dwFlags & MWF_DIVIDERSET) && g_Settings.UseDividers) {
- if (GetWindowTextLengthA(GetDlgItem(hwndDlg, IDC_CHAT_LOG)) > 0) {
+ if (GetWindowTextLengthA( GetDlgItem(hwndDlg, IDC_CHAT_LOG)) > 0) {
dat->dwFlags |= MWF_DIVIDERWANTED;
dat->dwFlags |= MWF_DIVIDERSET;
}
diff --git a/plugins/TabSRMM/src/contactcache.cpp b/plugins/TabSRMM/src/contactcache.cpp
index 8a1b014c54..13f1672ee5 100644
--- a/plugins/TabSRMM/src/contactcache.cpp
+++ b/plugins/TabSRMM/src/contactcache.cpp
@@ -315,7 +315,7 @@ void CContactCache::saveHistory(WPARAM wParam, LPARAM lParam)
m_iHistoryTop = (int)wParam;
}
- szFromStream = ::Message_GetFromStream(GetDlgItem(m_hwnd, IDC_MESSAGE), m_dat, (CP_UTF8 << 16) | (SF_RTFNOOBJS | SFF_PLAINRTF | SF_USECODEPAGE));
+ szFromStream = ::Message_GetFromStream( GetDlgItem(m_hwnd, IDC_MESSAGE), m_dat, (CP_UTF8 << 16) | (SF_RTFNOOBJS | SFF_PLAINRTF | SF_USECODEPAGE));
iLength = iStreamLength = (strlen(szFromStream) + 1);
diff --git a/plugins/TabSRMM/src/container.cpp b/plugins/TabSRMM/src/container.cpp
index fa55f0bf70..9b1b067148 100644
--- a/plugins/TabSRMM/src/container.cpp
+++ b/plugins/TabSRMM/src/container.cpp
@@ -72,13 +72,13 @@ void TSAPI SetAeroMargins(TContainerData *pContainer)
RECT rcWnd;
if (dat->bType == SESSIONTYPE_IM) {
if (dat->Panel->isActive())
- GetWindowRect(GetDlgItem(dat->hwnd, IDC_LOG), &rcWnd);
+ GetWindowRect( GetDlgItem(dat->hwnd, IDC_LOG), &rcWnd);
else
GetWindowRect(dat->hwnd, &rcWnd);
}
else {
if (dat->Panel->isActive())
- GetWindowRect(GetDlgItem(dat->hwnd, IDC_CHAT_LOG), &rcWnd);
+ GetWindowRect( GetDlgItem(dat->hwnd, IDC_CHAT_LOG), &rcWnd);
else
GetWindowRect(dat->hwnd, &rcWnd);
}
@@ -553,18 +553,20 @@ static BOOL fHaveTipper = FALSE;
static INT_PTR CALLBACK DlgProcContainer(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- struct TContainerData *pContainer = 0; // pointer to our struct ContainerWindowData
- int iItem = 0;
+ TContainerData *pContainer = 0; // pointer to our struct ContainerWindowData
+ int iItem = 0;
TCITEM item;
- HWND hwndTab;
- BOOL bSkinned;
+ HWND hwndTab;
+ BOOL bSkinned;
+ NMHDR* pNMHDR;
pContainer = (struct TContainerData *) GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
bSkinned = CSkin::m_skinEnabled ? TRUE : FALSE;
hwndTab = GetDlgItem(hwndDlg, IDC_MSGTABS);
switch (msg) {
- case WM_INITDIALOG: {
+ case WM_INITDIALOG:
+ {
DWORD ws;
HMENU hSysmenu;
DWORD dwCreateFlags;
@@ -615,7 +617,7 @@ static INT_PTR CALLBACK DlgProcContainer(HWND hwndDlg, UINT msg, WPARAM wParam,
pContainer->buttonItems = g_ButtonSet.items;
pContainer->dwFlags = ((pContainer->dwFlagsEx & (TCF_SBARLEFT | TCF_SBARRIGHT)) ?
- pContainer->dwFlags | CNT_SIDEBAR : pContainer->dwFlags & ~CNT_SIDEBAR);
+ pContainer->dwFlags | CNT_SIDEBAR : pContainer->dwFlags & ~CNT_SIDEBAR);
pContainer->SideBar = new CSideBar(pContainer);
pContainer->MenuBar = new CMenuBar(hwndDlg, pContainer);
@@ -628,8 +630,8 @@ static INT_PTR CALLBACK DlgProcContainer(HWND hwndDlg, UINT msg, WPARAM wParam,
SetClassLongPtr(hwndDlg, GCL_STYLE, GetClassLongPtr(hwndDlg, GCL_STYLE) & ~CS_DROPSHADOW);
/*
- * additional system menu items...
- */
+ * additional system menu items...
+ */
hSysmenu = GetSystemMenu(hwndDlg, FALSE);
iMenuItems = GetMenuItemCount(hSysmenu);
@@ -644,11 +646,11 @@ static INT_PTR CALLBACK DlgProcContainer(HWND hwndDlg, UINT msg, WPARAM wParam,
SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)PluginConfig.g_iconContainer);
/*
- * make the tab control the controlling parent window for all message dialogs
- */
+ * make the tab control the controlling parent window for all message dialogs
+ */
- ws = GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_MSGTABS), GWL_EXSTYLE);
- SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_MSGTABS), GWL_EXSTYLE, ws | WS_EX_CONTROLPARENT);
+ ws = GetWindowLongPtr( GetDlgItem(hwndDlg, IDC_MSGTABS), GWL_EXSTYLE);
+ SetWindowLongPtr( GetDlgItem(hwndDlg, IDC_MSGTABS), GWL_EXSTYLE, ws | WS_EX_CONTROLPARENT);
LONG x_pad = M->GetByte("x-pad", 3) + (pContainer->dwFlagsEx & TCF_CLOSEBUTTON ? 7 : 0);
LONG y_pad = M->GetByte("y-pad", 3) + ((pContainer->dwFlags & CNT_TABSBOTTOM) ? 1 : 0);
@@ -656,26 +658,26 @@ static INT_PTR CALLBACK DlgProcContainer(HWND hwndDlg, UINT msg, WPARAM wParam,
if (pContainer->dwFlagsEx & TCF_FLAT)
y_pad += 1; //(pContainer->dwFlags & CNT_TABSBOTTOM ? 1 : 2);
- TabCtrl_SetPadding(GetDlgItem(hwndDlg, IDC_MSGTABS), x_pad, y_pad);
+ TabCtrl_SetPadding( GetDlgItem(hwndDlg, IDC_MSGTABS), x_pad, y_pad);
- TabCtrl_SetImageList(GetDlgItem(hwndDlg, IDC_MSGTABS), PluginConfig.g_hImageList);
+ TabCtrl_SetImageList( GetDlgItem(hwndDlg, IDC_MSGTABS), PluginConfig.g_hImageList);
SendMessage(hwndDlg, DM_CONFIGURECONTAINER, 0, 10);
/*
- * context menu
- */
+ * context menu
+ */
pContainer->hMenuContext = PluginConfig.g_hMenuContext;
/*
- * tab tooltips...
- */
+ * tab tooltips...
+ */
if (!fHaveTipper || M->GetByte("d_tooltips", 0) == 0) {
pContainer->hwndTip = CreateWindowEx(0, TOOLTIPS_CLASS, NULL, WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP, CW_USEDEFAULT, CW_USEDEFAULT,
- CW_USEDEFAULT, CW_USEDEFAULT, hwndDlg, NULL, g_hInst, (LPVOID) NULL);
+ CW_USEDEFAULT, CW_USEDEFAULT, hwndDlg, NULL, g_hInst, (LPVOID) NULL);
if (pContainer->hwndTip) {
SetWindowPos(pContainer->hwndTip, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
- TabCtrl_SetToolTips(GetDlgItem(hwndDlg, IDC_MSGTABS), pContainer->hwndTip);
+ TabCtrl_SetToolTips( GetDlgItem(hwndDlg, IDC_MSGTABS), pContainer->hwndTip);
}
}
@@ -687,9 +689,9 @@ static INT_PTR CALLBACK DlgProcContainer(HWND hwndDlg, UINT msg, WPARAM wParam,
wp.length = sizeof(wp);
- SetWindowLongPtr(hwndDlg, GWL_STYLE, GetWindowLongPtr(hwndDlg, GWL_STYLE) & ~WS_VISIBLE);
+ SetWindowLongPtr(hwndDlg, GWL_STYLE, GetWindowLongPtr(hwndDlg, GWL_STYLE) & ~WS_VISIBLE);
ShowWindow(hwndDlg, SW_SHOWMINNOACTIVE);
- SendMessage(hwndDlg, DM_RESTOREWINDOWPOS, 0, 0);
+ SendMessage(hwndDlg, DM_RESTOREWINDOWPOS, 0, 0);
//GetClientRect(hwndDlg, &pContainer->rcSaved);
ShowWindow(hwndDlg, SW_SHOWMINNOACTIVE);
GetWindowPlacement(hwndDlg, &wp);
@@ -703,59 +705,56 @@ static INT_PTR CALLBACK DlgProcContainer(HWND hwndDlg, UINT msg, WPARAM wParam,
}
/*
- * prevent ugly back background being visible while tabbed clients are created
- */
+ * prevent ugly back background being visible while tabbed clients are created
+ */
if (M->isAero()) {
MARGINS m = {-1};
CMimAPI::m_pfnDwmExtendFrameIntoClientArea(hwndDlg, &m);
}
return TRUE;
}
- case DM_RESTOREWINDOWPOS: {
- char *szSetting = "CNTW_";
- char szCName[CONTAINER_NAMELEN + 20];
- /*
- * retrieve the container window geometry information from the database.
- */
- if (pContainer->isCloned && pContainer->hContactFrom != 0 && !(pContainer->dwFlags & CNT_GLOBALSIZE)) {
- if (Utils_RestoreWindowPosition(hwndDlg, pContainer->hContactFrom, SRMSGMOD_T, "split")) {
- if (Utils_RestoreWindowPositionNoMove(hwndDlg, pContainer->hContactFrom, SRMSGMOD_T, "split"))
- if (Utils_RestoreWindowPosition(hwndDlg, NULL, SRMSGMOD_T, "split"))
- if (Utils_RestoreWindowPositionNoMove(hwndDlg, NULL, SRMSGMOD_T, "split"))
- SetWindowPos(hwndDlg, 0, 50, 50, 450, 300, SWP_NOZORDER | SWP_NOACTIVATE);
- }
- }
- else {
- if (pContainer->dwFlags & CNT_GLOBALSIZE) {
+ case DM_RESTOREWINDOWPOS: {
+ char *szSetting = "CNTW_";
+ char szCName[CONTAINER_NAMELEN + 20];
+ /*
+ * retrieve the container window geometry information from the database.
+ */
+ if (pContainer->isCloned && pContainer->hContactFrom != 0 && !(pContainer->dwFlags & CNT_GLOBALSIZE)) {
+ if (Utils_RestoreWindowPosition(hwndDlg, pContainer->hContactFrom, SRMSGMOD_T, "split")) {
+ if (Utils_RestoreWindowPositionNoMove(hwndDlg, pContainer->hContactFrom, SRMSGMOD_T, "split"))
if (Utils_RestoreWindowPosition(hwndDlg, NULL, SRMSGMOD_T, "split"))
if (Utils_RestoreWindowPositionNoMove(hwndDlg, NULL, SRMSGMOD_T, "split"))
SetWindowPos(hwndDlg, 0, 50, 50, 450, 300, SWP_NOZORDER | SWP_NOACTIVATE);
- }
- else {
- mir_snprintf(szCName, sizeof(szCName), "%s%d", szSetting, pContainer->iContainerIndex);
- if (Utils_RestoreWindowPosition(hwndDlg, NULL, SRMSGMOD_T, szCName)) {
- if (Utils_RestoreWindowPositionNoMove(hwndDlg, NULL, SRMSGMOD_T, szCName))
- if (Utils_RestoreWindowPosition(hwndDlg, NULL, SRMSGMOD_T, "split"))
- if (Utils_RestoreWindowPositionNoMove(hwndDlg, NULL, SRMSGMOD_T, "split"))
- SetWindowPos(hwndDlg, 0, 50, 50, 450, 300, SWP_NOZORDER | SWP_NOACTIVATE);
- }
+ }
+ }
+ else {
+ if (pContainer->dwFlags & CNT_GLOBALSIZE) {
+ if (Utils_RestoreWindowPosition(hwndDlg, NULL, SRMSGMOD_T, "split"))
+ if (Utils_RestoreWindowPositionNoMove(hwndDlg, NULL, SRMSGMOD_T, "split"))
+ SetWindowPos(hwndDlg, 0, 50, 50, 450, 300, SWP_NOZORDER | SWP_NOACTIVATE);
+ }
+ else {
+ mir_snprintf(szCName, sizeof(szCName), "%s%d", szSetting, pContainer->iContainerIndex);
+ if (Utils_RestoreWindowPosition(hwndDlg, NULL, SRMSGMOD_T, szCName)) {
+ if (Utils_RestoreWindowPositionNoMove(hwndDlg, NULL, SRMSGMOD_T, szCName))
+ if (Utils_RestoreWindowPosition(hwndDlg, NULL, SRMSGMOD_T, "split"))
+ if (Utils_RestoreWindowPositionNoMove(hwndDlg, NULL, SRMSGMOD_T, "split"))
+ SetWindowPos(hwndDlg, 0, 50, 50, 450, 300, SWP_NOZORDER | SWP_NOACTIVATE);
}
}
- return 0;
}
+ return 0;
+ }
- case WM_SIZE: {
- RECT rcClient, rcUnadjusted;
- int i = 0;
+ case WM_SIZE:
+ if (IsIconic(hwndDlg))
+ pContainer->dwFlags |= CNT_DEFERREDSIZEREQUEST;
+ else {
+ RECT rcClient, rcUnadjusted;
TCITEM item = {0};
- POINT pt = {0};
- LONG sbarWidth, sbarWidth_left;
- BOOL sizeChanged = FALSE;
-
- if (IsIconic(hwndDlg)) {
- pContainer->dwFlags |= CNT_DEFERREDSIZEREQUEST;
- break;
- }
+ POINT pt = {0};
+ LONG sbarWidth, sbarWidth_left;
+ BOOL sizeChanged = FALSE;
GetClientRect(hwndDlg, &rcClient);
pContainer->MenuBar->getClientRect();
@@ -771,8 +770,7 @@ static INT_PTR CALLBACK DlgProcContainer(HWND hwndDlg, UINT msg, WPARAM wParam,
SendMessage(pContainer->hwndStatus, SB_SETTEXT, (WPARAM)(SBT_OWNERDRAW) | 2, 0);
}
- else
- pContainer->statusBarHeight = 0;
+ else pContainer->statusBarHeight = 0;
CopyRect(&pContainer->rcSaved, &rcClient);
rcUnadjusted = rcClient;
@@ -788,42 +786,40 @@ static INT_PTR CALLBACK DlgProcContainer(HWND hwndDlg, UINT msg, WPARAM wParam,
DWORD dwSWPFlags = SWP_NOACTIVATE|SWP_NOZORDER |SWP_DEFERERASE | SWP_NOCOPYBITS; // | SWP_NOSENDCHANGING | SWP_ASYNCWINDOWPOS;
if (pContainer->dwFlags & CNT_TABSBOTTOM)
SetWindowPos(hwndTab, 0, pContainer->tBorder_outer_left + sbarWidth_left, pContainer->tBorder_outer_top + rebarHeight,
- (rcClient.right - rcClient.left) - (pContainer->tBorder_outer_left + pContainer->tBorder_outer_right + sbarWidth),
- (rcClient.bottom - rcClient.top) - pContainer->statusBarHeight - (pContainer->tBorder_outer_top + pContainer->tBorder_outer_bottom) - rebarHeight, dwSWPFlags);
+ (rcClient.right - rcClient.left) - (pContainer->tBorder_outer_left + pContainer->tBorder_outer_right + sbarWidth),
+ (rcClient.bottom - rcClient.top) - pContainer->statusBarHeight - (pContainer->tBorder_outer_top + pContainer->tBorder_outer_bottom) - rebarHeight, dwSWPFlags);
else
SetWindowPos(hwndTab, 0, pContainer->tBorder_outer_left + sbarWidth_left, pContainer->tBorder_outer_top + rebarHeight,
- (rcClient.right - rcClient.left) - (pContainer->tBorder_outer_left + pContainer->tBorder_outer_right + sbarWidth),
- (rcClient.bottom - rcClient.top) - pContainer->statusBarHeight - (pContainer->tBorder_outer_top + pContainer->tBorder_outer_bottom) - rebarHeight, dwSWPFlags);
+ (rcClient.right - rcClient.left) - (pContainer->tBorder_outer_left + pContainer->tBorder_outer_right + sbarWidth),
+ (rcClient.bottom - rcClient.top) - pContainer->statusBarHeight - (pContainer->tBorder_outer_top + pContainer->tBorder_outer_bottom) - rebarHeight, dwSWPFlags);
}
pContainer->SideBar->resizeScrollWnd(sbarWidth_left ? pContainer->tBorder_outer_left : rcClient.right - pContainer->tBorder_outer_right - (sbarWidth - 2),
- pContainer->tBorder_outer_top + rebarHeight,
- 0,
- (rcClient.bottom - rcClient.top) - pContainer->statusBarHeight - (pContainer->tBorder_outer_top + pContainer->tBorder_outer_bottom) - rebarHeight);
+ pContainer->tBorder_outer_top + rebarHeight, 0,
+ (rcClient.bottom - rcClient.top) - pContainer->statusBarHeight - (pContainer->tBorder_outer_top + pContainer->tBorder_outer_bottom) - rebarHeight);
AdjustTabClientRect(pContainer, &rcClient);
sizeChanged = (((rcClient.right - rcClient.left) != pContainer->preSIZE.cx) ||
- ((rcClient.bottom - rcClient.top) != pContainer->preSIZE.cy));
+ ((rcClient.bottom - rcClient.top) != pContainer->preSIZE.cy));
if (sizeChanged) {
pContainer->preSIZE.cx = rcClient.right - rcClient.left;
pContainer->preSIZE.cy = rcClient.bottom - rcClient.top;
}
-
/*
- * we care about all client sessions, but we really resize only the active tab (hwndActive)
- * we tell inactive tabs to resize theirselves later when they get activated (DM_CHECKSIZE
- * just queues a resize request)
- */
+ * we care about all client sessions, but we really resize only the active tab (hwndActive)
+ * we tell inactive tabs to resize theirselves later when they get activated (DM_CHECKSIZE
+ * just queues a resize request)
+ */
int nCount = TabCtrl_GetItemCount(hwndTab);
- for (i=0; i < nCount; i++) {
+ for (int i=0; i < nCount; i++) {
item.mask = TCIF_PARAM;
TabCtrl_GetItem(hwndTab, i, &item);
if ((HWND)item.lParam == pContainer->hwndActive) {
SetWindowPos((HWND)item.lParam, 0, rcClient.left, rcClient.top, (rcClient.right - rcClient.left), (rcClient.bottom - rcClient.top),
- SWP_NOSENDCHANGING|SWP_NOACTIVATE/*|SWP_NOCOPYBITS*/);
+ SWP_NOSENDCHANGING|SWP_NOACTIVATE/*|SWP_NOCOPYBITS*/);
if (!pContainer->bSizingLoop && sizeChanged) {
TWindowData *dat = (TWindowData *)GetWindowLongPtr(pContainer->hwndActive, GWLP_USERDATA);
DM_ScrollToBottom(dat, 0, 1);
@@ -863,195 +859,191 @@ static INT_PTR CALLBACK DlgProcContainer(HWND hwndDlg, UINT msg, WPARAM wParam,
if (CSkin::m_bRoundedCorner)
rgn = CreateRoundRectRgn(clip, clip, (rcWindow.right - rcWindow.left) - clip + 1,
- (rcWindow.bottom - rcWindow.top) - clip + 1, CSkin::m_bRoundedCorner + clip, CSkin::m_bRoundedCorner + clip);
+ (rcWindow.bottom - rcWindow.top) - clip + 1, CSkin::m_bRoundedCorner + clip, CSkin::m_bRoundedCorner + clip);
else
rgn = CreateRectRgn(clip, clip, (rcWindow.right - rcWindow.left) - clip, (rcWindow.bottom - rcWindow.top) - clip);
SetWindowRgn(hwndDlg, rgn, TRUE);
}
else if (CSkin::m_frameSkins)
SetWindowRgn(hwndDlg, NULL, TRUE);
-
- break;
}
+ break;
- case WM_NOTIFY: {
- if (pContainer->MenuBar) {
- LRESULT processed = pContainer->MenuBar->processMsg(msg, wParam, lParam);
- if (processed != -1) {
- SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, processed);
- return(processed);
- }
+ case WM_NOTIFY:
+ if (pContainer->MenuBar) {
+ LRESULT processed = pContainer->MenuBar->processMsg(msg, wParam, lParam);
+ if (processed != -1) {
+ SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, processed);
+ return processed;
}
- NMHDR* pNMHDR = (NMHDR*) lParam;
- if (pContainer != NULL && pContainer->hwndStatus != 0 && ((LPNMHDR)lParam)->hwndFrom == pContainer->hwndStatus) {
- switch (((LPNMHDR)lParam)->code) {
- case NM_CLICK:
- case NM_RCLICK: {
- unsigned int nParts, nPanel;
- NMMOUSE *nm = (NMMOUSE*)lParam;
- RECT rc;
+ }
+ pNMHDR = (NMHDR*) lParam;
+ if (pContainer != NULL && pContainer->hwndStatus != 0 && ((LPNMHDR)lParam)->hwndFrom == pContainer->hwndStatus) {
+ switch (((LPNMHDR)lParam)->code) {
+ case NM_CLICK:
+ case NM_RCLICK: {
+ unsigned int nParts, nPanel;
+ NMMOUSE *nm = (NMMOUSE*)lParam;
+ RECT rc;
- nParts = SendMessage(pContainer->hwndStatus, SB_GETPARTS, 0, 0);
- if (nm->dwItemSpec == 0xFFFFFFFE) {
- nPanel = 2;
- SendMessage(pContainer->hwndStatus, SB_GETRECT, nPanel, (LPARAM)&rc);
- if (nm->pt.x > rc.left && nm->pt.x < rc.right)
- goto panel_found;
- else
- return FALSE;
- }
- else
- nPanel = nm->dwItemSpec;
+ nParts = SendMessage(pContainer->hwndStatus, SB_GETPARTS, 0, 0);
+ if (nm->dwItemSpec == 0xFFFFFFFE) {
+ nPanel = 2;
+ SendMessage(pContainer->hwndStatus, SB_GETRECT, nPanel, (LPARAM)&rc);
+ if (nm->pt.x > rc.left && nm->pt.x < rc.right)
+ goto panel_found;
+ else
+ return FALSE;
+ }
+ else
+ nPanel = nm->dwItemSpec;
panel_found:
- if (nPanel == 2) {
- struct TWindowData *dat = (struct TWindowData *)GetWindowLongPtr(pContainer->hwndActive, GWLP_USERDATA);
- SendMessage(pContainer->hwndStatus, SB_GETRECT, nPanel, (LPARAM)&rc);
- if (dat)
- SI_CheckStatusIconClick(dat, pContainer->hwndStatus, nm->pt, rc, 2, ((LPNMHDR)lParam)->code);
- }
- else if (((LPNMHDR)lParam)->code == NM_RCLICK) {
- POINT pt;
- HANDLE hContact = 0;
- HMENU hMenu;
-
- GetCursorPos(&pt);
- SendMessage(pContainer->hwndActive, DM_QUERYHCONTACT, 0, (LPARAM)&hContact);
- if (hContact) {
- int iSel = 0;
- hMenu = (HMENU) CallService(MS_CLIST_MENUBUILDCONTACT, (WPARAM) hContact, 0);
- iSel = TrackPopupMenu(hMenu, TPM_RETURNCMD, pt.x, pt.y, 0, hwndDlg, NULL);
- if (iSel)
- CallService(MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM(LOWORD(iSel), MPCF_CONTACTMENU), (LPARAM) hContact);
- DestroyMenu(hMenu);
- }
- }
- return TRUE;
+ if (nPanel == 2) {
+ struct TWindowData *dat = (struct TWindowData *)GetWindowLongPtr(pContainer->hwndActive, GWLP_USERDATA);
+ SendMessage(pContainer->hwndStatus, SB_GETRECT, nPanel, (LPARAM)&rc);
+ if (dat)
+ SI_CheckStatusIconClick(dat, pContainer->hwndStatus, nm->pt, rc, 2, ((LPNMHDR)lParam)->code);
+ }
+ else if (((LPNMHDR)lParam)->code == NM_RCLICK) {
+ POINT pt;
+ HANDLE hContact = 0;
+ HMENU hMenu;
+
+ GetCursorPos(&pt);
+ SendMessage(pContainer->hwndActive, DM_QUERYHCONTACT, 0, (LPARAM)&hContact);
+ if (hContact) {
+ int iSel = 0;
+ hMenu = (HMENU) CallService(MS_CLIST_MENUBUILDCONTACT, (WPARAM) hContact, 0);
+ iSel = TrackPopupMenu(hMenu, TPM_RETURNCMD, pt.x, pt.y, 0, hwndDlg, NULL);
+ if (iSel)
+ CallService(MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM(LOWORD(iSel), MPCF_CONTACTMENU), (LPARAM) hContact);
+ DestroyMenu(hMenu);
}
}
- break;
+ return TRUE;
+ }
}
- switch (pNMHDR->code) {
- case TCN_SELCHANGE: {
- ZeroMemory((void*)&item, sizeof(item));
- iItem = TabCtrl_GetCurSel(hwndTab);
- item.mask = TCIF_PARAM;
- if (TabCtrl_GetItem(hwndTab, iItem, &item)) {
- if ((HWND)item.lParam != pContainer->hwndActive) {
- if (pContainer->hwndActive && IsWindow(pContainer->hwndActive))
- ShowWindow(pContainer->hwndActive, SW_HIDE);
- }
- pContainer->hwndActive = (HWND) item.lParam;
- SendMessage((HWND)item.lParam, DM_SAVESIZE, 0, 1);
- ShowWindow((HWND)item.lParam, SW_SHOW);
- if (!IsIconic(hwndDlg))
- SetFocus(pContainer->hwndActive);
- }
- SendMessage(hwndTab, EM_VALIDATEBOTTOM, 0, 0);
- return 0;
+ break;
+ }
+
+ switch (pNMHDR->code) {
+ case TCN_SELCHANGE:
+ ZeroMemory((void*)&item, sizeof(item));
+ iItem = TabCtrl_GetCurSel(hwndTab);
+ item.mask = TCIF_PARAM;
+ if (TabCtrl_GetItem(hwndTab, iItem, &item)) {
+ if ((HWND)item.lParam != pContainer->hwndActive) {
+ if (pContainer->hwndActive && IsWindow(pContainer->hwndActive))
+ ShowWindow(pContainer->hwndActive, SW_HIDE);
}
- /*
- * tooltips
- */
- case NM_RCLICK: {
- HMENU subMenu;
- POINT pt, pt1;
- int iSelection, iItem;
- TCITEM item = {0};
- struct TWindowData *dat = 0;
- bool fFromSidebar = false;
+ pContainer->hwndActive = (HWND) item.lParam;
+ SendMessage((HWND)item.lParam, DM_SAVESIZE, 0, 1);
+ ShowWindow((HWND)item.lParam, SW_SHOW);
+ if (!IsIconic(hwndDlg))
+ SetFocus(pContainer->hwndActive);
+ }
+ SendMessage(hwndTab, EM_VALIDATEBOTTOM, 0, 0);
+ return 0;
- GetCursorPos(&pt);
- pt1 = pt;
- subMenu = GetSubMenu(pContainer->hMenuContext, 0);
+ // tooltips
+ case NM_RCLICK:
+ {
+ HMENU subMenu;
+ POINT pt, pt1;
+ int iSelection, iItem;
+ TCITEM item = {0};
+ struct TWindowData *dat = 0;
+ bool fFromSidebar = false;
- if (pNMHDR->idFrom == IDC_MSGTABS) {
- if ((iItem = GetTabItemFromMouse(hwndTab, &pt)) == -1)
- break;
+ GetCursorPos(&pt);
+ pt1 = pt;
+ subMenu = GetSubMenu(pContainer->hMenuContext, 0);
- item.mask = TCIF_PARAM;
- TabCtrl_GetItem(hwndTab, iItem, &item);
- if (item.lParam && IsWindow((HWND)item.lParam))
- dat = (struct TWindowData *)GetWindowLongPtr((HWND)item.lParam, GWLP_USERDATA);
- }
- /*
- * sent from a sidebar button (RMB click) instead of the tab control
- */
- else if (pNMHDR->idFrom == 5000) {
- TSideBarNotify* n = reinterpret_cast<TSideBarNotify *>(lParam);
- dat = const_cast<TWindowData *>(n->dat);
- fFromSidebar = true;
- }
+ if (pNMHDR->idFrom == IDC_MSGTABS) {
+ if ((iItem = GetTabItemFromMouse(hwndTab, &pt)) == -1)
+ break;
- if (dat)
- MsgWindowUpdateMenu(dat, subMenu, MENU_TABCONTEXT);
-
- iSelection = TrackPopupMenu(subMenu, TPM_RETURNCMD, pt1.x, pt1.y, 0, hwndDlg, NULL);
- if (iSelection >= IDM_CONTAINERMENU) {
- DBVARIANT dbv = {0};
- char szIndex[10];
- char *szKey = "TAB_ContainersW";
- mir_snprintf(szIndex, 8, "%d", iSelection - IDM_CONTAINERMENU);
- if (iSelection - IDM_CONTAINERMENU >= 0) {
- if (!M->GetTString(NULL, szKey, szIndex, &dbv)) {
- SendMessage((HWND)item.lParam, DM_CONTAINERSELECTED, 0, (LPARAM) dbv.ptszVal);
- DBFreeVariant(&dbv);
- }
+ item.mask = TCIF_PARAM;
+ TabCtrl_GetItem(hwndTab, iItem, &item);
+ if (item.lParam && IsWindow((HWND)item.lParam))
+ dat = (struct TWindowData *)GetWindowLongPtr((HWND)item.lParam, GWLP_USERDATA);
+ }
+ /*
+ * sent from a sidebar button (RMB click) instead of the tab control
+ */
+ else if (pNMHDR->idFrom == 5000) {
+ TSideBarNotify* n = reinterpret_cast<TSideBarNotify *>(lParam);
+ dat = const_cast<TWindowData *>(n->dat);
+ fFromSidebar = true;
+ }
+
+ if (dat)
+ MsgWindowUpdateMenu(dat, subMenu, MENU_TABCONTEXT);
+
+ iSelection = TrackPopupMenu(subMenu, TPM_RETURNCMD, pt1.x, pt1.y, 0, hwndDlg, NULL);
+ if (iSelection >= IDM_CONTAINERMENU) {
+ DBVARIANT dbv = {0};
+ char szIndex[10];
+ char *szKey = "TAB_ContainersW";
+ mir_snprintf(szIndex, 8, "%d", iSelection - IDM_CONTAINERMENU);
+ if (iSelection - IDM_CONTAINERMENU >= 0) {
+ if (!M->GetTString(NULL, szKey, szIndex, &dbv)) {
+ SendMessage((HWND)item.lParam, DM_CONTAINERSELECTED, 0, (LPARAM) dbv.ptszVal);
+ DBFreeVariant(&dbv);
}
- return 1;
}
- switch (iSelection) {
- case ID_TABMENU_CLOSETAB:
- if (fFromSidebar)
- SendMessage(dat->hwnd, WM_CLOSE, 1, 0);
- else
- SendMessage(hwndDlg, DM_CLOSETABATMOUSE, 0, (LPARAM)&pt1);
- break;
- case ID_TABMENU_CLOSEOTHERTABS:
- CloseOtherTabs(hwndTab, *dat);
- break;
- case ID_TABMENU_SAVETABPOSITION:
- M->WriteDword(dat->hContact, SRMSGMOD_T, "tabindex", dat->iTabID * 100);
- break;
- case ID_TABMENU_CLEARSAVEDTABPOSITION:
- DBDeleteContactSetting(dat->hContact, SRMSGMOD_T, "tabindex");
- break;
- case ID_TABMENU_LEAVECHATROOM: {
- if (dat && dat->bType == SESSIONTYPE_CHAT) {
- SESSION_INFO *si = (SESSION_INFO *)dat->si;
- if (si && dat->hContact) {
- char* szProto = GetContactProto(dat->hContact);
- if ( szProto )
- CallProtoService( szProto, PS_LEAVECHAT, (WPARAM)dat->hContact, 0 );
- }
- }
- break;
+ return 1;
+ }
+ switch (iSelection) {
+ case ID_TABMENU_CLOSETAB:
+ if (fFromSidebar)
+ SendMessage(dat->hwnd, WM_CLOSE, 1, 0);
+ else
+ SendMessage(hwndDlg, DM_CLOSETABATMOUSE, 0, (LPARAM)&pt1);
+ break;
+ case ID_TABMENU_CLOSEOTHERTABS:
+ CloseOtherTabs(hwndTab, *dat);
+ break;
+ case ID_TABMENU_SAVETABPOSITION:
+ M->WriteDword(dat->hContact, SRMSGMOD_T, "tabindex", dat->iTabID * 100);
+ break;
+ case ID_TABMENU_CLEARSAVEDTABPOSITION:
+ DBDeleteContactSetting(dat->hContact, SRMSGMOD_T, "tabindex");
+ break;
+ case ID_TABMENU_LEAVECHATROOM:
+ if (dat && dat->bType == SESSIONTYPE_CHAT) {
+ SESSION_INFO *si = (SESSION_INFO *)dat->si;
+ if (si && dat->hContact) {
+ char* szProto = GetContactProto(dat->hContact);
+ if ( szProto )
+ CallProtoService( szProto, PS_LEAVECHAT, (WPARAM)dat->hContact, 0 );
}
- case ID_TABMENU_ATTACHTOCONTAINER:
- if ((iItem = GetTabItemFromMouse(hwndTab, &pt1)) == -1)
- break;
- ZeroMemory((void*)&item, sizeof(item));
- item.mask = TCIF_PARAM;
- TabCtrl_GetItem(hwndTab, iItem, &item);
- CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_SELECTCONTAINER), hwndDlg, SelectContainerDlgProc, (LPARAM) item.lParam);
- break;
- case ID_TABMENU_CONTAINEROPTIONS: {
- if (pContainer->hWndOptions == 0)
- CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_CONTAINEROPTIONS), hwndDlg, DlgProcContainerOptions, (LPARAM) pContainer);
- break;
- case ID_TABMENU_CLOSECONTAINER:
- SendMessage(hwndDlg, WM_CLOSE, 0, 0);
- break;
- }
}
- InvalidateRect(hwndTab, NULL, FALSE);
- return 1;
+ break;
+ case ID_TABMENU_ATTACHTOCONTAINER:
+ if ((iItem = GetTabItemFromMouse(hwndTab, &pt1)) == -1)
+ break;
+ ZeroMemory((void*)&item, sizeof(item));
+ item.mask = TCIF_PARAM;
+ TabCtrl_GetItem(hwndTab, iItem, &item);
+ CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_SELECTCONTAINER), hwndDlg, SelectContainerDlgProc, (LPARAM) item.lParam);
+ break;
+ case ID_TABMENU_CONTAINEROPTIONS:
+ if (pContainer->hWndOptions == 0)
+ CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_CONTAINEROPTIONS), hwndDlg, DlgProcContainerOptions, (LPARAM) pContainer);
+ break;
+ case ID_TABMENU_CLOSECONTAINER:
+ SendMessage(hwndDlg, WM_CLOSE, 0, 0);
+ break;
}
+ InvalidateRect(hwndTab, NULL, FALSE);
+ return 1;
}
- break;
}
+ break;
- case WM_COMMAND: {
-
+ case WM_COMMAND:
+ {
bool fProcessContactMenu = pContainer->MenuBar->isContactMenu();
bool fProcessMainMenu = pContainer->MenuBar->isMainMenu();
pContainer->MenuBar->Cancel();
@@ -1077,109 +1069,10 @@ panel_found:
SendMessage(pContainer->hwndActive, DM_QUERYHCONTACT, 0, (LPARAM)&hContact);
if (LOWORD(wParam) == IDC_TBFIRSTUID - 1)
break;
- /*
- else if (LOWORD(wParam) >= IDC_TBFIRSTUID) { // skinnable buttons handling
- ButtonItem *item = pContainer->buttonItems;
- WPARAM wwParam = 0;
- LPARAM llParam = 0;
- HANDLE hContact = dat ? dat->hContact : 0;
- int serviceFailure = FALSE;
-
- while (item) {
- if (item->uId == (DWORD)LOWORD(wParam)) {
- int contactOK = ServiceParamsOK(item, &wwParam, &llParam, hContact);
-
- if (item->dwFlags & BUTTON_ISSERVICE) {
- if (ServiceExists(item->szService) && contactOK)
- CallService(item->szService, wwParam, llParam);
- else if (contactOK)
- serviceFailure = TRUE;
- }
- else if (item->dwFlags & BUTTON_ISPROTOSERVICE) {
- if (contactOK) {
- char szFinalService[512];
-
- mir_snprintf(szFinalService, 512, "%s/%s", GetContactProto(hContact), item->szService);
- if (ServiceExists(szFinalService))
- CallService(szFinalService, wwParam, llParam);
- else
- serviceFailure = TRUE;
- }
- }
- else if (item->dwFlags & BUTTON_ISDBACTION) {
- BYTE *pValue;
- char *szModule = item->szModule;
- char *szSetting = item->szSetting;
- HANDLE finalhContact = 0;
-
- if (item->dwFlags & BUTTON_ISCONTACTDBACTION || item->dwFlags & BUTTON_DBACTIONONCONTACT) {
- contactOK = ServiceParamsOK(item, &wwParam, &llParam, hContact);
- if (contactOK && item->dwFlags & BUTTON_ISCONTACTDBACTION)
- szModule = GetContactProto(hContact);
- finalhContact = hContact;
- }
- else
- contactOK = 1;
-
- if (contactOK) {
- BOOL fDelete = FALSE;
-
- if (item->dwFlags & BUTTON_ISTOGGLE) {
- BOOL fChecked = (SendMessage(item->hWnd, BM_GETCHECK, 0, 0) == BST_UNCHECKED);
-
- pValue = fChecked ? item->bValueRelease : item->bValuePush;
- if (fChecked && pValue[0] == 0)
- fDelete = TRUE;
- }
- else
- pValue = item->bValuePush;
-
- if (fDelete)
- DBDeleteContactSetting(finalhContact, szModule, szSetting);
- else {
- switch (item->type) {
- case DBVT_BYTE:
- M->WriteByte(finalhContact, szModule, szSetting, pValue[0]);
- break;
- case DBVT_WORD:
- DBWriteContactSettingWord(finalhContact, szModule, szSetting, *((WORD *)&pValue[0]));
- break;
- case DBVT_DWORD:
- M->WriteDword(finalhContact, szModule, szSetting, *((DWORD *)&pValue[0]));
- break;
- case DBVT_ASCIIZ:
- DBWriteContactSettingString(finalhContact, szModule, szSetting, (char *)pValue);
- break;
- }
- }
- }
- else if (item->dwFlags & BUTTON_ISTOGGLE)
- SendMessage(item->hWnd, BM_SETCHECK, 0, 0);
- }
- if (!contactOK)
- MessageBox(0, _T("The requested action requires a valid contact selection. Please select a contact from the contact list and repeat"), _T("Parameter mismatch"), MB_OK);
- if (serviceFailure) {
- char szError[512];
- mir_snprintf(szError, 512, "The service %s specified by the %s button definition was not found. You may need to install additional plugins", item->szService, item->szName);
- MessageBoxA(0, szError, "Service failure", MB_OK);
- }
- goto buttons_done;
- }
- item = item->nextItem;
- }
- }
- while (pItem) {
- if (LOWORD(wParam) == pItem->uId) {
- if (pItem->pfnAction != NULL)
- pItem->pfnAction(pItem, pContainer->hwndActive, dat, GetDlgItem(hwndDlg, pItem->uId));
- }
- pItem = pItem->nextItem;
- }
-buttons_done:
- */
switch (LOWORD(wParam)) {
- case IDC_TOGGLESIDEBAR: {
+ case IDC_TOGGLESIDEBAR:
+ {
RECT rc;
LONG dwNewLeft;
BOOL skinnedMode = bSkinned;
@@ -1203,72 +1096,77 @@ buttons_done:
pContainer->oldDCSize.cx = pContainer->oldDCSize.cy = 0;
PostMessage(hwndDlg, WM_SIZE, 0, 1);
- break;
-
}
- case IDC_SIDEBARDOWN:
- case IDC_SIDEBARUP: {
+ break;
+
+ case IDC_SIDEBARDOWN:
+ case IDC_SIDEBARUP:
+ {
HWND hwnd = GetFocus();
pContainer->SideBar->processScrollerButtons(LOWORD(wParam));
- //if (lParam)
- //SetFocus(GetDlgItem(pContainer->hwndActive, lParam));
SetFocus(hwnd);
- break;
}
- default:
- Utils::CmdDispatcher(Utils::CMD_CONTAINER, hwndDlg, LOWORD(wParam), wParam, lParam, 0, pContainer);
+ break;
+
+ default:
+ Utils::CmdDispatcher(Utils::CMD_CONTAINER, hwndDlg, LOWORD(wParam), wParam, lParam, 0, pContainer);
}
if (pContainer->dwFlags != dwOldFlags)
SendMessage(hwndDlg, DM_CONFIGURECONTAINER, 0, 0);
- break;
}
- case WM_ENTERSIZEMOVE: {
+ break;
+
+ case WM_ENTERSIZEMOVE:
+ {
RECT rc;
SIZE sz;
- GetClientRect(GetDlgItem(hwndDlg, IDC_MSGTABS), &rc);
+ GetClientRect( GetDlgItem(hwndDlg, IDC_MSGTABS), &rc);
sz.cx = rc.right - rc.left;
sz.cy = rc.bottom - rc.top;
pContainer->oldSize = sz;
pContainer->bSizingLoop = TRUE;
- break;
}
- case WM_EXITSIZEMOVE: {
+ break;
+
+ case WM_EXITSIZEMOVE:
+ {
RECT rc;
- GetClientRect(GetDlgItem(hwndDlg, IDC_MSGTABS), &rc);
+ GetClientRect( GetDlgItem(hwndDlg, IDC_MSGTABS), &rc);
if (!((rc.right - rc.left) == pContainer->oldSize.cx && (rc.bottom - rc.top) == pContainer->oldSize.cy)) {
TWindowData *dat = (TWindowData *)GetWindowLongPtr(pContainer->hwndActive, GWLP_USERDATA);
DM_ScrollToBottom(dat, 0, 0);
SendMessage(pContainer->hwndActive, WM_SIZE, 0, 0);
}
pContainer->bSizingLoop = FALSE;
- break;
}
+ break;
/*
- * determine minimum and maximum size limits
- * 1) for maximizing the window when the "vertical maximize" option is set
- * 2) to limit the minimum height when manually resizing the window
- * (this avoids overlapping of controls inside the window and ensures
- * that at least 2 lines of the message log are always visible).
- */
- case WM_GETMINMAXINFO: {
+ * determine minimum and maximum size limits
+ * 1) for maximizing the window when the "vertical maximize" option is set
+ * 2) to limit the minimum height when manually resizing the window
+ * (this avoids overlapping of controls inside the window and ensures
+ * that at least 2 lines of the message log are always visible).
+ */
+ case WM_GETMINMAXINFO:
+ {
RECT rc, rcWindow, rcClient = {0};
POINT pt;
MINMAXINFO *mmi = (MINMAXINFO *) lParam;
mmi->ptMinTrackSize.x = 275;
mmi->ptMinTrackSize.y = 130;
- GetClientRect(GetDlgItem(hwndDlg, IDC_MSGTABS), &rc);
+ GetClientRect( GetDlgItem(hwndDlg, IDC_MSGTABS), &rc);
if (pContainer->hwndActive) // at container creation time, there is no hwndActive yet..
GetClientRect(pContainer->hwndActive, &rcClient);
GetWindowRect(hwndDlg, &rcWindow);
pt.y = rc.top;
- TabCtrl_AdjustRect(GetDlgItem(hwndDlg, IDC_MSGTABS), FALSE, &rc);
+ TabCtrl_AdjustRect( GetDlgItem(hwndDlg, IDC_MSGTABS), FALSE, &rc);
/*
- * uChildMinHeight holds the min height for the client window only
- * so let's add the container's vertical padding (title bar, tab bar,
- * window border, status bar) to this value
- */
+ * uChildMinHeight holds the min height for the client window only
+ * so let's add the container's vertical padding (title bar, tab bar,
+ * window border, status bar) to this value
+ */
if (pContainer->hwndActive)
mmi->ptMinTrackSize.y = pContainer->uChildMinHeight + (pContainer->hwndActive ? ((rcWindow.bottom - rcWindow.top) - rcClient.bottom) : 0);
@@ -1305,8 +1203,8 @@ buttons_done:
}
/*
- * protect against invalid values...
- */
+ * protect against invalid values...
+ */
if (mmi->ptMinTrackSize.y < 50 || mmi->ptMinTrackSize.y > rcDesktop.bottom)
mmi->ptMinTrackSize.y = 130;
@@ -1319,21 +1217,24 @@ buttons_done:
}
}
}
- return 0;
}
- case WM_MOVE:
- if (PluginConfig.m_MathModAvail) {
- TMathWindowInfo mathWndInfo;
- RECT windRect;
- GetWindowRect(hwndDlg, &windRect);
- mathWndInfo.top = windRect.top;
- mathWndInfo.left = windRect.left;
- mathWndInfo.right = windRect.right;
- mathWndInfo.bottom = windRect.bottom;
- CallService(MTH_RESIZE, 0, (LPARAM) &mathWndInfo);
- }
- break;
- case DM_UPDATETITLE: {
+ return 0;
+
+ case WM_MOVE:
+ if (PluginConfig.m_MathModAvail) {
+ TMathWindowInfo mathWndInfo;
+ RECT windRect;
+ GetWindowRect(hwndDlg, &windRect);
+ mathWndInfo.top = windRect.top;
+ mathWndInfo.left = windRect.left;
+ mathWndInfo.right = windRect.right;
+ mathWndInfo.bottom = windRect.bottom;
+ CallService(MTH_RESIZE, 0, (LPARAM) &mathWndInfo);
+ }
+ break;
+
+ case DM_UPDATETITLE:
+ {
HANDLE hContact = 0;
const TCHAR *szNewTitle = NULL;
TWindowData *dat = NULL;
@@ -1341,12 +1242,12 @@ buttons_done:
if (lParam) { // lParam != 0 means sent by a chat window
TCHAR szText[512];
dat = (struct TWindowData *)GetWindowLongPtr((HWND)wParam, GWLP_USERDATA);
- GetWindowText((HWND)wParam, szText, SIZEOF(szText));
- szText[SIZEOF(szText)-1] = 0;
- SetWindowText(hwndDlg, szText);
- if (dat)
- SendMessage(hwndDlg, DM_SETICON, (WPARAM)dat, (LPARAM)(dat->hTabIcon != dat->hTabStatusIcon ? dat->hTabIcon : dat->hTabStatusIcon));
- return 0;
+ GetWindowText((HWND)wParam, szText, SIZEOF(szText));
+ szText[SIZEOF(szText)-1] = 0;
+ SetWindowText(hwndDlg, szText);
+ if (dat)
+ SendMessage(hwndDlg, DM_SETICON, (WPARAM)dat, (LPARAM)(dat->hTabIcon != dat->hTabStatusIcon ? dat->hTabIcon : dat->hTabStatusIcon));
+ return 0;
}
if (wParam == 0) { // no hContact given - obtain the hContact for the active tab
if (pContainer->hwndActive && IsWindow(pContainer->hwndActive))
@@ -1376,203 +1277,175 @@ buttons_done:
free((void*)szNewTitle);
}
}
- return 0;
}
+ return 0;
+ case WM_TIMER:
+ if (wParam == TIMERID_HEARTBEAT) {
+ if (GetForegroundWindow() != hwndDlg && (pContainer->settings->autoCloseSeconds > 0) && !pContainer->fHidden) {
+ BOOL fResult = TRUE;
+ BroadCastContainer(pContainer, DM_CHECKAUTOHIDE, (WPARAM)pContainer->settings->autoCloseSeconds, (LPARAM)&fResult);
- case WM_TIMER:
- if (wParam == TIMERID_HEARTBEAT) {
- /*
- int i;
- TCITEM item = {0};
- DWORD dwTimeout;
- */
- struct TWindowData *dat = 0;
- /*
- item.mask = TCIF_PARAM;
- if ((dwTimeout = PluginConfig.m_TabAutoClose) > 0) {
- int clients = TabCtrl_GetItemCount(GetDlgItem(hwndDlg, IDC_MSGTABS));
- HWND *hwndClients = (HWND *)mir_alloc(sizeof(HWND) * (clients + 1));
- for (i=0; i < clients; i++) {
- TabCtrl_GetItem(hwndTab, i, &item);
- hwndClients[i] = (HWND)item.lParam;
- }
- for (i=0; i < clients; i++) {
- if (IsWindow(hwndClients[i])) {
- if ((HWND)hwndClients[i] != pContainer->hwndActive)
- pContainer->bDontSmartClose = TRUE;
- SendMessage((HWND)hwndClients[i], DM_CHECKAUTOCLOSE, (WPARAM)(dwTimeout * 60), 0);
- pContainer->bDontSmartClose = FALSE;
- }
- }
- mir_free(hwndClients);
- }
- */
- if (GetForegroundWindow() != hwndDlg && (pContainer->settings->autoCloseSeconds > 0) && !pContainer->fHidden) {
- BOOL fResult = TRUE;
- BroadCastContainer(pContainer, DM_CHECKAUTOHIDE, (WPARAM)pContainer->settings->autoCloseSeconds, (LPARAM)&fResult);
-
- if (fResult && 0 == pContainer->hWndOptions)
- PostMessage(hwndDlg, WM_CLOSE, 1, 0);
- }
- dat = (TWindowData *)GetWindowLongPtr(pContainer->hwndActive, GWLP_USERDATA);
- if (dat && dat->bType == SESSIONTYPE_IM) {
- if (dat->idle && pContainer->hwndActive && IsWindow(pContainer->hwndActive))
- dat->Panel->Invalidate(TRUE);
- }
- else if (dat)
- SendMessage(dat->hwnd, GC_UPDATESTATUSBAR, 0, 0);
+ if (fResult && 0 == pContainer->hWndOptions)
+ PostMessage(hwndDlg, WM_CLOSE, 1, 0);
}
- else if (wParam == TIMERID_HOVER) {
- RECT rcWindow;
- GetWindowRect(hwndDlg, &rcWindow);
+ TWindowData *dat = (TWindowData *)GetWindowLongPtr(pContainer->hwndActive, GWLP_USERDATA);
+ if (dat && dat->bType == SESSIONTYPE_IM) {
+ if (dat->idle && pContainer->hwndActive && IsWindow(pContainer->hwndActive))
+ dat->Panel->Invalidate(TRUE);
}
- break;
- case WM_SYSCOMMAND:
- switch (wParam) {
- case IDM_STAYONTOP:
- SetWindowPos(hwndDlg, (pContainer->dwFlags & CNT_STICKY) ? HWND_NOTOPMOST : HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
- CheckMenuItem(GetSystemMenu(hwndDlg, FALSE), IDM_STAYONTOP, (pContainer->dwFlags & CNT_STICKY) ? MF_BYCOMMAND | MF_UNCHECKED : MF_BYCOMMAND | MF_CHECKED);
- ApplyContainerSetting(pContainer, CNT_STICKY, pContainer->dwFlags & CNT_STICKY ? 0 : 1, false);
- break;
- case IDM_NOTITLE: {
- pContainer->oldSize.cx = 0;
- pContainer->oldSize.cy = 0;
+ else if (dat)
+ SendMessage(dat->hwnd, GC_UPDATESTATUSBAR, 0, 0);
+ }
+ else if (wParam == TIMERID_HOVER) {
+ RECT rcWindow;
+ GetWindowRect(hwndDlg, &rcWindow);
+ }
+ break;
- CheckMenuItem(GetSystemMenu(hwndDlg, FALSE), IDM_NOTITLE, (pContainer->dwFlags & CNT_NOTITLE) ? MF_BYCOMMAND | MF_UNCHECKED : MF_BYCOMMAND | MF_CHECKED);
- ApplyContainerSetting(pContainer, CNT_NOTITLE, pContainer->dwFlags & CNT_NOTITLE ? 0 : 1, false);
- break;
- }
- case IDM_MOREOPTIONS:
- if (IsIconic(pContainer->hwnd))
- SendMessage(pContainer->hwnd, WM_SYSCOMMAND, SC_RESTORE, 0);
- if (pContainer->hWndOptions == 0)
- CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_CONTAINEROPTIONS), hwndDlg, DlgProcContainerOptions, (LPARAM)pContainer);
- break;
- case SC_MAXIMIZE:
- pContainer->oldSize.cx = pContainer->oldSize.cy = 0;
- break;
- case SC_RESTORE:
- pContainer->oldSize.cx = pContainer->oldSize.cy = 0;
- memset((void*)&pContainer->mOld, -1000, sizeof(MARGINS));
- break;
- case SC_MINIMIZE: {
- TWindowData* dat = reinterpret_cast<TWindowData *>(GetWindowLongPtr(pContainer->hwndActive, GWLP_USERDATA));
- if (dat) {
- //GetWindowRect(GetDlgItem(pContainer->hwndActive, dat->bType == SESSIONTYPE_IM ? IDC_LOG : IDC_CHAT_LOG), &pContainer->rcLogSaved);
- GetWindowRect(pContainer->hwndActive, &pContainer->rcLogSaved);
- pContainer->ptLogSaved.x = pContainer->rcLogSaved.left;
- pContainer->ptLogSaved.y = pContainer->rcLogSaved.top;
- ScreenToClient(hwndDlg, &pContainer->ptLogSaved);
- }
- break;
- }
- }
+ case WM_SYSCOMMAND:
+ switch (wParam) {
+ case IDM_STAYONTOP:
+ SetWindowPos(hwndDlg, (pContainer->dwFlags & CNT_STICKY) ? HWND_NOTOPMOST : HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
+ CheckMenuItem(GetSystemMenu(hwndDlg, FALSE), IDM_STAYONTOP, (pContainer->dwFlags & CNT_STICKY) ? MF_BYCOMMAND | MF_UNCHECKED : MF_BYCOMMAND | MF_CHECKED);
+ ApplyContainerSetting(pContainer, CNT_STICKY, pContainer->dwFlags & CNT_STICKY ? 0 : 1, false);
break;
- case DM_SELECTTAB: {
- switch (wParam) {
- int iItems, iCurrent, iNewTab;
- TCITEM item;
- case DM_SELECT_BY_HWND:
- ActivateTabFromHWND(hwndTab, (HWND) lParam);
- break;
- case DM_SELECT_NEXT:
- case DM_SELECT_PREV:
- case DM_SELECT_BY_INDEX:
- iItems = TabCtrl_GetItemCount(hwndTab);
- iCurrent = TabCtrl_GetCurSel(hwndTab);
+ case IDM_NOTITLE:
+ pContainer->oldSize.cx = 0;
+ pContainer->oldSize.cy = 0;
- if (iItems == 1)
- break;
- if (wParam == DM_SELECT_PREV)
- iNewTab = iCurrent ? iCurrent - 1 : iItems - 1; // cycle if current is already the leftmost tab..
- else if (wParam == DM_SELECT_NEXT)
- iNewTab = (iCurrent == (iItems - 1)) ? 0 : iCurrent + 1;
- else if (wParam == DM_SELECT_BY_INDEX) {
- if ((int)lParam > iItems)
- break;
- iNewTab = lParam - 1;
- }
+ CheckMenuItem(GetSystemMenu(hwndDlg, FALSE), IDM_NOTITLE, (pContainer->dwFlags & CNT_NOTITLE) ? MF_BYCOMMAND | MF_UNCHECKED : MF_BYCOMMAND | MF_CHECKED);
+ ApplyContainerSetting(pContainer, CNT_NOTITLE, pContainer->dwFlags & CNT_NOTITLE ? 0 : 1, false);
+ break;
- if (iNewTab != iCurrent) {
- struct TabControlData *tabdat = (struct TabControlData *)GetWindowLongPtr(hwndTab, GWLP_USERDATA);
- ZeroMemory((void*)&item, sizeof(item));
- item.mask = TCIF_PARAM;
- if (TabCtrl_GetItem(hwndTab, iNewTab, &item)) {
- TabCtrl_SetCurSel(hwndTab, iNewTab);
- ShowWindow(pContainer->hwndActive, SW_HIDE);
- pContainer->hwndActive = (HWND) item.lParam;
- ShowWindow((HWND)item.lParam, SW_SHOW);
- SetFocus(pContainer->hwndActive);
- }
- }
- break;
- }
+ case IDM_MOREOPTIONS:
+ if (IsIconic(pContainer->hwnd))
+ SendMessage(pContainer->hwnd, WM_SYSCOMMAND, SC_RESTORE, 0);
+ if (pContainer->hWndOptions == 0)
+ CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_CONTAINEROPTIONS), hwndDlg, DlgProcContainerOptions, (LPARAM)pContainer);
break;
- }
- case WM_INITMENUPOPUP:
- pContainer->MenuBar->setActive(reinterpret_cast<HMENU>(wParam));
+
+ case SC_MAXIMIZE:
+ pContainer->oldSize.cx = pContainer->oldSize.cy = 0;
break;
- case WM_LBUTTONDOWN: {
- POINT pt;
+ case SC_RESTORE:
+ pContainer->oldSize.cx = pContainer->oldSize.cy = 0;
+ memset((void*)&pContainer->mOld, -1000, sizeof(MARGINS));
+ break;
- if (pContainer->dwFlags & CNT_NOTITLE) {
- GetCursorPos(&pt);
- return SendMessage(hwndDlg, WM_SYSCOMMAND, SC_MOVE | HTCAPTION, MAKELPARAM(pt.x, pt.y));
+ case SC_MINIMIZE:
+ TWindowData* dat = reinterpret_cast<TWindowData *>(GetWindowLongPtr(pContainer->hwndActive, GWLP_USERDATA));
+ if (dat) {
+ //GetWindowRect( GetDlgItem(pContainer->hwndActive, dat->bType == SESSIONTYPE_IM ? IDC_LOG : IDC_CHAT_LOG), &pContainer->rcLogSaved);
+ GetWindowRect(pContainer->hwndActive, &pContainer->rcLogSaved);
+ pContainer->ptLogSaved.x = pContainer->rcLogSaved.left;
+ pContainer->ptLogSaved.y = pContainer->rcLogSaved.top;
+ ScreenToClient(hwndDlg, &pContainer->ptLogSaved);
}
- break;
}
- /*
- * pass the WM_ACTIVATE msg to the active message dialog child
- */
+ break;
- case WM_NCACTIVATE:
- if (IsWindowVisible(hwndDlg))
- pContainer->fHidden = false;
+ case DM_SELECTTAB:
+ switch (wParam) {
+ int iItems, iCurrent, iNewTab;
+ TCITEM item;
+
+ case DM_SELECT_BY_HWND:
+ ActivateTabFromHWND(hwndTab, (HWND) lParam);
break;
- case WM_ACTIVATE:
- if (pContainer == NULL)
- break;
+ case DM_SELECT_NEXT:
+ case DM_SELECT_PREV:
+ case DM_SELECT_BY_INDEX:
+ iItems = TabCtrl_GetItemCount(hwndTab);
+ iCurrent = TabCtrl_GetCurSel(hwndTab);
- if (LOWORD(wParam == WA_INACTIVE)) {
- BroadCastContainer(pContainer, DM_CHECKINFOTIP, wParam, lParam);
- if (PluginConfig.m_MathModAvail)
- CallService(MTH_HIDE, 0, 0);
+ if (iItems == 1)
+ break;
+ if (wParam == DM_SELECT_PREV)
+ iNewTab = iCurrent ? iCurrent - 1 : iItems - 1; // cycle if current is already the leftmost tab..
+ else if (wParam == DM_SELECT_NEXT)
+ iNewTab = (iCurrent == (iItems - 1)) ? 0 : iCurrent + 1;
+ else if (wParam == DM_SELECT_BY_INDEX) {
+ if ((int)lParam > iItems)
+ break;
+ iNewTab = lParam - 1;
}
- if (LOWORD(wParam == WA_INACTIVE) && (HWND)lParam != PluginConfig.g_hwndHotkeyHandler && GetParent((HWND)lParam) != hwndDlg) {
- BOOL fTransAllowed = !bSkinned || PluginConfig.m_bIsVista;
-
- if (pContainer->dwFlags & CNT_TRANSPARENCY && CMimAPI::m_pSetLayeredWindowAttributes != NULL && fTransAllowed) {
- CMimAPI::m_pSetLayeredWindowAttributes(hwndDlg, Skin->getColorKey(), (BYTE)HIWORD(pContainer->settings->dwTransparency), (pContainer->dwFlags & CNT_TRANSPARENCY ? LWA_ALPHA : 0));
+ if (iNewTab != iCurrent) {
+ struct TabControlData *tabdat = (struct TabControlData *)GetWindowLongPtr(hwndTab, GWLP_USERDATA);
+ ZeroMemory((void*)&item, sizeof(item));
+ item.mask = TCIF_PARAM;
+ if (TabCtrl_GetItem(hwndTab, iNewTab, &item)) {
+ TabCtrl_SetCurSel(hwndTab, iNewTab);
+ ShowWindow(pContainer->hwndActive, SW_HIDE);
+ pContainer->hwndActive = (HWND) item.lParam;
+ ShowWindow((HWND)item.lParam, SW_SHOW);
+ SetFocus(pContainer->hwndActive);
}
}
- pContainer->hwndSaved = 0;
+ }
+ break;
- if (LOWORD(wParam) != WA_ACTIVE) {
- pContainer->MenuBar->Cancel();
- break;
+ case WM_INITMENUPOPUP:
+ pContainer->MenuBar->setActive(reinterpret_cast<HMENU>(wParam));
+ break;
+
+ case WM_LBUTTONDOWN:
+ if (pContainer->dwFlags & CNT_NOTITLE) {
+ POINT pt;
+ GetCursorPos(&pt);
+ return SendMessage(hwndDlg, WM_SYSCOMMAND, SC_MOVE | HTCAPTION, MAKELPARAM(pt.x, pt.y));
+ }
+ break;
+
+ /*
+ * pass the WM_ACTIVATE msg to the active message dialog child
+ */
+ case WM_NCACTIVATE:
+ if (IsWindowVisible(hwndDlg))
+ pContainer->fHidden = false;
+ break;
+
+ case WM_ACTIVATE:
+ if (pContainer == NULL)
+ break;
+
+ if (LOWORD(wParam == WA_INACTIVE)) {
+ BroadCastContainer(pContainer, DM_CHECKINFOTIP, wParam, lParam);
+ if (PluginConfig.m_MathModAvail)
+ CallService(MTH_HIDE, 0, 0);
+ }
+
+ if (LOWORD(wParam == WA_INACTIVE) && (HWND)lParam != PluginConfig.g_hwndHotkeyHandler && GetParent((HWND)lParam) != hwndDlg) {
+ BOOL fTransAllowed = !bSkinned || PluginConfig.m_bIsVista;
+
+ if (pContainer->dwFlags & CNT_TRANSPARENCY && CMimAPI::m_pSetLayeredWindowAttributes != NULL && fTransAllowed) {
+ CMimAPI::m_pSetLayeredWindowAttributes(hwndDlg, Skin->getColorKey(), (BYTE)HIWORD(pContainer->settings->dwTransparency), (pContainer->dwFlags & CNT_TRANSPARENCY ? LWA_ALPHA : 0));
}
- case WM_MOUSEACTIVATE: {
- TCITEM item;
+ }
+ pContainer->hwndSaved = 0;
+
+ if (LOWORD(wParam) != WA_ACTIVE) {
+ pContainer->MenuBar->Cancel();
+ break;
+ }
+
+ case WM_MOUSEACTIVATE:
+ if (pContainer) {
int curItem = 0;
BOOL fTransAllowed = !bSkinned || PluginConfig.m_WinVerMajor >= 6;
- if (pContainer == NULL)
- break;
-
FlashContainer(pContainer, 0, 0);
pContainer->dwFlashingStarted = 0;
pLastActiveContainer = pContainer;
if (pContainer->dwFlags & CNT_DEFERREDTABSELECT) {
- NMHDR nmhdr;
-
pContainer->dwFlags &= ~CNT_DEFERREDTABSELECT;
SendMessage(hwndDlg, WM_SYSCOMMAND, SC_RESTORE, 0);
- ZeroMemory((void*)&nmhdr, sizeof(nmhdr));
+
+ NMHDR nmhdr = { 0 };
nmhdr.code = TCN_SELCHANGE;
nmhdr.hwndFrom = hwndTab;
nmhdr.idFrom = IDC_MSGTABS;
@@ -1596,7 +1469,8 @@ buttons_done:
SendMessage(hwndDlg, DM_UPDATETITLE, (WPARAM)hContact, 0);
}
}
- ZeroMemory((void*)&item, sizeof(item));
+
+ TCITEM item = { 0 };
item.mask = TCIF_PARAM;
if ((curItem = TabCtrl_GetCurSel(hwndTab)) >= 0)
TabCtrl_GetItem(hwndTab, curItem, &item);
@@ -1613,18 +1487,19 @@ buttons_done:
}
else if (curItem >= 0)
SendMessage((HWND) item.lParam, WM_ACTIVATE, WA_ACTIVE, 0);
- break;
}
- case DM_CLOSETABATMOUSE: {
- HWND hwndCurrent;
+ break;
+
+ case DM_CLOSETABATMOUSE:
+ {
POINT *pt = (POINT *)lParam;
int iItem;
- TCITEM item = {0};
- hwndCurrent = pContainer->hwndActive;
+ HWND hwndCurrent = pContainer->hwndActive;
if ((iItem = GetTabItemFromMouse(hwndTab, pt)) == -1)
break;
- ZeroMemory((void*)&item, sizeof(item));
+
+ TCITEM item = {0};
item.mask = TCIF_PARAM;
TabCtrl_GetItem(hwndTab, iItem, &item);
if (item.lParam) {
@@ -1637,9 +1512,11 @@ buttons_done:
else
SendMessage((HWND) item.lParam, WM_CLOSE, 0, 1);
}
- break;
}
- case WM_PAINT: {
+ break;
+
+ case WM_PAINT:
+ {
bool fAero = M->isAero();
if (bSkinned || fAero) {
@@ -1648,15 +1525,13 @@ buttons_done:
EndPaint(hwndDlg, &ps);
return 0;
}
- break;
}
- case WM_ERASEBKGND: {
- /*
- * avoid flickering of the menu bar when aero is active
- */
- if (!pContainer)
- break;
-
+ break;
+ case WM_ERASEBKGND:
+ /*
+ * avoid flickering of the menu bar when aero is active
+ */
+ if (pContainer) {
HDC hdc = (HDC)wParam;
RECT rc;
GetClientRect(hwndDlg, &rc);
@@ -1679,19 +1554,20 @@ buttons_done:
HPEN hPen = ::CreatePen(PS_SOLID, 1, PluginConfig.m_cRichBorders ? PluginConfig.m_cRichBorders : ::GetSysColor(COLOR_3DSHADOW));
HPEN hOldPen = reinterpret_cast<HPEN>(::SelectObject(hdc, hPen));
LONG x = (pContainer->SideBar->getFlags() & CSideBar::SIDEBARORIENTATION_LEFT ? pContainer->SideBar->getWidth() - 2 + pContainer->tBorder_outer_left :
- rc.right - pContainer->SideBar->getWidth() + 1 - pContainer->tBorder_outer_right);
+ rc.right - pContainer->SideBar->getWidth() + 1 - pContainer->tBorder_outer_right);
::MoveToEx(hdc, x, rc.top, 0);
::LineTo(hdc, x, rc.bottom);
::SelectObject(hdc, hOldPen);
::DeleteObject(hPen);
-
}
}
}
SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, 1);
- return TRUE;
}
- case DM_OPTIONSAPPLIED: {
+ return TRUE;
+
+ case DM_OPTIONSAPPLIED:
+ {
char szCname[40];
TCHAR szTitleFormat[200];
TCHAR* szThemeName = NULL;
@@ -1729,24 +1605,27 @@ buttons_done:
mir_sntprintf(pContainer->szRelThemeFile, MAX_PATH, _T("%s"), szThemeName);
DBFreeVariant(&dbv);
}
- else
- pContainer->szAbsThemeFile[0] = pContainer->szRelThemeFile[0] = 0;
+ else pContainer->szAbsThemeFile[0] = pContainer->szRelThemeFile[0] = 0;
pContainer->ltr_templates = pContainer->rtl_templates = 0;
- break;
}
- case DM_STATUSBARCHANGED: {
+ break;
+
+ case DM_STATUSBARCHANGED:
+ SendMessage(hwndDlg, WM_SIZE, 0, 0);
+ {
RECT rc;
- SendMessage(hwndDlg, WM_SIZE, 0, 0);
GetWindowRect(hwndDlg, &rc);
SetWindowPos(hwndDlg, 0, rc.left, rc.top, rc.right - rc.left, (rc.bottom - rc.top) + 1, SWP_NOZORDER | SWP_NOACTIVATE);
SetWindowPos(hwndDlg, 0, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, SWP_NOZORDER | SWP_NOACTIVATE);
RedrawWindow(hwndDlg, NULL, NULL, RDW_INVALIDATE | RDW_FRAME | RDW_ALLCHILDREN);
if (pContainer->hwndStatus != 0 && pContainer->hwndActive != 0)
PostMessage(pContainer->hwndActive, DM_STATUSBARCHANGED, 0, 0);
- return 0;
}
- case DM_CONFIGURECONTAINER: {
+ return 0;
+
+ case DM_CONFIGURECONTAINER:
+ {
DWORD ws, wsold, ex = 0, exold = 0;
HMENU hSysmenu = GetSystemMenu(hwndDlg, FALSE);
HANDLE hContact = 0;
@@ -1757,8 +1636,8 @@ buttons_done:
ws = wsold = GetWindowLongPtr(hwndDlg, GWL_STYLE);
if (!CSkin::m_frameSkins) {
ws = (pContainer->dwFlags & CNT_NOTITLE) ?
- ((IsWindowVisible(hwndDlg) ? WS_VISIBLE : 0) | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_CLIPCHILDREN | WS_THICKFRAME | (CSkin::m_frameSkins ? WS_SYSMENU : WS_SYSMENU | WS_SIZEBOX)) :
- ws | WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN;
+ ((IsWindowVisible(hwndDlg) ? WS_VISIBLE : 0) | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_CLIPCHILDREN | WS_THICKFRAME | (CSkin::m_frameSkins ? WS_SYSMENU : WS_SYSMENU | WS_SIZEBOX)) :
+ ws | WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN;
}
SetWindowLongPtr(hwndDlg, GWL_STYLE, ws);
@@ -1805,18 +1684,18 @@ buttons_done:
}
pContainer->dwFlags = ((pContainer->dwFlagsEx & (TCF_SBARLEFT | TCF_SBARRIGHT)) ?
- pContainer->dwFlags | CNT_SIDEBAR : pContainer->dwFlags & ~CNT_SIDEBAR);
+ pContainer->dwFlags | CNT_SIDEBAR : pContainer->dwFlags & ~CNT_SIDEBAR);
pContainer->SideBar->Init();
- ws = wsold = GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_MSGTABS), GWL_STYLE);
+ ws = wsold = GetWindowLongPtr( GetDlgItem(hwndDlg, IDC_MSGTABS), GWL_STYLE);
if (pContainer->dwFlags & CNT_TABSBOTTOM)
ws |= (TCS_BOTTOM);
else
ws &= ~(TCS_BOTTOM);
if ((ws & (TCS_BOTTOM | TCS_MULTILINE)) != (wsold & (TCS_BOTTOM | TCS_MULTILINE))) {
- SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_MSGTABS), GWL_STYLE, ws);
- RedrawWindow(GetDlgItem(hwndDlg, IDC_MSGTABS), NULL, NULL, RDW_INVALIDATE);
+ SetWindowLongPtr( GetDlgItem(hwndDlg, IDC_MSGTABS), GWL_STYLE, ws);
+ RedrawWindow( GetDlgItem(hwndDlg, IDC_MSGTABS), NULL, NULL, RDW_INVALIDATE);
}
if (pContainer->dwFlags & CNT_NOSTATUSBAR) {
@@ -1841,14 +1720,16 @@ buttons_done:
}
SendMessage(hwndDlg, WM_SIZE, 0, 1);
BroadCastContainer(pContainer, DM_CONFIGURETOOLBAR, 0, 1);
- return 0;
}
+ return 0;
+
/*
- * search the first and most recent unread events in all client tabs...
- * return all information via a RECENTINFO structure (tab indices,
- * window handles and timestamps).
- */
- case DM_QUERYRECENT: {
+ * search the first and most recent unread events in all client tabs...
+ * return all information via a RECENTINFO structure (tab indices,
+ * window handles and timestamps).
+ */
+ case DM_QUERYRECENT:
+ {
int i;
int iItems = TabCtrl_GetItemCount(hwndTab);
RECENTINFO *ri = (RECENTINFO *)lParam;
@@ -1875,12 +1756,13 @@ buttons_done:
}
}
}
- return 0;
}
- /*
- * search tab with either next or most recent unread message and select it
- */
- case DM_QUERYPENDING: {
+ return 0;
+ /*
+ * search tab with either next or most recent unread message and select it
+ */
+ case DM_QUERYPENDING:
+ {
NMHDR nmhdr;
RECENTINFO ri;
@@ -1895,10 +1777,11 @@ buttons_done:
TabCtrl_SetCurSel(hwndTab, ri.iMostRecent);
SendMessage(hwndDlg, WM_NOTIFY, 0, (LPARAM) &nmhdr);
}
- return 0;
}
+ return 0;
- case DM_SETICON: {
+ case DM_SETICON:
+ {
HICON hIconMsg = PluginConfig.g_IconMsgEvent;
TWindowData* dat = (TWindowData *)wParam;
HICON hIconBig = (dat && dat->cache) ? LoadSkinnedProtoIconBig(dat->cache->getActiveProto(), dat->cache->getActiveStatus()) : 0;
@@ -1946,8 +1829,8 @@ buttons_done:
}
}
/*
- * default handling (no win7 taskbar)
- */
+ * default handling (no win7 taskbar)
+ */
if ((HICON)lParam == PluginConfig.g_buttonBarIcons[ICON_DEFAULT_TYPING]) { // always set typing icon, but don't save it...
SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)PluginConfig.g_IconTypingEventBig);
SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, lParam);
@@ -1964,26 +1847,29 @@ buttons_done:
if (0 != hIconBig && reinterpret_cast<HICON>(CALLSERVICE_NOTFOUND) != hIconBig)
SendMessage(hwndDlg, WM_SETICON, ICON_BIG, reinterpret_cast<LPARAM>(hIconBig));
pContainer->hIcon = (lParam == (LPARAM)hIconMsg) ? STICK_ICON_MSG : 0;
- return 0;
}
- case WM_DRAWITEM: {
+ return 0;
+
+ case WM_DRAWITEM:
+ {
int cx = PluginConfig.m_smcxicon;
int cy = PluginConfig.m_smcyicon;
- DRAWITEMSTRUCT *dis = (DRAWITEMSTRUCT *)lParam;
- int id = LOWORD(dis->itemID);
+ DRAWITEMSTRUCT *dis = (DRAWITEMSTRUCT *)lParam;
if (dis->hwndItem == pContainer->hwndStatus && !(pContainer->dwFlags & CNT_NOSTATUSBAR)) {
struct TWindowData *dat = (struct TWindowData *)GetWindowLongPtr(pContainer->hwndActive, GWLP_USERDATA);
if (dat)
DrawStatusIcons(dat, dis->hDC, dis->rcItem, 2);
return TRUE;
}
- return CallService(MS_CLIST_MENUDRAWITEM, wParam, lParam);
- }
- case WM_MEASUREITEM: {
- return CallService(MS_CLIST_MENUMEASUREITEM, wParam, lParam);
}
- case DM_QUERYCLIENTAREA: {
+ return CallService(MS_CLIST_MENUDRAWITEM, wParam, lParam);
+
+ case WM_MEASUREITEM:
+ return CallService(MS_CLIST_MENUMEASUREITEM, wParam, lParam);
+
+ case DM_QUERYCLIENTAREA:
+ {
RECT *rc = (RECT *)lParam;
if (rc) {
if (!IsIconic(hwndDlg))
@@ -1992,11 +1878,12 @@ buttons_done:
CopyRect(rc, &pContainer->rcSaved);
AdjustTabClientRect(pContainer, rc);
}
- return 0;
}
- case WM_DESTROY: {
+ return 0;
+
+ case WM_DESTROY:
+ {
int i = 0;
- TCITEM item;
SESSION_INFO *node = m_WndList;
if (PluginConfig.g_FlashAvatarAvail) { // destroy own flash avatar
@@ -2007,7 +1894,8 @@ buttons_done:
fa.cProto = dat ? dat->szProto : NULL;
CallService(MS_FAVATAR_DESTROY, (WPARAM)&fa, 0);
}
- ZeroMemory((void*)&item, sizeof(item));
+
+ TCITEM item = { 0 };
pContainer->hwnd = 0;
pContainer->hwndActive = 0;
pContainer->hMenuContext = 0;
@@ -2044,158 +1932,155 @@ buttons_done:
DeleteObject(pContainer->hbmToolbarBG);
DeleteDC(pContainer->cachedToolbarDC);
}
- return 0;
}
+ return 0;
- case WM_NCDESTROY:
- if (pContainer) {
- delete pContainer->MenuBar;
- delete pContainer->SideBar;
- if (pContainer->settings != &PluginConfig.globalContainerSettings)
- free(pContainer->settings);
- free(pContainer);
- }
- SetWindowLongPtr(hwndDlg, GWLP_USERDATA, 0);
- break;
+ case WM_NCDESTROY:
+ if (pContainer) {
+ delete pContainer->MenuBar;
+ delete pContainer->SideBar;
+ if (pContainer->settings != &PluginConfig.globalContainerSettings)
+ free(pContainer->settings);
+ free(pContainer);
+ }
+ SetWindowLongPtr(hwndDlg, GWLP_USERDATA, 0);
+ break;
- case WM_CLOSE: {
- //mad
- if (PluginConfig.m_HideOnClose && !lParam) {
- ShowWindow(hwndDlg, SW_HIDE);
- pContainer->fHidden = true;
- }
- else {
- WINDOWPLACEMENT wp;
- char szCName[40];
- char *szSetting = "CNTW_";
+ case WM_CLOSE:
+ //mad
+ if (PluginConfig.m_HideOnClose && !lParam) {
+ ShowWindow(hwndDlg, SW_HIDE);
+ pContainer->fHidden = true;
+ }
+ else {
+ WINDOWPLACEMENT wp;
+ char szCName[40];
+ char *szSetting = "CNTW_";
- if (TabCtrl_GetItemCount(hwndTab) > 1) {
- LRESULT res = CWarning::show(CWarning::WARN_CLOSEWINDOW, MB_YESNOCANCEL|MB_ICONQUESTION);
- if (IDNO == res || IDCANCEL == res)
- break;
- }
+ if (TabCtrl_GetItemCount(hwndTab) > 1) {
+ LRESULT res = CWarning::show(CWarning::WARN_CLOSEWINDOW, MB_YESNOCANCEL|MB_ICONQUESTION);
+ if (IDNO == res || IDCANCEL == res)
+ break;
+ }
- if (lParam == 0 && TabCtrl_GetItemCount(GetDlgItem(hwndDlg, IDC_MSGTABS)) > 0) { // dont ask if container is empty (no tabs)
- int clients = TabCtrl_GetItemCount(hwndTab), i;
- TCITEM item = {0};
- int iOpenJobs = 0;
+ if (lParam == 0 && TabCtrl_GetItemCount( GetDlgItem(hwndDlg, IDC_MSGTABS)) > 0) { // dont ask if container is empty (no tabs)
+ int clients = TabCtrl_GetItemCount(hwndTab), i;
+ TCITEM item = {0};
+ int iOpenJobs = 0;
- item.mask = TCIF_PARAM;
- for (i=0; i < clients; i++) {
- TabCtrl_GetItem(hwndTab, i, &item);
- if (item.lParam && IsWindow((HWND)item.lParam)) {
- SendMessage((HWND)item.lParam, DM_CHECKQUEUEFORCLOSE, 0, (LPARAM)&iOpenJobs);
- }
+ item.mask = TCIF_PARAM;
+ for (i=0; i < clients; i++) {
+ TabCtrl_GetItem(hwndTab, i, &item);
+ if (item.lParam && IsWindow((HWND)item.lParam)) {
+ SendMessage((HWND)item.lParam, DM_CHECKQUEUEFORCLOSE, 0, (LPARAM)&iOpenJobs);
}
- if (iOpenJobs && pContainer) {
- LRESULT result;
+ }
+ if (iOpenJobs && pContainer) {
+ LRESULT result;
- if (pContainer->exFlags & CNT_EX_CLOSEWARN)
- return TRUE;
+ if (pContainer->exFlags & CNT_EX_CLOSEWARN)
+ return TRUE;
- pContainer->exFlags |= CNT_EX_CLOSEWARN;
- result = SendQueue::WarnPendingJobs(iOpenJobs);
- pContainer->exFlags &= ~CNT_EX_CLOSEWARN;
- if (result == IDNO)
- return TRUE;
- }
+ pContainer->exFlags |= CNT_EX_CLOSEWARN;
+ result = SendQueue::WarnPendingJobs(iOpenJobs);
+ pContainer->exFlags &= ~CNT_EX_CLOSEWARN;
+ if (result == IDNO)
+ return TRUE;
}
+ }
- ZeroMemory((void*)&wp, sizeof(wp));
- wp.length = sizeof(wp);
- /*
- * save geometry information to the database...
- */
- if (!(pContainer->dwFlags & CNT_GLOBALSIZE)) {
- if (GetWindowPlacement(hwndDlg, &wp) != 0) {
- if (pContainer->isCloned && pContainer->hContactFrom != 0) {
- HANDLE hContact;
- int i;
- TCITEM item = {0};
-
- item.mask = TCIF_PARAM;
- TabCtrl_GetItem(hwndTab, TabCtrl_GetCurSel(hwndTab), &item);
- SendMessage((HWND)item.lParam, DM_QUERYHCONTACT, 0, (LPARAM)&hContact);
- M->WriteByte(hContact, SRMSGMOD_T, "splitmax", (BYTE)((wp.showCmd==SW_SHOWMAXIMIZED)?1:0));
-
- for (i=0; i < TabCtrl_GetItemCount(hwndTab); i++) {
- if (TabCtrl_GetItem(hwndTab, i, &item)) {
- SendMessage((HWND)item.lParam, DM_QUERYHCONTACT, 0, (LPARAM)&hContact);
- M->WriteDword(hContact, SRMSGMOD_T, "splitx", wp.rcNormalPosition.left);
- M->WriteDword(hContact, SRMSGMOD_T, "splity", wp.rcNormalPosition.top);
- M->WriteDword(hContact, SRMSGMOD_T, "splitwidth", wp.rcNormalPosition.right - wp.rcNormalPosition.left);
- M->WriteDword(hContact, SRMSGMOD_T, "splitheight", wp.rcNormalPosition.bottom - wp.rcNormalPosition.top);
- }
+ ZeroMemory((void*)&wp, sizeof(wp));
+ wp.length = sizeof(wp);
+ /*
+ * save geometry information to the database...
+ */
+ if (!(pContainer->dwFlags & CNT_GLOBALSIZE)) {
+ if (GetWindowPlacement(hwndDlg, &wp) != 0) {
+ if (pContainer->isCloned && pContainer->hContactFrom != 0) {
+ HANDLE hContact;
+ int i;
+ TCITEM item = {0};
+
+ item.mask = TCIF_PARAM;
+ TabCtrl_GetItem(hwndTab, TabCtrl_GetCurSel(hwndTab), &item);
+ SendMessage((HWND)item.lParam, DM_QUERYHCONTACT, 0, (LPARAM)&hContact);
+ M->WriteByte(hContact, SRMSGMOD_T, "splitmax", (BYTE)((wp.showCmd==SW_SHOWMAXIMIZED)?1:0));
+
+ for (i=0; i < TabCtrl_GetItemCount(hwndTab); i++) {
+ if (TabCtrl_GetItem(hwndTab, i, &item)) {
+ SendMessage((HWND)item.lParam, DM_QUERYHCONTACT, 0, (LPARAM)&hContact);
+ M->WriteDword(hContact, SRMSGMOD_T, "splitx", wp.rcNormalPosition.left);
+ M->WriteDword(hContact, SRMSGMOD_T, "splity", wp.rcNormalPosition.top);
+ M->WriteDword(hContact, SRMSGMOD_T, "splitwidth", wp.rcNormalPosition.right - wp.rcNormalPosition.left);
+ M->WriteDword(hContact, SRMSGMOD_T, "splitheight", wp.rcNormalPosition.bottom - wp.rcNormalPosition.top);
}
}
- else {
- _snprintf(szCName, 40, "%s%dx", szSetting, pContainer->iContainerIndex);
- M->WriteDword(SRMSGMOD_T, szCName, wp.rcNormalPosition.left);
- _snprintf(szCName, 40, "%s%dy", szSetting, pContainer->iContainerIndex);
- M->WriteDword(SRMSGMOD_T, szCName, wp.rcNormalPosition.top);
- _snprintf(szCName, 40, "%s%dwidth", szSetting, pContainer->iContainerIndex);
- M->WriteDword(SRMSGMOD_T, szCName, wp.rcNormalPosition.right - wp.rcNormalPosition.left);
- _snprintf(szCName, 40, "%s%dheight", szSetting, pContainer->iContainerIndex);
- M->WriteDword(SRMSGMOD_T, szCName, wp.rcNormalPosition.bottom - wp.rcNormalPosition.top);
-
- M->WriteByte(SRMSGMOD_T, "splitmax", (BYTE)((wp.showCmd==SW_SHOWMAXIMIZED)?1:0));
- }
+ }
+ else {
+ _snprintf(szCName, 40, "%s%dx", szSetting, pContainer->iContainerIndex);
+ M->WriteDword(SRMSGMOD_T, szCName, wp.rcNormalPosition.left);
+ _snprintf(szCName, 40, "%s%dy", szSetting, pContainer->iContainerIndex);
+ M->WriteDword(SRMSGMOD_T, szCName, wp.rcNormalPosition.top);
+ _snprintf(szCName, 40, "%s%dwidth", szSetting, pContainer->iContainerIndex);
+ M->WriteDword(SRMSGMOD_T, szCName, wp.rcNormalPosition.right - wp.rcNormalPosition.left);
+ _snprintf(szCName, 40, "%s%dheight", szSetting, pContainer->iContainerIndex);
+ M->WriteDword(SRMSGMOD_T, szCName, wp.rcNormalPosition.bottom - wp.rcNormalPosition.top);
+
+ M->WriteByte(SRMSGMOD_T, "splitmax", (BYTE)((wp.showCmd==SW_SHOWMAXIMIZED)?1:0));
}
}
- // clear temp flags which should NEVER be saved...
+ }
+ // clear temp flags which should NEVER be saved...
- if (pContainer->isCloned && pContainer->hContactFrom != 0) {
- HANDLE hContact;
- int i;
- TCITEM item = {0};
+ if (pContainer->isCloned && pContainer->hContactFrom != 0) {
+ HANDLE hContact;
+ int i;
+ TCITEM item = {0};
- item.mask = TCIF_PARAM;
- pContainer->dwFlags &= ~(CNT_DEFERREDCONFIGURE | CNT_CREATE_MINIMIZED | CNT_DEFERREDSIZEREQUEST | CNT_CREATE_CLONED);
- for (i=0; i < TabCtrl_GetItemCount(hwndTab); i++) {
- if (TabCtrl_GetItem(hwndTab, i, &item)) {
- SendMessage((HWND)item.lParam, DM_QUERYHCONTACT, 0, (LPARAM)&hContact);
- //Utils::WriteContainerSettingsToDB(hContact, pContainer->settings);
-
- mir_snprintf(szCName, 40, "%s_theme", szSetting);
- if (lstrlen(pContainer->szRelThemeFile) > 1) {
- if (pContainer->fPrivateThemeChanged == TRUE) {
- M->pathToRelative(pContainer->szRelThemeFile, pContainer->szAbsThemeFile);
- M->WriteTString(hContact, SRMSGMOD_T, szCName, pContainer->szRelThemeFile);
- pContainer->fPrivateThemeChanged = FALSE;
- }
- }
- else {
- DBDeleteContactSetting(hContact, SRMSGMOD_T, szCName);
+ item.mask = TCIF_PARAM;
+ pContainer->dwFlags &= ~(CNT_DEFERREDCONFIGURE | CNT_CREATE_MINIMIZED | CNT_DEFERREDSIZEREQUEST | CNT_CREATE_CLONED);
+ for (i=0; i < TabCtrl_GetItemCount(hwndTab); i++) {
+ if (TabCtrl_GetItem(hwndTab, i, &item)) {
+ SendMessage((HWND)item.lParam, DM_QUERYHCONTACT, 0, (LPARAM)&hContact);
+ //Utils::WriteContainerSettingsToDB(hContact, pContainer->settings);
+
+ mir_snprintf(szCName, 40, "%s_theme", szSetting);
+ if (lstrlen(pContainer->szRelThemeFile) > 1) {
+ if (pContainer->fPrivateThemeChanged == TRUE) {
+ M->pathToRelative(pContainer->szRelThemeFile, pContainer->szAbsThemeFile);
+ M->WriteTString(hContact, SRMSGMOD_T, szCName, pContainer->szRelThemeFile);
pContainer->fPrivateThemeChanged = FALSE;
}
-
}
+ else {
+ DBDeleteContactSetting(hContact, SRMSGMOD_T, szCName);
+ pContainer->fPrivateThemeChanged = FALSE;
+ }
+
}
}
- else
- Utils::SaveContainerSettings(pContainer, szSetting);
- DestroyWindow(hwndDlg);
}
- break;
+ else Utils::SaveContainerSettings(pContainer, szSetting);
+
+ DestroyWindow(hwndDlg);
}
- default:
- return FALSE;
+ break;
}
return FALSE;
}
/*
- * search the list of tabs and return the tab (by index) which "belongs" to the given
- * hwnd. The hwnd is the handle of a message dialog childwindow. At creation,
- * the dialog handle is stored in the TCITEM.lParam field, because we need
- * to know the owner of the tab.
- *
- * hwndTab: handle of the tab control itself.
- * hwnd: handle of a message dialog.
- *
- * returns the tab index (zero based), -1 if no tab is found (which SHOULD not
- * really happen, but who knows... ;))
- */
+* search the list of tabs and return the tab (by index) which "belongs" to the given
+* hwnd. The hwnd is the handle of a message dialog childwindow. At creation,
+* the dialog handle is stored in the TCITEM.lParam field, because we need
+* to know the owner of the tab.
+*
+* hwndTab: handle of the tab control itself.
+* hwnd: handle of a message dialog.
+*
+* returns the tab index (zero based), -1 if no tab is found (which SHOULD not
+* really happen, but who knows... ;))
+*/
int TSAPI GetTabIndexFromHWND(HWND hwndTab, HWND hwnd)
{
diff --git a/plugins/TabSRMM/src/containeroptions.cpp b/plugins/TabSRMM/src/containeroptions.cpp
index 17b7a84fb0..192bfe5ca2 100644
--- a/plugins/TabSRMM/src/containeroptions.cpp
+++ b/plugins/TabSRMM/src/containeroptions.cpp
@@ -354,7 +354,7 @@ INT_PTR CALLBACK DlgProcContainerOptions(HWND hwndDlg, UINT msg, WPARAM wParam,
pContainer->szRelThemeFile[0] = pContainer->szAbsThemeFile[0] = 0;
- if (GetWindowTextLengthA(GetDlgItem(hwndDlg, IDC_THEME)) > 0) {
+ if (GetWindowTextLengthA( GetDlgItem(hwndDlg, IDC_THEME)) > 0) {
wchar_t szFinalThemeFile[MAX_PATH], szFilename[MAX_PATH];
GetDlgItemText(hwndDlg, IDC_THEME, szFilename, MAX_PATH);
diff --git a/plugins/TabSRMM/src/controls.cpp b/plugins/TabSRMM/src/controls.cpp
index 07d0bc117d..353aa29c66 100644
--- a/plugins/TabSRMM/src/controls.cpp
+++ b/plugins/TabSRMM/src/controls.cpp
@@ -507,7 +507,7 @@ void CMenuBar::configureMenu() const
::SendMessage(m_hwndToolbar, TB_SETSTATE, 105, fChat ? TBSTATE_HIDDEN : TBSTATE_ENABLED);
if (dat->bType == SESSIONTYPE_IM)
- ::EnableWindow(GetDlgItem(dat->hwnd, IDC_TIME), fDisable ? FALSE : TRUE);
+ ::EnableWindow( GetDlgItem(dat->hwnd, IDC_TIME), fDisable ? FALSE : TRUE);
}
}
diff --git a/plugins/TabSRMM/src/eventpopups.cpp b/plugins/TabSRMM/src/eventpopups.cpp
index 9a7d8cf45c..aa2fa0aa0e 100644
--- a/plugins/TabSRMM/src/eventpopups.cpp
+++ b/plugins/TabSRMM/src/eventpopups.cpp
@@ -168,7 +168,7 @@ INT_PTR CALLBACK DlgProcPopupOpts(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa
case WM_INITDIALOG: {
TVINSERTSTRUCT tvi = {0};
int i;
- SetWindowLongPtr(GetDlgItem(hWnd, IDC_EVENTOPTIONS), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hWnd, IDC_EVENTOPTIONS), GWL_STYLE) | (TVS_NOHSCROLL | TVS_CHECKBOXES));
+ SetWindowLongPtr( GetDlgItem(hWnd, IDC_EVENTOPTIONS), GWL_STYLE, GetWindowLongPtr( GetDlgItem(hWnd, IDC_EVENTOPTIONS), GWL_STYLE) | (TVS_NOHSCROLL | TVS_CHECKBOXES));
TranslateDialogDefault(hWnd);
HIMAGELIST himl = (HIMAGELIST)SendDlgItemMessage(hWnd, IDC_EVENTOPTIONS, TVM_SETIMAGELIST, TVSIL_STATE, (LPARAM)CreateStateImageList());
ImageList_Destroy(himl);
@@ -195,7 +195,7 @@ INT_PTR CALLBACK DlgProcPopupOpts(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa
tvi.item.pszText = TranslateTS(lGroups[i].szName);
tvi.item.stateMask = TVIS_STATEIMAGEMASK | TVIS_EXPANDED | TVIS_BOLD;
tvi.item.state = INDEXTOSTATEIMAGEMASK(0) | TVIS_EXPANDED | TVIS_BOLD;
- lGroups[i].handle = (LRESULT)TreeView_InsertItem(GetDlgItem(hWnd, IDC_EVENTOPTIONS), &tvi);
+ lGroups[i].handle = (LRESULT)TreeView_InsertItem( GetDlgItem(hWnd, IDC_EVENTOPTIONS), &tvi);
}
TOptionListItem *defaultItems = CTranslator::getTree(CTranslator::TREE_NEN);
@@ -212,7 +212,7 @@ INT_PTR CALLBACK DlgProcPopupOpts(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa
UINT uVal = *((UINT *)defaultItems[i].lParam);
tvi.item.state = INDEXTOSTATEIMAGEMASK(uVal & defaultItems[i].id ? 3 : 2);//2 : 1);
}
- defaultItems[i].handle = (LRESULT)TreeView_InsertItem(GetDlgItem(hWnd, IDC_EVENTOPTIONS), &tvi);
+ defaultItems[i].handle = (LRESULT)TreeView_InsertItem( GetDlgItem(hWnd, IDC_EVENTOPTIONS), &tvi);
}
SendDlgItemMessage(hWnd, IDC_COLBACK_MESSAGE, CPM_SETCOLOUR, 0, options->colBackMsg);
diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp
index 182bfc68ab..717ec19f2f 100644
--- a/plugins/TabSRMM/src/generic_msghandlers.cpp
+++ b/plugins/TabSRMM/src/generic_msghandlers.cpp
@@ -97,7 +97,7 @@ void TSAPI DM_CheckAutoHide(const TWindowData* dat, WPARAM wParam, LPARAM lParam
if (dat && lParam) {
BOOL *fResult = (BOOL *)lParam;
- if (GetWindowTextLengthA(GetDlgItem(dat->hwnd, dat->bType == SESSIONTYPE_IM ? IDC_MESSAGE : IDC_CHAT_MESSAGE)) > 0) {
+ if (GetWindowTextLengthA( GetDlgItem(dat->hwnd, dat->bType == SESSIONTYPE_IM ? IDC_MESSAGE : IDC_CHAT_MESSAGE)) > 0) {
*fResult = FALSE;
return; // text entered in the input area -> prevent autohide/cose
}
@@ -173,7 +173,7 @@ LRESULT TSAPI DM_GenericHotkeysCheck(MSG *message, TWindowData *dat)
DlgProcContainerOptions, (LPARAM)dat->pContainer);
return 1;
case TABSRMM_HK_SEND:
- if (!(GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_MESSAGE), GWL_STYLE) & ES_READONLY)) {
+ if (!(GetWindowLongPtr( GetDlgItem(hwndDlg, IDC_MESSAGE), GWL_STYLE) & ES_READONLY)) {
PostMessage(hwndDlg, WM_COMMAND, IDOK, 0);
return 1;
}
@@ -196,7 +196,7 @@ LRESULT TSAPI DM_GenericHotkeysCheck(MSG *message, TWindowData *dat)
SendMessage(hwndDlg, WM_COMMAND, IDC_TOGGLESIDEBAR, 0);
return 1;
case TABSRMM_HK_CLOSE_OTHER:
- CloseOtherTabs(GetDlgItem(dat->pContainer->hwnd, IDC_MSGTABS), *dat);
+ CloseOtherTabs( GetDlgItem(dat->pContainer->hwnd, IDC_MSGTABS), *dat);
return 1;
default:
break;
@@ -207,6 +207,7 @@ LRESULT TSAPI DM_GenericHotkeysCheck(MSG *message, TWindowData *dat)
LRESULT TSAPI DM_MsgWindowCmdHandler(HWND hwndDlg, TContainerData *m_pContainer, TWindowData *dat, UINT cmd, WPARAM wParam, LPARAM lParam)
{
HWND hwndContainer = m_pContainer->hwnd;
+ int iSelection;
switch(cmd) {
case IDC_FONTBOLD:
@@ -230,13 +231,13 @@ LRESULT TSAPI DM_MsgWindowCmdHandler(HWND hwndDlg, TContainerData *m_pContainer,
isUnderline = (cfOld.dwEffects & CFE_UNDERLINE) && (cfOld.dwMask & CFM_UNDERLINE);
isStrikeout = (cfOld.dwEffects & CFM_STRIKEOUT) && (cfOld.dwMask & CFM_STRIKEOUT);
- if (cmd == IDC_FONTBOLD && !IsWindowEnabled(GetDlgItem(hwndDlg, IDC_FONTBOLD)))
+ if (cmd == IDC_FONTBOLD && !IsWindowEnabled( GetDlgItem(hwndDlg, IDC_FONTBOLD)))
break;
- if (cmd == IDC_FONTITALIC && !IsWindowEnabled(GetDlgItem(hwndDlg, IDC_FONTITALIC)))
+ if (cmd == IDC_FONTITALIC && !IsWindowEnabled( GetDlgItem(hwndDlg, IDC_FONTITALIC)))
break;
- if (cmd == IDC_FONTUNDERLINE && !IsWindowEnabled(GetDlgItem(hwndDlg, IDC_FONTUNDERLINE)))
+ if (cmd == IDC_FONTUNDERLINE && !IsWindowEnabled( GetDlgItem(hwndDlg, IDC_FONTUNDERLINE)))
break;
- if (cmd == IDC_FONTSTRIKEOUT && !IsWindowEnabled(GetDlgItem(hwndDlg, IDC_FONTSTRIKEOUT)))
+ if (cmd == IDC_FONTSTRIKEOUT && !IsWindowEnabled( GetDlgItem(hwndDlg, IDC_FONTSTRIKEOUT)))
break;
if (cmd == IDC_FONTBOLD) {
cf.dwEffects = isBold ? 0 : CFE_BOLD;
@@ -260,16 +261,13 @@ LRESULT TSAPI DM_MsgWindowCmdHandler(HWND hwndDlg, TContainerData *m_pContainer,
}
case IDC_FONTFACE: {
HMENU submenu = GetSubMenu(m_pContainer->hMenuContext, 7);
- RECT rc;
- int iSelection, i;
CHARFORMAT2 cf;
-
- ZeroMemory(&cf, sizeof(CHARFORMAT2));
+ memset(&cf, 0, sizeof(cf));
cf.cbSize = sizeof(CHARFORMAT2);
cf.dwMask = CFM_COLOR;
- cf.dwEffects = 0;
- GetWindowRect(GetDlgItem(hwndDlg, IDC_FONTFACE), &rc);
+ RECT rc;
+ GetWindowRect( GetDlgItem(hwndDlg, IDC_FONTFACE), &rc);
iSelection = TrackPopupMenu(submenu, TPM_RETURNCMD, rc.left, rc.bottom, 0, hwndDlg, NULL);
if (iSelection == ID_FONT_CLEARALLFORMATTING) {
cf.dwMask = CFM_BOLD | CFM_COLOR | CFM_ITALIC | CFM_UNDERLINE | CFM_STRIKEOUT;
@@ -278,16 +276,15 @@ LRESULT TSAPI DM_MsgWindowCmdHandler(HWND hwndDlg, TContainerData *m_pContainer,
break;
}
if (iSelection == ID_FONT_DEFAULTCOLOR) {
- int i = 0;
cf.crTextColor = M->GetDword(FONTMODULE, "Font16Col", 0);
- for (i=0; i < Utils::rtf_ctable_size; i++) {
+ for (int i=0; i < Utils::rtf_ctable_size; i++)
if (Utils::rtf_ctable[i].clr == cf.crTextColor)
cf.crTextColor = RGB(GetRValue(cf.crTextColor), GetGValue(cf.crTextColor), GetBValue(cf.crTextColor) == 0 ? GetBValue(cf.crTextColor) + 1 : GetBValue(cf.crTextColor) - 1);
- }
+
SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf);
break;
}
- for (i=0; i < RTF_CTABLE_DEFSIZE; i++) {
+ for (int i=0; i < RTF_CTABLE_DEFSIZE; i++) {
if (Utils::rtf_ctable[i].menuid == iSelection) {
cf.crTextColor = Utils::rtf_ctable[i].clr;
SendDlgItemMessage(hwndDlg, IDC_MESSAGE, EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf);
@@ -327,7 +324,7 @@ LRESULT TSAPI DM_MsgWindowCmdHandler(HWND hwndDlg, TContainerData *m_pContainer,
SMADD_SHOWSEL3 smaddInfo = {0};
if (lParam == 0)
- GetWindowRect(GetDlgItem(hwndDlg, IDC_SMILEYBTN), &rc);
+ GetWindowRect( GetDlgItem(hwndDlg, IDC_SMILEYBTN), &rc);
else
GetWindowRect((HWND)lParam, &rc);
smaddInfo.cbSize = sizeof(SMADD_SHOWSEL3);
@@ -344,32 +341,29 @@ LRESULT TSAPI DM_MsgWindowCmdHandler(HWND hwndDlg, TContainerData *m_pContainer,
}
}
break;
- case IDC_TIME: {
- RECT rc;
- HMENU submenu = GetSubMenu(m_pContainer->hMenuContext, 2);
- int iSelection, isHandled;
- DWORD dwOldFlags = dat->dwFlags;
- DWORD dwOldEventIsShown = dat->dwFlagsEx;
- MsgWindowUpdateMenu(dat, submenu, MENU_LOGMENU);
+ case IDC_TIME:
+ {
+ RECT rc;
+ HMENU submenu = GetSubMenu(m_pContainer->hMenuContext, 2);
+ MsgWindowUpdateMenu(dat, submenu, MENU_LOGMENU);
- GetWindowRect(GetDlgItem(hwndDlg, IDC_TIME), &rc);
+ GetWindowRect( GetDlgItem(hwndDlg, IDC_TIME), &rc);
+
+ iSelection = TrackPopupMenu(submenu, TPM_RETURNCMD, rc.left, rc.bottom, 0, hwndDlg, NULL);
+ }
+ return MsgWindowMenuHandler(dat, iSelection, MENU_LOGMENU);
- iSelection = TrackPopupMenu(submenu, TPM_RETURNCMD, rc.left, rc.bottom, 0, hwndDlg, NULL);
- isHandled = MsgWindowMenuHandler(dat, iSelection, MENU_LOGMENU);
- return(isHandled);
- }
case IDC_PROTOMENU: {
RECT rc;
HMENU submenu = GetSubMenu(m_pContainer->hMenuContext, 4);
- int iSelection;
int iOldGlobalSendFormat = PluginConfig.m_SendFormat;
if (dat->hContact) {
int iLocalFormat = M->GetDword(dat->hContact, "sendformat", 0);
int iNewLocalFormat = iLocalFormat;
- GetWindowRect(GetDlgItem(hwndDlg, IDC_PROTOCOL), &rc);
+ GetWindowRect( GetDlgItem(hwndDlg, IDC_PROTOCOL), &rc);
CheckMenuItem(submenu, ID_MODE_GLOBAL, MF_BYCOMMAND | (!(dat->dwFlagsEx & MWF_SHOW_SPLITTEROVERRIDE) ? MF_CHECKED : MF_UNCHECKED));
CheckMenuItem(submenu, ID_MODE_PRIVATE, MF_BYCOMMAND | (dat->dwFlagsEx & MWF_SHOW_SPLITTEROVERRIDE ? MF_CHECKED : MF_UNCHECKED));
@@ -446,7 +440,7 @@ LRESULT TSAPI DM_MsgWindowCmdHandler(HWND hwndDlg, TContainerData *m_pContainer,
int iSelection;
HMENU submenu = GetSubMenu(m_pContainer->hMenuContext, 9);
- GetWindowRect(GetDlgItem(hwndDlg, IDC_NAME), &rc);
+ GetWindowRect( GetDlgItem(hwndDlg, IDC_NAME), &rc);
EnableMenuItem(submenu, ID_FAVORITES_ADDCONTACTTOFAVORITES, !dat->cache->isFavorite() ? MF_ENABLED : MF_GRAYED);
EnableMenuItem(submenu, ID_FAVORITES_REMOVECONTACTFROMFAVORITES, !dat->cache->isFavorite() ? MF_GRAYED : MF_ENABLED);
@@ -471,9 +465,8 @@ LRESULT TSAPI DM_MsgWindowCmdHandler(HWND hwndDlg, TContainerData *m_pContainer,
case IDC_SENDMENU: {
RECT rc;
HMENU submenu = GetSubMenu(m_pContainer->hMenuContext, 3);
- int iSelection;
- GetWindowRect(GetDlgItem(hwndDlg, IDOK), &rc);
+ GetWindowRect( GetDlgItem(hwndDlg, IDOK), &rc);
CheckMenuItem(submenu, ID_SENDMENU_SENDTOMULTIPLEUSERS, MF_BYCOMMAND | (dat->sendMode & SMODE_MULTIPLE ? MF_CHECKED : MF_UNCHECKED));
CheckMenuItem(submenu, ID_SENDMENU_SENDDEFAULT, MF_BYCOMMAND | (dat->sendMode == 0 ? MF_CHECKED : MF_UNCHECKED));
CheckMenuItem(submenu, ID_SENDMENU_SENDTOCONTAINER, MF_BYCOMMAND | (dat->sendMode & SMODE_CONTAINER ? MF_CHECKED : MF_UNCHECKED));
@@ -498,8 +491,8 @@ LRESULT TSAPI DM_MsgWindowCmdHandler(HWND hwndDlg, TContainerData *m_pContainer,
if (dat->sendMode & SMODE_MULTIPLE)
HWND hwndClist = DM_CreateClist(dat);
else {
- if (IsWindow(GetDlgItem(hwndDlg, IDC_CLIST)))
- DestroyWindow(GetDlgItem(hwndDlg, IDC_CLIST));
+ if (IsWindow( GetDlgItem(hwndDlg, IDC_CLIST)))
+ DestroyWindow( GetDlgItem(hwndDlg, IDC_CLIST));
}
break;
case ID_SENDMENU_SENDNUDGE:
@@ -531,16 +524,16 @@ LRESULT TSAPI DM_MsgWindowCmdHandler(HWND hwndDlg, TContainerData *m_pContainer,
}
M->WriteByte(dat->hContact, SRMSGMOD_T, "no_ack", (BYTE)(dat->sendMode & SMODE_NOACK ? 1 : 0));
M->WriteByte(dat->hContact, SRMSGMOD_T, "forceansi", (BYTE)(dat->sendMode & SMODE_FORCEANSI ? 1 : 0));
- SetWindowPos(GetDlgItem(hwndDlg, IDC_MESSAGE), 0, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOSIZE | SWP_NOMOVE);
+ SetWindowPos( GetDlgItem(hwndDlg, IDC_MESSAGE), 0, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOSIZE | SWP_NOMOVE);
if (dat->sendMode & SMODE_MULTIPLE || dat->sendMode & SMODE_CONTAINER) {
- SetWindowPos(GetDlgItem(hwndDlg, IDC_MESSAGE), 0, 0, 0, 0, 0, SWP_DRAWFRAME|SWP_FRAMECHANGED|SWP_NOZORDER|
+ SetWindowPos( GetDlgItem(hwndDlg, IDC_MESSAGE), 0, 0, 0, 0, 0, SWP_DRAWFRAME|SWP_FRAMECHANGED|SWP_NOZORDER|
SWP_NOMOVE|SWP_NOSIZE|SWP_NOCOPYBITS);
RedrawWindow(hwndDlg, 0, 0, RDW_INVALIDATE|RDW_ERASE|RDW_UPDATENOW|RDW_ALLCHILDREN);
}
else {
- if (IsWindow(GetDlgItem(hwndDlg, IDC_CLIST)))
- DestroyWindow(GetDlgItem(hwndDlg, IDC_CLIST));
- SetWindowPos(GetDlgItem(hwndDlg, IDC_MESSAGE), 0, 0, 0, 0, 0, SWP_DRAWFRAME|SWP_FRAMECHANGED|SWP_NOZORDER|
+ if (IsWindow( GetDlgItem(hwndDlg, IDC_CLIST)))
+ DestroyWindow( GetDlgItem(hwndDlg, IDC_CLIST));
+ SetWindowPos( GetDlgItem(hwndDlg, IDC_MESSAGE), 0, 0, 0, 0, 0, SWP_DRAWFRAME|SWP_FRAMECHANGED|SWP_NOZORDER|
SWP_NOMOVE|SWP_NOSIZE|SWP_NOCOPYBITS);
RedrawWindow(hwndDlg, 0, 0, RDW_INVALIDATE|RDW_ERASE|RDW_UPDATENOW|RDW_ALLCHILDREN);
}
@@ -561,7 +554,7 @@ LRESULT TSAPI DM_MsgWindowCmdHandler(HWND hwndDlg, TContainerData *m_pContainer,
dat->fEditNotesActive = !dat->fEditNotesActive;
if (dat->fEditNotesActive) {
- int iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_MESSAGE));
+ int iLen = GetWindowTextLength( GetDlgItem(hwndDlg, IDC_MESSAGE));
if (iLen != 0) {
SendMessage(hwndDlg, DM_ACTIVATETOOLTIP, IDC_MESSAGE, (LPARAM)TranslateT("You cannot edit user notes when there are unsent messages"));
dat->fEditNotesActive = false;
@@ -582,7 +575,7 @@ LRESULT TSAPI DM_MsgWindowCmdHandler(HWND hwndDlg, TContainerData *m_pContainer,
}
}
else {
- int iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_MESSAGE));
+ int iLen = GetWindowTextLength( GetDlgItem(hwndDlg, IDC_MESSAGE));
TCHAR *buf = (TCHAR *)mir_alloc((iLen + 2) * sizeof(TCHAR));
GetDlgItemText(hwndDlg, IDC_MESSAGE, buf, iLen + 1);
@@ -595,7 +588,7 @@ LRESULT TSAPI DM_MsgWindowCmdHandler(HWND hwndDlg, TContainerData *m_pContainer,
DM_ScrollToBottom(dat, 0, 1);
}
}
- SetWindowPos(GetDlgItem(hwndDlg, IDC_MESSAGE), 0, 0, 0, 0, 0, SWP_DRAWFRAME|SWP_FRAMECHANGED|SWP_NOZORDER|
+ SetWindowPos( GetDlgItem(hwndDlg, IDC_MESSAGE), 0, 0, 0, 0, 0, SWP_DRAWFRAME|SWP_FRAMECHANGED|SWP_NOZORDER|
SWP_NOMOVE|SWP_NOSIZE|SWP_NOCOPYBITS);
RedrawWindow(hwndDlg, 0, 0, RDW_INVALIDATE|RDW_ERASE|RDW_FRAME|RDW_UPDATENOW|RDW_ALLCHILDREN);
@@ -612,7 +605,7 @@ LRESULT TSAPI DM_MsgWindowCmdHandler(HWND hwndDlg, TContainerData *m_pContainer,
HMENU hMenu = (HMENU) CallService(MS_CLIST_MENUBUILDCONTACT, (WPARAM) dat->hContact, 0);
if (lParam == 0)
- GetWindowRect(GetDlgItem(hwndDlg, IDC_PROTOCOL/*IDC_NAME*/), &rc);
+ GetWindowRect( GetDlgItem(hwndDlg, IDC_PROTOCOL/*IDC_NAME*/), &rc);
else
GetWindowRect((HWND)lParam, &rc);
iSel = TrackPopupMenu(hMenu, TPM_RETURNCMD, rc.left, rc.bottom, 0, hwndDlg, NULL);
@@ -919,51 +912,58 @@ void TSAPI DM_InitRichEdit(TWindowData *dat)
static void BTN_StockAction(ButtonItem *item, HWND hwndDlg, struct TWindowData *dat, HWND hwndBtn)
{
+ int iSelection;
+
if (item->dwStockFlags & SBI_HANDLEBYCLIENT && IsWindow(hwndDlg) && dat)
SendMessage(hwndDlg, WM_COMMAND, MAKELONG(item->uId, BN_CLICKED), (LPARAM)hwndBtn);
else {
switch (item->uId) {
- case IDC_SBAR_CANCEL:
- PostMessage(hwndDlg, WM_COMMAND, MAKELONG(IDC_SAVE, BN_CLICKED), (LPARAM)hwndBtn);
- break;
- case IDC_SBAR_SLIST:
- SendMessage(PluginConfig.g_hwndHotkeyHandler, DM_TRAYICONNOTIFY, 101, WM_LBUTTONUP);
- break;
- case IDC_SBAR_FAVORITES: {
+ case IDC_SBAR_CANCEL:
+ PostMessage(hwndDlg, WM_COMMAND, MAKELONG(IDC_SAVE, BN_CLICKED), (LPARAM)hwndBtn);
+ break;
+
+ case IDC_SBAR_SLIST:
+ SendMessage(PluginConfig.g_hwndHotkeyHandler, DM_TRAYICONNOTIFY, 101, WM_LBUTTONUP);
+ break;
+
+ case IDC_SBAR_FAVORITES:
+ {
POINT pt;
- int iSelection;
GetCursorPos(&pt);
iSelection = TrackPopupMenu(PluginConfig.g_hMenuFavorites, TPM_RETURNCMD, pt.x, pt.y, 0, PluginConfig.g_hwndHotkeyHandler, NULL);
HandleMenuEntryFromhContact(iSelection);
- break;
}
- case IDC_SBAR_RECENT: {
+ break;
+
+ case IDC_SBAR_RECENT:
+ {
POINT pt;
- int iSelection;
GetCursorPos(&pt);
iSelection = TrackPopupMenu(PluginConfig.g_hMenuRecent, TPM_RETURNCMD, pt.x, pt.y, 0, PluginConfig.g_hwndHotkeyHandler, NULL);
HandleMenuEntryFromhContact(iSelection);
- break;
}
- case IDC_SBAR_USERPREFS: {
+ break;
+
+ case IDC_SBAR_USERPREFS:
+ {
HANDLE hContact = 0;
SendMessage(hwndDlg, DM_QUERYHCONTACT, 0, (LPARAM)&hContact);
if (hContact != 0)
CallService(MS_TABMSG_SETUSERPREFS, (WPARAM)hContact, 0);
- break;
}
- case IDC_SBAR_TOGGLEFORMAT: {
- if (dat) {
- if (IsDlgButtonChecked(hwndDlg, IDC_SBAR_TOGGLEFORMAT) == BST_UNCHECKED) {
- dat->SendFormat = 0;
- GetSendFormat(dat, 0);
- } else {
- dat->SendFormat = SENDFORMAT_BBCODE;
- GetSendFormat(dat, 0);
- }
+ break;
+
+ case IDC_SBAR_TOGGLEFORMAT:
+ if (dat) {
+ if (IsDlgButtonChecked(hwndDlg, IDC_SBAR_TOGGLEFORMAT) == BST_UNCHECKED) {
+ dat->SendFormat = 0;
+ GetSendFormat(dat, 0);
+ } else {
+ dat->SendFormat = SENDFORMAT_BBCODE;
+ GetSendFormat(dat, 0);
}
- break;
}
+ break;
}
}
}
@@ -1332,8 +1332,8 @@ LRESULT TSAPI DM_MouseWheelHandler(HWND hwnd, HWND hwndParent, struct TWindowDat
if (PtInRect(&rc, pt))
return 1;
if (mwdat->pContainer->dwFlags & CNT_SIDEBAR) {
- GetWindowRect(GetDlgItem(mwdat->pContainer->hwnd, IDC_SIDEBARUP), &rc);
- GetWindowRect(GetDlgItem(mwdat->pContainer->hwnd, IDC_SIDEBARDOWN), &rc1);
+ GetWindowRect( GetDlgItem(mwdat->pContainer->hwnd, IDC_SIDEBARUP), &rc);
+ GetWindowRect( GetDlgItem(mwdat->pContainer->hwnd, IDC_SIDEBARDOWN), &rc1);
rc.bottom = rc1.bottom;
if (PtInRect(&rc, pt)) {
short amount = (short)(HIWORD(wParam));
@@ -1343,9 +1343,9 @@ LRESULT TSAPI DM_MouseWheelHandler(HWND hwnd, HWND hwndParent, struct TWindowDat
}
if (mwdat->bType == SESSIONTYPE_CHAT) { // scroll nick list by just hovering it
RECT rcNicklist;
- GetWindowRect(GetDlgItem(mwdat->hwnd, IDC_LIST), &rcNicklist);
+ GetWindowRect( GetDlgItem(mwdat->hwnd, IDC_LIST), &rcNicklist);
if (PtInRect(&rcNicklist, pt)) {
- SendMessage(GetDlgItem(mwdat->hwnd, IDC_LIST), WM_MOUSEWHEEL, wParam, lParam);
+ SendMessage( GetDlgItem(mwdat->hwnd, IDC_LIST), WM_MOUSEWHEEL, wParam, lParam);
return 0;
}
}
@@ -1354,7 +1354,7 @@ LRESULT TSAPI DM_MouseWheelHandler(HWND hwnd, HWND hwndParent, struct TWindowDat
else if (mwdat->hwndHPP)
GetWindowRect(mwdat->hwndHPP, &rc);
else
- GetWindowRect(GetDlgItem(hwndParent, uID), &rc);
+ GetWindowRect( GetDlgItem(hwndParent, uID), &rc);
if (PtInRect(&rc, pt)) {
HWND hwnd = (mwdat->hwndIEView || mwdat->hwndHPP) ? mwdat->hwndIWebBrowserControl : GetDlgItem(hwndParent, uID);
short wDirection = (short)HIWORD(wParam);
@@ -1413,16 +1413,16 @@ LRESULT TSAPI DM_ThemeChanged(TWindowData *dat)
if (dat->bType == SESSIONTYPE_IM) {
if (dat->hTheme != 0 || (CSkin::m_skinEnabled && !item_log->IGNORED))
- SetWindowLongPtr(GetDlgItem(hwnd, IDC_LOG), GWL_EXSTYLE, GetWindowLongPtr(GetDlgItem(hwnd, IDC_LOG), GWL_EXSTYLE) & ~WS_EX_STATICEDGE);
+ SetWindowLongPtr( GetDlgItem(hwnd, IDC_LOG), GWL_EXSTYLE, GetWindowLongPtr( GetDlgItem(hwnd, IDC_LOG), GWL_EXSTYLE) & ~WS_EX_STATICEDGE);
if (dat->hTheme != 0 || (CSkin::m_skinEnabled && !item_msg->IGNORED))
- SetWindowLongPtr(GetDlgItem(hwnd, IDC_MESSAGE), GWL_EXSTYLE, GetWindowLongPtr(GetDlgItem(hwnd, IDC_MESSAGE), GWL_EXSTYLE) & ~WS_EX_STATICEDGE);
+ SetWindowLongPtr( GetDlgItem(hwnd, IDC_MESSAGE), GWL_EXSTYLE, GetWindowLongPtr( GetDlgItem(hwnd, IDC_MESSAGE), GWL_EXSTYLE) & ~WS_EX_STATICEDGE);
} else {
if (dat->hTheme != 0 || (CSkin::m_skinEnabled && !item_log->IGNORED)) {
- SetWindowLongPtr(GetDlgItem(hwnd, IDC_CHAT_LOG), GWL_EXSTYLE, GetWindowLongPtr(GetDlgItem(hwnd, IDC_CHAT_LOG), GWL_EXSTYLE) & ~WS_EX_STATICEDGE);
- SetWindowLongPtr(GetDlgItem(hwnd, IDC_LIST), GWL_EXSTYLE, GetWindowLongPtr(GetDlgItem(hwnd, IDC_LIST), GWL_EXSTYLE) & ~(WS_EX_CLIENTEDGE | WS_EX_STATICEDGE));
+ SetWindowLongPtr( GetDlgItem(hwnd, IDC_CHAT_LOG), GWL_EXSTYLE, GetWindowLongPtr( GetDlgItem(hwnd, IDC_CHAT_LOG), GWL_EXSTYLE) & ~WS_EX_STATICEDGE);
+ SetWindowLongPtr( GetDlgItem(hwnd, IDC_LIST), GWL_EXSTYLE, GetWindowLongPtr( GetDlgItem(hwnd, IDC_LIST), GWL_EXSTYLE) & ~(WS_EX_CLIENTEDGE | WS_EX_STATICEDGE));
}
if (dat->hTheme != 0 || (CSkin::m_skinEnabled && !item_msg->IGNORED))
- SetWindowLongPtr(GetDlgItem(hwnd, IDC_CHAT_MESSAGE), GWL_EXSTYLE, GetWindowLongPtr(GetDlgItem(hwnd, IDC_CHAT_MESSAGE), GWL_EXSTYLE) & ~WS_EX_STATICEDGE);
+ SetWindowLongPtr( GetDlgItem(hwnd, IDC_CHAT_MESSAGE), GWL_EXSTYLE, GetWindowLongPtr( GetDlgItem(hwnd, IDC_CHAT_MESSAGE), GWL_EXSTYLE) & ~WS_EX_STATICEDGE);
}
dat->hThemeIP = M->isAero() ? CMimAPI::m_pfnOpenThemeData(hwnd, L"ButtonStyle") : 0;
dat->hThemeToolbar = (M->isAero() || (!CSkin::m_skinEnabled && M->isVSThemed())) ? CMimAPI::m_pfnOpenThemeData(hwnd, L"REBAR") : 0;
@@ -1546,7 +1546,7 @@ void TSAPI DM_OptionsApplied(TWindowData *dat, WPARAM wParam, LPARAM lParam)
DM_InitRichEdit(dat);
if (hwndDlg == m_pContainer->hwndActive)
SendMessage(m_pContainer->hwnd, WM_SIZE, 0, 0);
- InvalidateRect(GetDlgItem(hwndDlg, IDC_MESSAGE), NULL, FALSE);
+ InvalidateRect( GetDlgItem(hwndDlg, IDC_MESSAGE), NULL, FALSE);
if (!lParam)
SendMessage(hwndDlg, DM_REMAKELOG, 0, 0);
@@ -1822,7 +1822,7 @@ void TSAPI DM_EventAdded(TWindowData *dat, WPARAM wParam, LPARAM lParam)
mir_sntprintf(szBuf, SIZEOF(szBuf), TranslateT("Autoscrolling is disabled, %d message(s) queued (press F12 to enable it)"),
dat->iNextQueuedEvent);
SetDlgItemText(hwndDlg, IDC_LOGFROZENTEXT, szBuf);
- RedrawWindow(GetDlgItem(hwndDlg, IDC_LOGFROZENTEXT), NULL, NULL, RDW_INVALIDATE);
+ RedrawWindow( GetDlgItem(hwndDlg, IDC_LOGFROZENTEXT), NULL, NULL, RDW_INVALIDATE);
}
} else
SendMessage(hwndDlg, DM_REMAKELOG, 0, 0);
@@ -2002,7 +2002,7 @@ void TSAPI DM_UpdateTitle(TWindowData *dat, WPARAM wParam, LPARAM lParam)
TranslateT("UID: %s (SHIFT click -> copy to clipboard)\nClick for User's Details\nClick dropdown to change this contact's favorite status."),
iHasName ? dat->cache->getUIN() : TranslateT("No UID"));
- SendMessage(GetDlgItem(hwndDlg, IDC_NAME), BUTTONADDTOOLTIP, /*iHasName ?*/ (WPARAM)fulluin /*: (WPARAM)_T("")*/, 0);
+ SendMessage( GetDlgItem(hwndDlg, IDC_NAME), BUTTONADDTOOLTIP, /*iHasName ?*/ (WPARAM)fulluin /*: (WPARAM)_T("")*/, 0);
}
} else
lstrcpyn(newtitle, pszNewTitleEnd, SIZEOF(newtitle));
diff --git a/plugins/TabSRMM/src/globals.cpp b/plugins/TabSRMM/src/globals.cpp
index f358f550bd..fbaf192413 100644
--- a/plugins/TabSRMM/src/globals.cpp
+++ b/plugins/TabSRMM/src/globals.cpp
@@ -830,7 +830,7 @@ INT_PTR CALLBACK CGlobals::Ex_DlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP
m_exCtx.Esi, m_exCtx.Edi, m_exCtx.Ebp, m_exCtx.Esp, m_exCtx.Eip);
#endif
SetDlgItemTextA(hwndDlg, IDC_EXCEPTION_DETAILS, szBuffer);
- SetFocus(GetDlgItem(hwndDlg, IDC_EXCEPTION_DETAILS));
+ SetFocus( GetDlgItem(hwndDlg, IDC_EXCEPTION_DETAILS));
SendDlgItemMessage(hwndDlg, IDC_EXCEPTION_DETAILS, WM_SETFONT, (WPARAM)GetStockObject(OEM_FIXED_FONT), 0);
SetDlgItemTextW(hwndDlg, IDC_EX_REASON, m_exReason);
Utils::enableDlgControl(hwndDlg, IDOK, m_exAllowContinue ? TRUE : FALSE);
@@ -846,7 +846,7 @@ INT_PTR CALLBACK CGlobals::Ex_DlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP
EndDialog(hwndDlg, wID);
if (wID == IDC_COPY_EXCEPTION)
- Ex_CopyEditToClipboard(GetDlgItem(hwndDlg, IDC_EXCEPTION_DETAILS));
+ Ex_CopyEditToClipboard( GetDlgItem(hwndDlg, IDC_EXCEPTION_DETAILS));
}
break;
diff --git a/plugins/TabSRMM/src/hotkeyhandler.cpp b/plugins/TabSRMM/src/hotkeyhandler.cpp
index 936d1991b7..486525afe6 100644
--- a/plugins/TabSRMM/src/hotkeyhandler.cpp
+++ b/plugins/TabSRMM/src/hotkeyhandler.cpp
@@ -122,7 +122,7 @@ void TSAPI HandleMenuEntryFromhContact(int iSelection)
ActivateExistingTab(pContainer, si->hWnd);
if (GetForegroundWindow() != pContainer->hwnd)
SetForegroundWindow(pContainer->hwnd);
- SetFocus(GetDlgItem(pContainer->hwndActive, IDC_CHAT_MESSAGE));
+ SetFocus( GetDlgItem(pContainer->hwndActive, IDC_CHAT_MESSAGE));
} else
goto nothing_open;
} else
@@ -146,6 +146,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
{
static POINT ptLast;
static int iMousedown;
+ int iSelection;
if (msg == WM_TASKBARCREATED) {
CreateSystrayIcon(FALSE);
@@ -155,7 +156,6 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
}
TContainerData *pContainer = pFirstContainer;
- int iSelection;
switch (msg) {
case WM_CREATE:
@@ -282,11 +282,11 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
if (IsIconic(pLastActiveContainer->hwnd) || !IsWindowVisible(pLastActiveContainer->hwnd)) {
SendMessage(pLastActiveContainer->hwnd, WM_SYSCOMMAND, SC_RESTORE, 0);
SetForegroundWindow(pLastActiveContainer->hwnd);
- SetFocus(GetDlgItem(pLastActiveContainer->hwndActive, IDC_MESSAGE));
+ SetFocus( GetDlgItem(pLastActiveContainer->hwndActive, IDC_MESSAGE));
}
else if (GetForegroundWindow() != pLastActiveContainer->hwnd) {
SetForegroundWindow(pLastActiveContainer->hwnd);
- SetFocus(GetDlgItem(pLastActiveContainer->hwndActive, IDC_MESSAGE));
+ SetFocus( GetDlgItem(pLastActiveContainer->hwndActive, IDC_MESSAGE));
}
else {
if (PluginConfig.m_HideOnClose)
@@ -316,9 +316,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
CheckMenuItem(submenu, ID_TRAYCONTEXT_SHOWTHETRAYICON, MF_BYCOMMAND | (nen_options.bTraySupport ? MF_CHECKED : MF_UNCHECKED));
iSelection = TrackPopupMenu(submenu, TPM_RETURNCMD, pt.x, pt.y, 0, hwndDlg, NULL);
if (iSelection) {
- MENUITEMINFO mii = {0};
-
- mii.cbSize = sizeof(mii);
+ MENUITEMINFO mii = { sizeof(mii) };
mii.fMask = MIIM_DATA | MIIM_ID;
GetMenuItemInfo(submenu, (UINT_PTR)iSelection, FALSE, &mii);
if (mii.dwItemData != 0) // this must be an itm of the fav or recent menu
@@ -403,7 +401,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
pContainer = 0;
SendMessage(hWnd, DM_QUERYCONTAINER, 0, (LPARAM)&pContainer);
if (pContainer) {
- int iTabs = TabCtrl_GetItemCount(GetDlgItem(pContainer->hwnd, IDC_MSGTABS));
+ int iTabs = TabCtrl_GetItemCount( GetDlgItem(pContainer->hwnd, IDC_MSGTABS));
if (iTabs == 1)
SendMessage(pContainer->hwnd, WM_CLOSE, 0, 1);
else
@@ -422,7 +420,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
pContainer = 0;
SendMessage(si->hWnd, DM_QUERYCONTAINER, 0, (LPARAM)&pContainer);
if (pContainer) {
- int iTabs = TabCtrl_GetItemCount(GetDlgItem(pContainer->hwnd, 1159));
+ int iTabs = TabCtrl_GetItemCount( GetDlgItem(pContainer->hwnd, 1159));
if (iTabs == 1)
SendMessage(pContainer->hwnd, WM_CLOSE, 0, 1);
else
@@ -497,7 +495,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
M->m_pfnDwmExtendFrameIntoClientArea(pContainer->hwnd, &m);
}
if (pContainer->SideBar->isActive())
- RedrawWindow(GetDlgItem(pContainer->hwnd, 5000), NULL, NULL, RDW_ERASE|RDW_INVALIDATE|RDW_UPDATENOW); // the container for the sidebar buttons
+ RedrawWindow( GetDlgItem(pContainer->hwnd, 5000), NULL, NULL, RDW_ERASE|RDW_INVALIDATE|RDW_UPDATENOW); // the container for the sidebar buttons
RedrawWindow(pContainer->hwnd, NULL, NULL, RDW_ERASE|RDW_INVALIDATE|RDW_UPDATENOW|RDW_ALLCHILDREN);
pContainer = pContainer->pNextContainer;
}
@@ -530,7 +528,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
FreeTabConfig();
ReloadTabConfig();
while (pContainer) {
- SendMessage(GetDlgItem(pContainer->hwnd, IDC_MSGTABS), EM_THEMECHANGED, 0, 0);
+ SendMessage( GetDlgItem(pContainer->hwnd, IDC_MSGTABS), EM_THEMECHANGED, 0, 0);
BroadCastContainer(pContainer, EM_THEMECHANGED, 0, 0);
pContainer = pContainer->pNextContainer;
}
diff --git a/plugins/TabSRMM/src/infopanel.cpp b/plugins/TabSRMM/src/infopanel.cpp
index 5399d5a9bb..f5e74af066 100644
--- a/plugins/TabSRMM/src/infopanel.cpp
+++ b/plugins/TabSRMM/src/infopanel.cpp
@@ -192,7 +192,7 @@ void CInfoPanel::showHide() const
}
Utils::showDlgControl(hwndDlg, IDC_PANELSPLITTER, m_active ? SW_SHOW : SW_HIDE);
::SendMessage(hwndDlg, WM_SIZE, 0, 0);
- ::InvalidateRect(GetDlgItem(hwndDlg, IDC_CONTACTPIC), NULL, TRUE);
+ ::InvalidateRect( GetDlgItem(hwndDlg, IDC_CONTACTPIC), NULL, TRUE);
::SetAeroMargins(m_dat->pContainer);
if (M->isAero())
::InvalidateRect(GetParent(hwndDlg), NULL, FALSE);
@@ -911,7 +911,7 @@ void CInfoPanel::showTip(UINT ctrlId, const LPARAM lParam)
TCHAR szTitle[256];
HWND hwndDlg = m_dat->hwnd;
- ::GetWindowRect(GetDlgItem(hwndDlg, ctrlId), &rc);
+ ::GetWindowRect( GetDlgItem(hwndDlg, ctrlId), &rc);
::SendMessage(m_dat->hwndTip, TTM_TRACKPOSITION, 0, (LPARAM)MAKELONG(rc.left, rc.bottom));
if (lParam)
@@ -1333,7 +1333,7 @@ int CInfoPanel::invokeConfigDialog(const POINT& pt)
TranslateDialogDefault(m_hwndConfig);
::GetClientRect(m_hwndConfig, &rc);
- ::GetWindowRect(GetDlgItem(m_dat->hwnd, m_isChat ? IDC_CHAT_LOG : IDC_LOG), &rcLog);
+ ::GetWindowRect( GetDlgItem(m_dat->hwnd, m_isChat ? IDC_CHAT_LOG : IDC_LOG), &rcLog);
pt.x = rcLog.left;
pt.y = rcLog.top;
//::ScreenToClient(m_dat->pContainer->hwnd, &pt);
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp
index a9838ac9d2..71abc9c2a0 100644
--- a/plugins/TabSRMM/src/msgdialog.cpp
+++ b/plugins/TabSRMM/src/msgdialog.cpp
@@ -36,28 +36,28 @@
const TCHAR* pszIDCSAVE_close = 0, *pszIDCSAVE_save = 0;
-static const UINT sendControls[] = { IDC_MESSAGE, IDC_LOG };
-static const UINT formatControls[] = { IDC_SMILEYBTN, IDC_FONTBOLD, IDC_FONTITALIC, IDC_FONTUNDERLINE, IDC_FONTFACE,IDC_FONTSTRIKEOUT };
-static const UINT addControls[] = { IDC_ADD, IDC_CANCELADD };
+static const UINT sendControls[] = { IDC_MESSAGE, IDC_LOG };
+static const UINT formatControls[] = { IDC_SMILEYBTN, IDC_FONTBOLD, IDC_FONTITALIC, IDC_FONTUNDERLINE, IDC_FONTFACE,IDC_FONTSTRIKEOUT };
+static const UINT addControls[] = { IDC_ADD, IDC_CANCELADD };
-static const UINT errorControls[] = { IDC_STATICERRORICON, IDC_STATICTEXT, IDC_RETRY, IDC_CANCELSEND, IDC_MSGSENDLATER};
+static const UINT errorControls[] = { IDC_STATICERRORICON, IDC_STATICTEXT, IDC_RETRY, IDC_CANCELSEND, IDC_MSGSENDLATER};
-static struct {
+struct {
int id;
- const TCHAR* text;
+ const TCHAR *text;
}
-tooltips[] =
+static tooltips[] =
{
{ IDC_ADD, LPGENT("Add this contact permanently to your contact list") },
{ IDC_CANCELADD, LPGENT("Do not add this contact permanently") },
{ IDC_TOGGLESIDEBAR, LPGENT("Expand or collapse the side bar") }
};
-static struct {
+struct {
int id;
HICON *pIcon;
}
-buttonicons[] =
+static buttonicons[] =
{
{ IDC_ADD, &PluginConfig.g_buttonBarIcons[ICON_BUTTON_ADD] },
{ IDC_CANCELADD, &PluginConfig.g_buttonBarIcons[ICON_BUTTON_CANCEL] }
@@ -66,7 +66,6 @@ buttonicons[] =
static void _clrMsgFilter(LPARAM lParam)
{
MSGFILTER *m = reinterpret_cast<MSGFILTER *>(lParam);
-
m->msg = 0;
m->lParam = 0;
m->wParam = 0;
@@ -89,12 +88,12 @@ static BOOL IsStringValidLinkA(char* pszText)
if (tolower(pszText[0]) == 'w' && tolower(pszText[1]) == 'w' && tolower(pszText[2]) == 'w' && pszText[3] == '.' && isalnum(pszText[4]))
return TRUE;
- return(strstr(pszText, "://") == NULL ? FALSE : TRUE);
+ return strstr(pszText, "://") != NULL;
}
BOOL TSAPI IsUtfSendAvailable(HANDLE hContact)
{
- char* szProto = GetContactProto(hContact);
+ char *szProto = GetContactProto(hContact);
if (szProto == NULL)
return FALSE;
@@ -211,7 +210,7 @@ static void ShowPopupMenu(TWindowData *dat, int idFrom, HWND hwndFrom, POINT pt)
ClearLog(dat);
break;
case ID_LOG_FREEZELOG:
- SendMessage(GetDlgItem(hwndDlg, IDC_LOG), WM_KEYDOWN, VK_F12, 0);
+ SendMessage( GetDlgItem(hwndDlg, IDC_LOG), WM_KEYDOWN, VK_F12, 0);
break;
case ID_EDITOR_SHOWMESSAGELENGTHINDICATOR:
PluginConfig.m_visualMessageSizeIndicator = !PluginConfig.m_visualMessageSizeIndicator;
@@ -244,7 +243,7 @@ static void ResizeIeView(const TWindowData *dat, DWORD px, DWORD py, DWORD cx, D
HWND hwndDlg = dat->hwnd;
ZeroMemory(&ieWindow, sizeof(ieWindow));
- GetWindowRect(GetDlgItem(hwndDlg, IDC_LOG), &rcRichEdit);
+ GetWindowRect( GetDlgItem(hwndDlg, IDC_LOG), &rcRichEdit);
pt.x = rcRichEdit.left;
pt.y = rcRichEdit.top;
ScreenToClient(hwndDlg, &pt);
@@ -297,7 +296,7 @@ LRESULT CALLBACK HPPKFSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
wParam != VK_MENU && wParam != VK_END && wParam != VK_HOME &&
wParam != VK_UP && wParam != VK_DOWN && wParam != VK_LEFT &&
wParam != VK_RIGHT && wParam != VK_TAB && wParam != VK_SPACE) {
- SetFocus(GetDlgItem(mwdat->hwnd,IDC_MESSAGE));
+ SetFocus( GetDlgItem(mwdat->hwnd,IDC_MESSAGE));
keybd_event((BYTE)wParam, (BYTE)MapVirtualKey(wParam,0), KEYEVENTF_EXTENDEDKEY | 0, 0);
return 0;
}
@@ -412,7 +411,7 @@ static void MsgWindowUpdateState(TWindowData *dat, UINT msg)
RECT rcRTF;
POINT pt;
- GetWindowRect(GetDlgItem(hwndDlg, IDC_LOG), &rcRTF);
+ GetWindowRect( GetDlgItem(hwndDlg, IDC_LOG), &rcRTF);
rcRTF.left += 20;
rcRTF.top += 20;
pt.x = rcRTF.left;
@@ -458,17 +457,17 @@ void TSAPI ShowMultipleControls(HWND hwndDlg, const UINT *controls, int cControl
void TSAPI SetDialogToType(HWND hwndDlg)
{
struct TWindowData *dat;
- int showToolbar = 0;
+ int bShowToolbar = 0;
dat = (struct TWindowData *) GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
- showToolbar = dat->pContainer->dwFlags & CNT_HIDETOOLBAR ? 0 : 1;
+ bShowToolbar = dat->pContainer->dwFlags & CNT_HIDETOOLBAR ? 0 : 1;
if (dat->hContact) {
if (M->GetByte(dat->hContact, "CList", "NotOnList", 0)) {
dat->bNotOnList = TRUE;
ShowMultipleControls(hwndDlg, addControls, 2, SW_SHOW);
Utils::showDlgControl(hwndDlg, IDC_LOGFROZENTEXT, SW_SHOW);
- SetWindowText(GetDlgItem(hwndDlg, IDC_LOGFROZENTEXT), TranslateT("Contact not on list. You may add it..."));
+ SetWindowText( GetDlgItem(hwndDlg, IDC_LOGFROZENTEXT), TranslateT("Contact not on list. You may add it..."));
} else {
ShowMultipleControls(hwndDlg, addControls, 2, SW_HIDE);
dat->bNotOnList = FALSE;
@@ -504,7 +503,7 @@ void TSAPI SetDialogToType(HWND hwndDlg)
Utils::showDlgControl(hwndDlg, IDC_SPLITTER, dat->fIsAutosizingInput ? SW_HIDE : SW_SHOW);
Utils::showDlgControl(hwndDlg, IDC_MULTISPLITTER, (dat->sendMode & SMODE_MULTIPLE) ? SW_SHOW : SW_HIDE);
- EnableSendButton(dat, GetWindowTextLength(GetDlgItem(hwndDlg, IDC_MESSAGE)) != 0);
+ EnableSendButton(dat, GetWindowTextLength( GetDlgItem(hwndDlg, IDC_MESSAGE)) != 0);
SendMessage(hwndDlg, DM_UPDATETITLE, 0, 1);
SendMessage(hwndDlg, WM_SIZE, 0, 0);
@@ -517,7 +516,7 @@ void TSAPI SetDialogToType(HWND hwndDlg)
static LRESULT CALLBACK MessageLogSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
HWND hwndParent = GetParent(hwnd);
- TWindowData *mwdat = (TWindowData *)GetWindowLongPtr(hwndParent, GWLP_USERDATA);
+ TWindowData *mwdat = (TWindowData*)GetWindowLongPtr(hwndParent, GWLP_USERDATA);
BOOL isCtrl, isShift, isAlt;
KbdState(mwdat, isShift, isCtrl, isAlt);
@@ -532,10 +531,12 @@ static LRESULT CALLBACK MessageLogSubclassProc(HWND hwnd, UINT msg, WPARAM wPara
}
}
break;
-
- //MAD
+
+ case WM_DESTROY:
+ break;
+
case WM_CHAR:
- if (wParam == 0x03 &&isCtrl)
+ if (wParam == 0x03 && isCtrl)
return SendMessage(hwnd, WM_COPY, 0, 0);
if (wParam == 0x11 && isCtrl)
SendMessage(mwdat->hwnd,WM_COMMAND, IDC_QUOTE, 0);
@@ -564,17 +565,16 @@ static LRESULT CALLBACK MessageLogSubclassProc(HWND hwnd, UINT msg, WPARAM wPara
break;
case WM_KEYDOWN:
- if (!isCtrl && !isAlt&&!isShift) {
- if (/*wParam != VK_ESCAPE&&*/wParam != VK_PRIOR&&wParam != VK_NEXT&&
- wParam != VK_DELETE&&wParam != VK_MENU&&wParam != VK_END&&
- wParam != VK_HOME&&wParam != VK_UP&&wParam != VK_DOWN&&
- wParam != VK_LEFT&&wParam != VK_RIGHT &&
- wParam != VK_SPACE) {
- // TODO causes issues when pressing keys in the log
- //SetFocus(GetDlgItem(mwdat->hwnd,IDC_MESSAGE));
- //keybd_event((BYTE)wParam, (BYTE)MapVirtualKey(wParam,0), KEYEVENTF_EXTENDEDKEY | 0, 0);
+ if (!isCtrl && !isAlt && !isShift) {
+ if (wParam != VK_PRIOR && wParam != VK_NEXT && wParam != VK_DELETE &&
+ wParam != VK_MENU && wParam != VK_END && wParam != VK_HOME &&
+ wParam != VK_UP && wParam != VK_DOWN && wParam != VK_LEFT &&
+ wParam != VK_RIGHT && wParam != VK_SPACE) {
+ // TODO causes issues when pressing keys in the log
+ //SetFocus( GetDlgItem(mwdat->hwnd,IDC_MESSAGE));
+ //keybd_event((BYTE)wParam, (BYTE)MapVirtualKey(wParam,0), KEYEVENTF_EXTENDEDKEY | 0, 0);
- //return 0;
+ //return 0;
}
}
break;
@@ -611,6 +611,7 @@ static LRESULT CALLBACK MessageLogSubclassProc(HWND hwnd, UINT msg, WPARAM wPara
static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
+ BOOL isCtrl, isShift, isAlt;
HWND hwndParent = GetParent(hwnd);
struct TWindowData *mwdat = (struct TWindowData *)GetWindowLongPtr(hwndParent, GWLP_USERDATA);
if (mwdat == NULL)
@@ -641,47 +642,45 @@ static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd, UINT msg, WPARAM wPar
break;
case WM_CHAR:
- {
- BOOL isCtrl, isShift, isAlt;
- KbdState(mwdat, isShift, isCtrl, isAlt);
- //MAD: sound on typing..
- if (PluginConfig.g_bSoundOnTyping&&!isAlt&&!isCtrl&&!(mwdat->pContainer->dwFlags&CNT_NOSOUND)&&wParam!=VK_ESCAPE&&!(wParam==VK_TAB&&PluginConfig.m_AllowTab))
- SkinPlaySound("SoundOnTyping");
- //MAD
- if (wParam == 0x0d && isCtrl && PluginConfig.m_MathModAvail) {
- TCHAR toInsert[100];
- BYTE keyState[256];
- size_t i;
- size_t iLen = lstrlen(PluginConfig.m_MathModStartDelimiter);
- ZeroMemory(keyState, 256);
- _tcsncpy(toInsert, PluginConfig.m_MathModStartDelimiter, 30);
- _tcsncat(toInsert, PluginConfig.m_MathModStartDelimiter, 30);
- SendMessage(hwnd, EM_REPLACESEL, TRUE, (LPARAM)toInsert);
- SetKeyboardState(keyState);
- for (i=0; i < iLen; i++)
- SendMessage(hwnd, WM_KEYDOWN, mwdat->dwFlags & MWF_LOG_RTL ? VK_RIGHT : VK_LEFT, 0);
+ KbdState(mwdat, isShift, isCtrl, isAlt);
+
+ //sound on typing..
+ if (PluginConfig.g_bSoundOnTyping && !isAlt && !isCtrl && !(mwdat->pContainer->dwFlags & CNT_NOSOUND) && wParam != VK_ESCAPE && !(wParam == VK_TAB && PluginConfig.m_AllowTab))
+ SkinPlaySound("SoundOnTyping");
+
+ if (wParam == 0x0d && isCtrl && PluginConfig.m_MathModAvail) {
+ TCHAR toInsert[100];
+ BYTE keyState[256];
+ size_t i;
+ size_t iLen = lstrlen(PluginConfig.m_MathModStartDelimiter);
+ ZeroMemory(keyState, 256);
+ _tcsncpy(toInsert, PluginConfig.m_MathModStartDelimiter, 30);
+ _tcsncat(toInsert, PluginConfig.m_MathModStartDelimiter, 30);
+ SendMessage(hwnd, EM_REPLACESEL, TRUE, (LPARAM)toInsert);
+ SetKeyboardState(keyState);
+ for (i=0; i < iLen; i++)
+ SendMessage(hwnd, WM_KEYDOWN, mwdat->dwFlags & MWF_LOG_RTL ? VK_RIGHT : VK_LEFT, 0);
+ return 0;
+ }
+ if (isCtrl && !isAlt) {
+ switch (wParam) {
+ case 0x02: // bold
+ if (mwdat->SendFormat)
+ SendMessage(hwndParent, WM_COMMAND, MAKELONG(IDC_FONTBOLD, IDC_MESSAGE), 0);
+ return 0;
+ case 0x09:
+ if (mwdat->SendFormat)
+ SendMessage(hwndParent, WM_COMMAND, MAKELONG(IDC_FONTITALIC, IDC_MESSAGE), 0);
+ return 0;
+ case 21:
+ if (mwdat->SendFormat)
+ SendMessage(hwndParent, WM_COMMAND, MAKELONG(IDC_FONTUNDERLINE, IDC_MESSAGE), 0);
+ return 0;
+ case 0x0b:
+ SetWindowText(hwnd, _T(""));
return 0;
}
- if (isCtrl && !isAlt) {
- switch (wParam) {
- case 0x02: // bold
- if (mwdat->SendFormat)
- SendMessage(hwndParent, WM_COMMAND, MAKELONG(IDC_FONTBOLD, IDC_MESSAGE), 0);
- return 0;
- case 0x09:
- if (mwdat->SendFormat)
- SendMessage(hwndParent, WM_COMMAND, MAKELONG(IDC_FONTITALIC, IDC_MESSAGE), 0);
- return 0;
- case 21:
- if (mwdat->SendFormat)
- SendMessage(hwndParent, WM_COMMAND, MAKELONG(IDC_FONTUNDERLINE, IDC_MESSAGE), 0);
- return 0;
- case 0x0b:
- SetWindowText(hwnd, _T(""));
- return 0;
- }
- break;
- }
+ break;
}
break;
@@ -712,106 +711,103 @@ static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd, UINT msg, WPARAM wPar
break;
case WM_KEYDOWN:
- {
- BOOL isCtrl, isShift, isAlt;
- KbdState(mwdat, isShift, isCtrl, isAlt);
+ KbdState(mwdat, isShift, isCtrl, isAlt);
- //MAD: sound on typing..
- if (PluginConfig.g_bSoundOnTyping&&!isAlt&&!(mwdat->pContainer->dwFlags&CNT_NOSOUND)&&wParam == VK_DELETE)
- SkinPlaySound("SoundOnTyping");
- //
+ //MAD: sound on typing..
+ if (PluginConfig.g_bSoundOnTyping&&!isAlt&&!(mwdat->pContainer->dwFlags&CNT_NOSOUND)&&wParam == VK_DELETE)
+ SkinPlaySound("SoundOnTyping");
+ //
- if (wParam == VK_INSERT && !isShift && !isCtrl && !isAlt) {
- mwdat->fInsertMode = !mwdat->fInsertMode;
- SendMessage(hwndParent, WM_COMMAND, MAKEWPARAM(GetDlgCtrlID(hwnd), EN_CHANGE), (LPARAM) hwnd);
- }
- if (wParam == VK_CAPITAL || wParam == VK_NUMLOCK)
- SendMessage(hwndParent, WM_COMMAND, MAKEWPARAM(GetDlgCtrlID(hwnd), EN_CHANGE), (LPARAM) hwnd);
+ if (wParam == VK_INSERT && !isShift && !isCtrl && !isAlt) {
+ mwdat->fInsertMode = !mwdat->fInsertMode;
+ SendMessage(hwndParent, WM_COMMAND, MAKEWPARAM(GetDlgCtrlID(hwnd), EN_CHANGE), (LPARAM) hwnd);
+ }
+ if (wParam == VK_CAPITAL || wParam == VK_NUMLOCK)
+ SendMessage(hwndParent, WM_COMMAND, MAKEWPARAM(GetDlgCtrlID(hwnd), EN_CHANGE), (LPARAM) hwnd);
- if (wParam == VK_RETURN) {
- if (mwdat->fEditNotesActive)
- break;
+ if (wParam == VK_RETURN) {
+ if (mwdat->fEditNotesActive)
+ break;
- if (isShift) {
- if (PluginConfig.m_SendOnShiftEnter) {
- PostMessage(hwndParent, WM_COMMAND, IDOK, 0);
- return 0;
- }
- else break;
- }
- if ((isCtrl && !isShift) ^(0 != PluginConfig.m_SendOnEnter)) {
- PostMessage(hwndParent, WM_COMMAND, IDOK, 0);
- return 0;
- }
- if (PluginConfig.m_SendOnEnter || PluginConfig.m_SendOnDblEnter) {
- if (isCtrl)
- break;
-
- if (PluginConfig.m_SendOnDblEnter) {
- LONG lastEnterTime = GetWindowLongPtr(hwnd, GWLP_USERDATA);
- if (lastEnterTime + 2 < time(NULL)) {
- lastEnterTime = time(NULL);
- SetWindowLongPtr(hwnd, GWLP_USERDATA, lastEnterTime);
- break;
- } else {
- SendMessage(hwnd, WM_KEYDOWN, VK_BACK, 0);
- SendMessage(hwnd, WM_KEYUP, VK_BACK, 0);
- PostMessage(hwndParent, WM_COMMAND, IDOK, 0);
- return 0;
- }
- }
+ if (isShift) {
+ if (PluginConfig.m_SendOnShiftEnter) {
PostMessage(hwndParent, WM_COMMAND, IDOK, 0);
return 0;
}
else break;
}
- else SetWindowLongPtr(hwnd, GWLP_USERDATA, 0);
+ if ((isCtrl && !isShift) ^(0 != PluginConfig.m_SendOnEnter)) {
+ PostMessage(hwndParent, WM_COMMAND, IDOK, 0);
+ return 0;
+ }
+ if (PluginConfig.m_SendOnEnter || PluginConfig.m_SendOnDblEnter) {
+ if (isCtrl)
+ break;
- if (isCtrl && !isAlt && !isShift) {
- if (!isShift && (wParam == VK_UP || wParam == VK_DOWN)) { // input history scrolling (ctrl-up / down)
- SetWindowLongPtr(hwnd, GWLP_USERDATA, 0);
- if (mwdat)
- mwdat->cache->inputHistoryEvent(wParam);
- return 0;
+ if (PluginConfig.m_SendOnDblEnter) {
+ LONG lastEnterTime = GetWindowLongPtr(hwnd, GWLP_USERDATA);
+ if (lastEnterTime + 2 < time(NULL)) {
+ lastEnterTime = time(NULL);
+ SetWindowLongPtr(hwnd, GWLP_USERDATA, lastEnterTime);
+ break;
+ } else {
+ SendMessage(hwnd, WM_KEYDOWN, VK_BACK, 0);
+ SendMessage(hwnd, WM_KEYUP, VK_BACK, 0);
+ PostMessage(hwndParent, WM_COMMAND, IDOK, 0);
+ return 0;
+ }
}
+ PostMessage(hwndParent, WM_COMMAND, IDOK, 0);
+ return 0;
}
- if (isCtrl && isAlt && !isShift) {
- switch (wParam) {
- case VK_UP:
- case VK_DOWN:
- case VK_PRIOR:
- case VK_NEXT:
- case VK_HOME:
- case VK_END:
- {
- WPARAM wp = 0;
-
- SetWindowLongPtr(hwnd, GWLP_USERDATA, 0);
- if (wParam == VK_UP)
- wp = MAKEWPARAM(SB_LINEUP, 0);
- else if (wParam == VK_PRIOR)
- wp = MAKEWPARAM(SB_PAGEUP, 0);
- else if (wParam == VK_NEXT)
- wp = MAKEWPARAM(SB_PAGEDOWN, 0);
- else if (wParam == VK_HOME)
- wp = MAKEWPARAM(SB_TOP, 0);
- else if (wParam == VK_END) {
- DM_ScrollToBottom(mwdat, 0, 0);
- return 0;
- } else if (wParam == VK_DOWN)
- wp = MAKEWPARAM(SB_LINEDOWN, 0);
+ else break;
+ }
+ else SetWindowLongPtr(hwnd, GWLP_USERDATA, 0);
- if (mwdat->hwndIEView == 0 && mwdat->hwndHPP == 0)
- SendMessage(GetDlgItem(hwndParent, IDC_LOG), WM_VSCROLL, wp, 0);
- else
- SendMessage(mwdat->hwndIWebBrowserControl, WM_VSCROLL, wp, 0);
+ if (isCtrl && !isAlt && !isShift) {
+ if (!isShift && (wParam == VK_UP || wParam == VK_DOWN)) { // input history scrolling (ctrl-up / down)
+ SetWindowLongPtr(hwnd, GWLP_USERDATA, 0);
+ if (mwdat)
+ mwdat->cache->inputHistoryEvent(wParam);
+ return 0;
+ }
+ }
+ if (isCtrl && isAlt && !isShift) {
+ switch (wParam) {
+ case VK_UP:
+ case VK_DOWN:
+ case VK_PRIOR:
+ case VK_NEXT:
+ case VK_HOME:
+ case VK_END:
+ {
+ WPARAM wp = 0;
+ SetWindowLongPtr(hwnd, GWLP_USERDATA, 0);
+ if (wParam == VK_UP)
+ wp = MAKEWPARAM(SB_LINEUP, 0);
+ else if (wParam == VK_PRIOR)
+ wp = MAKEWPARAM(SB_PAGEUP, 0);
+ else if (wParam == VK_NEXT)
+ wp = MAKEWPARAM(SB_PAGEDOWN, 0);
+ else if (wParam == VK_HOME)
+ wp = MAKEWPARAM(SB_TOP, 0);
+ else if (wParam == VK_END) {
+ DM_ScrollToBottom(mwdat, 0, 0);
return 0;
}
+ else if (wParam == VK_DOWN)
+ wp = MAKEWPARAM(SB_LINEDOWN, 0);
+
+ if (mwdat->hwndIEView == 0 && mwdat->hwndHPP == 0)
+ SendMessage( GetDlgItem(hwndParent, IDC_LOG), WM_VSCROLL, wp, 0);
+ else
+ SendMessage(mwdat->hwndIWebBrowserControl, WM_VSCROLL, wp, 0);
+ return 0;
}
}
- if (wParam == VK_RETURN)
- break;
}
+ if (wParam == VK_RETURN)
+ break;
case WM_SYSKEYDOWN:
mwdat->fkeyProcessed = false;
@@ -833,22 +829,18 @@ static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd, UINT msg, WPARAM wPar
mwdat->fkeyProcessed = false;
return 0;
}
- {
- HWND hwndDlg = hwndParent;
- BOOL isCtrl, isShift, isAlt;
- KbdState(mwdat, isShift, isCtrl, isAlt);
- if ((wParam >= '0' && wParam <= '9') && isAlt) { // ALT-1 -> ALT-0 direct tab selection
- BYTE bChar = (BYTE)wParam;
- int iIndex;
+ KbdState(mwdat, isShift, isCtrl, isAlt);
+ if ((wParam >= '0' && wParam <= '9') && isAlt) { // ALT-1 -> ALT-0 direct tab selection
+ BYTE bChar = (BYTE)wParam;
+ int iIndex;
- if (bChar == '0')
- iIndex = 10;
- else
- iIndex = bChar - (BYTE)'0';
- SendMessage(mwdat->pContainer->hwnd, DM_SELECTTAB, DM_SELECT_BY_INDEX, (LPARAM)iIndex);
- return 0;
- }
+ if (bChar == '0')
+ iIndex = 10;
+ else
+ iIndex = bChar - (BYTE)'0';
+ SendMessage(mwdat->pContainer->hwnd, DM_SELECTTAB, DM_SELECT_BY_INDEX, (LPARAM)iIndex);
+ return 0;
}
break;
@@ -863,13 +855,14 @@ static LRESULT CALLBACK MessageEditSubclassProc(HWND hwnd, UINT msg, WPARAM wPar
case WM_ERASEBKGND:
return(CSkin::m_skinEnabled ? 0 : 1);
- /*
- * sent by smileyadd when the smiley selection window dies
- * just grab the focus :)
- */
+ /*
+ * sent by smileyadd when the smiley selection window dies
+ * just grab the focus :)
+ */
case WM_USER + 100:
SetFocus(hwnd);
break;
+
case WM_CONTEXTMENU:
POINT pt;
@@ -909,40 +902,33 @@ LRESULT CALLBACK SplitterSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
{
HWND hwndParent = GetParent(hwnd);
TWindowData *dat = (TWindowData *)GetWindowLongPtr(hwndParent, GWLP_USERDATA);
+ RECT rc;
switch (msg) {
case WM_NCHITTEST:
return HTCLIENT;
case WM_SETCURSOR:
- {
- RECT rc;
- GetClientRect(hwnd, &rc);
- SetCursor(rc.right > rc.bottom ? PluginConfig.hCurSplitNS : PluginConfig.hCurSplitWE);
- }
+ GetClientRect(hwnd, &rc);
+ SetCursor(rc.right > rc.bottom ? PluginConfig.hCurSplitNS : PluginConfig.hCurSplitWE);
return TRUE;
case WM_LBUTTONDOWN:
- if (hwnd == GetDlgItem(hwndParent, IDC_SPLITTER) || hwnd == GetDlgItem(hwndParent, IDC_SPLITTERY)) {
- RECT rc;
-
- if (dat) {
- GetClientRect(hwnd, &rc);
- dat->savedSplitter = rc.right > rc.bottom ? (short) HIWORD(GetMessagePos()) + rc.bottom / 2 : (short) LOWORD(GetMessagePos()) + rc.right / 2;
- if (dat->bType == SESSIONTYPE_IM)
- dat->savedSplitY = dat->splitterY;
- else {
- SESSION_INFO *si = (SESSION_INFO *)dat->si;
- dat->savedSplitY = si->iSplitterY;
- }
- dat->savedDynaSplit = dat->dynaSplitter;
+ if (dat && hwnd == GetDlgItem(hwndParent, IDC_SPLITTER) || hwnd == GetDlgItem(hwndParent, IDC_SPLITTERY)) {
+ GetClientRect(hwnd, &rc);
+ dat->savedSplitter = rc.right > rc.bottom ? (short) HIWORD(GetMessagePos()) + rc.bottom / 2 : (short) LOWORD(GetMessagePos()) + rc.right / 2;
+ if (dat->bType == SESSIONTYPE_IM)
+ dat->savedSplitY = dat->splitterY;
+ else {
+ SESSION_INFO *si = (SESSION_INFO *)dat->si;
+ dat->savedSplitY = si->iSplitterY;
}
+ dat->savedDynaSplit = dat->dynaSplitter;
}
SetCapture(hwnd);
return 0;
case WM_MOUSEMOVE:
if (GetCapture() == hwnd) {
- RECT rc;
GetClientRect(hwnd, &rc);
SendMessage(hwndParent, DM_SPLITTERMOVED, rc.right > rc.bottom ? (short) HIWORD(GetMessagePos()) + rc.bottom / 2 : (short) LOWORD(GetMessagePos()) + rc.right / 2, (LPARAM) hwnd);
}
@@ -953,7 +939,6 @@ LRESULT CALLBACK SplitterSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
case WM_PAINT:
{
- RECT rc;
PAINTSTRUCT ps;
HDC dc = BeginPaint(hwnd, &ps);
int ctrlId = GetDlgCtrlID(hwnd);
@@ -975,18 +960,18 @@ LRESULT CALLBACK SplitterSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
}
return 0;
- case WM_LBUTTONUP: {
- HWND hwndCapture = GetCapture();
+ case WM_LBUTTONUP:
+ {
+ HWND hwndCapture = GetCapture();
- ReleaseCapture();
- DM_ScrollToBottom(dat, 0, 1);
- if (dat && dat->bType == SESSIONTYPE_IM && hwnd == GetDlgItem(hwndParent, IDC_PANELSPLITTER)) {
- SendMessage(hwndParent, WM_SIZE, 0, 0);
- dat->panelWidth = -1;
- RedrawWindow(hwndParent, NULL, NULL, RDW_ALLCHILDREN | RDW_INVALIDATE | RDW_UPDATENOW);
- }
- else if ((dat && dat->bType == SESSIONTYPE_IM && hwnd == GetDlgItem(hwndParent, IDC_SPLITTER)) ||
- (dat && dat->bType == SESSIONTYPE_CHAT && hwnd == GetDlgItem(hwndParent, IDC_SPLITTERY))) {
+ ReleaseCapture();
+ DM_ScrollToBottom(dat, 0, 1);
+ if (dat && dat->bType == SESSIONTYPE_IM && hwnd == GetDlgItem(hwndParent, IDC_PANELSPLITTER)) {
+ SendMessage(hwndParent, WM_SIZE, 0, 0);
+ dat->panelWidth = -1;
+ RedrawWindow(hwndParent, NULL, NULL, RDW_ALLCHILDREN | RDW_INVALIDATE | RDW_UPDATENOW);
+ }
+ else if ((dat && dat->bType == SESSIONTYPE_IM && hwnd == GetDlgItem(hwndParent, IDC_SPLITTER)) || (dat && dat->bType == SESSIONTYPE_CHAT && hwnd == GetDlgItem(hwndParent, IDC_SPLITTERY))) {
RECT rc;
POINT pt;
int selection;
@@ -1007,21 +992,17 @@ LRESULT CALLBACK SplitterSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
#endif
switch (selection) {
case ID_SPLITTERCONTEXT_SAVEFORTHISCONTACTONLY:
- {
- HWND hwndParent = GetParent(hwnd);
-
- dat->dwFlagsEx |= MWF_SHOW_SPLITTEROVERRIDE;
- M->WriteByte(dat->hContact, SRMSGMOD_T, "splitoverride", 1);
- if (dat->bType == SESSIONTYPE_IM)
- SaveSplitter(dat);
- }
+ dat->dwFlagsEx |= MWF_SHOW_SPLITTEROVERRIDE;
+ M->WriteByte(dat->hContact, SRMSGMOD_T, "splitoverride", 1);
+ if (dat->bType == SESSIONTYPE_IM)
+ SaveSplitter(dat);
break;
case ID_SPLITTERCONTEXT_SETPOSITIONFORTHISSESSION:
#if defined(__FEAT_EXP_AUTOSPLITTER)
if (dat->fIsAutosizingInput) {
RECT rc;
- GetWindowRect(GetDlgItem(dat->hwnd, IDC_MESSAGE), &rc);
+ GetWindowRect( GetDlgItem(dat->hwnd, IDC_MESSAGE), &rc);
dat->iInputAreaHeight = 0;
}
#endif
@@ -1029,14 +1010,15 @@ LRESULT CALLBACK SplitterSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
case ID_SPLITTERCONTEXT_SAVEGLOBALFORALLSESSIONS:
{
- RECT rcWin;
BYTE bSync = M->GetByte("Chat", "SyncSplitter", 0);
DWORD dwOff_IM = 0, dwOff_CHAT = 0;
dwOff_CHAT = -(2 + (PluginConfig.g_DPIscaleY > 1.0 ? 1 : 0));
dwOff_IM = 2 + (PluginConfig.g_DPIscaleY > 1.0 ? 1 : 0);
+ RECT rcWin;
GetWindowRect(hwndParent, &rcWin);
+
PluginConfig.lastSPlitterPos.pSrcDat = dat;
PluginConfig.lastSPlitterPos.pSrcContainer = dat->pContainer;
PluginConfig.lastSPlitterPos.lParam = rc.bottom;
@@ -1064,8 +1046,8 @@ LRESULT CALLBACK SplitterSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
DM_ScrollToBottom(dat, 0, 1);
break;
}
- }
- return 0;
+ }
+ return 0;
}
}
return mir_callNextSubclass(hwnd, SplitterSubclassProc, msg, wParam, lParam);
@@ -1077,27 +1059,23 @@ LRESULT CALLBACK SplitterSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
static int MessageDialogResize(HWND hwndDlg, LPARAM lParam, UTILRESIZECONTROL * urc)
{
- TWindowData* dat = (TWindowData *) lParam;
- RECT rc, rcButton;
- static int uinWidth, msgTop = 0, msgBottom = 0;
+ TWindowData *dat = (TWindowData *) lParam;
+ RECT rc, rcButton;
+ static int uinWidth, msgTop = 0, msgBottom = 0;
+ static LONG rcLogBottom;
- int showToolbar = dat->pContainer->dwFlags & CNT_HIDETOOLBAR ? 0 : 1;
- BOOL bBottomToolbar = dat->pContainer->dwFlags & CNT_BOTTOMTOOLBAR ? 1 : 0;
- static LONG rcLogBottom;
+ int panelHeight = dat->Panel->getHeight() + 1;
+ bool fInfoPanel = dat->Panel->isActive();
+ bool fErrorState = (dat->dwFlags & MWF_ERRORSTATE) != 0;
+ bool bShowToolbar = (dat->pContainer->dwFlags & CNT_HIDETOOLBAR) != 0;
+ bool bBottomToolbar = (dat->pContainer->dwFlags & CNT_BOTTOMTOOLBAR) != 0;
- int panelHeight = dat->Panel->getHeight() + 1;
- int s_offset = 0;
- bool fInfoPanel = dat->Panel->isActive();
- bool fErrorState = (dat->dwFlags & MWF_ERRORSTATE) ? true : false;
-
- GetClientRect(GetDlgItem(hwndDlg, IDC_LOG), &rc);
- GetClientRect(GetDlgItem(hwndDlg, IDC_PROTOCOL), &rcButton);
+ GetClientRect( GetDlgItem(hwndDlg, IDC_LOG), &rc);
+ GetClientRect( GetDlgItem(hwndDlg, IDC_PROTOCOL), &rcButton);
if (dat->panelStatusCX == 0)
dat->panelStatusCX = 80;
- s_offset = 1;
-
switch (urc->wId) {
case IDC_PANELSPLITTER:
urc->rcItem.bottom = panelHeight;
@@ -1111,7 +1089,7 @@ static int MessageDialogResize(HWND hwndDlg, LPARAM lParam, UTILRESIZECONTROL *
if (dat->sendMode & SMODE_MULTIPLE)
urc->rcItem.right -= (dat->multiSplitterX + 3);
urc->rcItem.bottom -= dat->splitterY - dat->originalSplitterY;
- if (!showToolbar||bBottomToolbar)
+ if (!bShowToolbar||bBottomToolbar)
urc->rcItem.bottom += 21;
if (fInfoPanel)
urc->rcItem.top += panelHeight;
@@ -1127,42 +1105,43 @@ static int MessageDialogResize(HWND hwndDlg, LPARAM lParam, UTILRESIZECONTROL *
}
rcLogBottom = urc->rcItem.bottom;
return RD_ANCHORX_WIDTH | RD_ANCHORY_HEIGHT;
- case IDC_CONTACTPIC:{
- RECT rc;
- GetClientRect(GetDlgItem(hwndDlg, IDC_MESSAGE), &rc);
- urc->rcItem.top -= dat->splitterY - dat->originalSplitterY;
- urc->rcItem.left = urc->rcItem.right - (dat->pic.cx + 2);
- if ((urc->rcItem.bottom - urc->rcItem.top) < (dat->pic.cy/* + 2*/) && dat->showPic) {
- urc->rcItem.top = urc->rcItem.bottom - dat->pic.cy;
- dat->fMustOffset = TRUE;
- } else
- dat->fMustOffset = FALSE;
-
- if (showToolbar && bBottomToolbar && (PluginConfig.m_AlwaysFullToolbarWidth || ((dat->pic.cy - DPISCALEY_S(6)) < rc.bottom))) {
- urc->rcItem.bottom -= DPISCALEY_S(22);
- if (dat->fIsAutosizingInput) {
- urc->rcItem.left--;
- urc->rcItem.top--;
+
+ case IDC_CONTACTPIC:
+ {
+ RECT rc;
+ GetClientRect( GetDlgItem(hwndDlg, IDC_MESSAGE), &rc);
+ urc->rcItem.top -= dat->splitterY - dat->originalSplitterY;
+ urc->rcItem.left = urc->rcItem.right - (dat->pic.cx + 2);
+ if ((urc->rcItem.bottom - urc->rcItem.top) < (dat->pic.cy/* + 2*/) && dat->showPic) {
+ urc->rcItem.top = urc->rcItem.bottom - dat->pic.cy;
+ dat->fMustOffset = TRUE;
+ } else
+ dat->fMustOffset = FALSE;
+
+ if (bShowToolbar && bBottomToolbar && (PluginConfig.m_AlwaysFullToolbarWidth || ((dat->pic.cy - DPISCALEY_S(6)) < rc.bottom))) {
+ urc->rcItem.bottom -= DPISCALEY_S(22);
+ if (dat->fIsAutosizingInput) {
+ urc->rcItem.left--;
+ urc->rcItem.top--;
+ }
}
- }
- //Bolshevik: resizes avatar control _FIXED
- if ( dat->hwndContactPic ) //if Panel control was created?
- SetWindowPos(dat->hwndContactPic, HWND_TOP, 1, ((urc->rcItem.bottom-urc->rcItem.top)-(dat->pic.cy))/2+1, //resizes it
- dat->pic.cx-2,
- dat->pic.cy-2, SWP_SHOWWINDOW);
- //Bolshevik_
- if (PluginConfig.g_FlashAvatarAvail) {
- RECT rc = { urc->rcItem.left, urc->rcItem.top, urc->rcItem.right, urc->rcItem.bottom };
- FLASHAVATAR fa = {0};
+ if ( dat->hwndContactPic ) //if Panel control was created?
+ SetWindowPos(dat->hwndContactPic, HWND_TOP, 1, ((urc->rcItem.bottom-urc->rcItem.top)-(dat->pic.cy))/2+1, //resizes it
+ dat->pic.cx-2, dat->pic.cy-2, SWP_SHOWWINDOW);
- fa.hContact = !fInfoPanel ? dat->hContact : NULL;
- fa.id = 25367;
- fa.cProto = dat->szProto;
- CallService(MS_FAVATAR_RESIZE, (WPARAM)&fa, (LPARAM)&rc);
+ if (PluginConfig.g_FlashAvatarAvail) {
+ RECT rc = urc->rcItem;
+
+ FLASHAVATAR fa = {0};
+ fa.hContact = !fInfoPanel ? dat->hContact : NULL;
+ fa.id = 25367;
+ fa.cProto = dat->szProto;
+ CallService(MS_FAVATAR_RESIZE, (WPARAM)&fa, (LPARAM)&rc);
+ }
}
return RD_ANCHORX_RIGHT | RD_ANCHORY_BOTTOM;
- }
+
case IDC_SPLITTER:
urc->rcItem.right = urc->dlgNewSize.cx;
urc->rcItem.top -= dat->splitterY - dat->originalSplitterY;
@@ -1173,12 +1152,13 @@ static int MessageDialogResize(HWND hwndDlg, LPARAM lParam, UTILRESIZECONTROL *
if (dat->fMustOffset)
urc->rcItem.right -= (dat->pic.cx); // + DPISCALEX(2));
return RD_ANCHORX_CUSTOM | RD_ANCHORY_BOTTOM;
+
case IDC_MESSAGE:
urc->rcItem.right = urc->dlgNewSize.cx;
if (dat->showPic)
urc->rcItem.right -= dat->pic.cx + 2;
urc->rcItem.top -= dat->splitterY - dat->originalSplitterY;
- if (bBottomToolbar&&showToolbar)
+ if (bBottomToolbar && bShowToolbar)
urc->rcItem.bottom -= DPISCALEY_S(22);
if (dat->fIsAutosizingInput)
@@ -1196,6 +1176,7 @@ static int MessageDialogResize(HWND hwndDlg, LPARAM lParam, UTILRESIZECONTROL *
}
}
return RD_ANCHORX_CUSTOM | RD_ANCHORY_BOTTOM;
+
case IDC_MULTISPLITTER:
if (fInfoPanel)
urc->rcItem.top += panelHeight;
@@ -1203,37 +1184,42 @@ static int MessageDialogResize(HWND hwndDlg, LPARAM lParam, UTILRESIZECONTROL *
urc->rcItem.right -= dat->multiSplitterX;
urc->rcItem.bottom = rcLogBottom;
return RD_ANCHORX_RIGHT | RD_ANCHORY_HEIGHT;
+
case IDC_LOGFROZENTEXT:
urc->rcItem.right = urc->dlgNewSize.cx - 50;
urc->rcItem.bottom = msgTop - (bBottomToolbar ? 0 : 28);
urc->rcItem.top = msgTop - 16 - (bBottomToolbar ? 0 : 28);
- if (!showToolbar && !bBottomToolbar) {
+ if (!bShowToolbar && !bBottomToolbar) {
urc->rcItem.bottom += 21;
urc->rcItem.top += 21;
}
return RD_ANCHORX_CUSTOM | RD_ANCHORY_BOTTOM;
+
case IDC_ADD:
urc->rcItem.bottom = msgTop - (bBottomToolbar ? 0 : 28);
urc->rcItem.top = msgTop - 18 - (bBottomToolbar ? 0 : 28);
urc->rcItem.right = urc->dlgNewSize.cx - 28;
urc->rcItem.left = urc->rcItem.right - 20;
- if (!showToolbar && !bBottomToolbar) {
+ if (!bShowToolbar && !bBottomToolbar) {
urc->rcItem.bottom += 21;
urc->rcItem.top += 21;
}
return RD_ANCHORX_CUSTOM | RD_ANCHORY_BOTTOM;
+
case IDC_CANCELADD:
urc->rcItem.bottom = msgTop - (bBottomToolbar ? 0 : 28);
urc->rcItem.top = msgTop - 18 - (bBottomToolbar ? 0 : 28);
urc->rcItem.right = urc->dlgNewSize.cx - 4;
urc->rcItem.left = urc->rcItem.right - 20;
- if (!showToolbar && !bBottomToolbar) {
+ if (!bShowToolbar && !bBottomToolbar) {
urc->rcItem.bottom += 21;
urc->rcItem.top += 21;
}
return RD_ANCHORX_CUSTOM | RD_ANCHORY_BOTTOM;
+
case IDC_TOGGLESIDEBAR:
return RD_ANCHORX_CUSTOM | RD_ANCHORY_CUSTOM;
+
case IDC_RETRY:
case IDC_CANCELSEND:
case IDC_MSGSENDLATER:
@@ -1241,18 +1227,19 @@ static int MessageDialogResize(HWND hwndDlg, LPARAM lParam, UTILRESIZECONTROL *
urc->rcItem.bottom = msgTop - 5 - (bBottomToolbar ? 0 : 28) - ((dat->bNotOnList || dat->dwFlagsEx & MWF_SHOW_SCROLLINGDISABLED) ? 20 : 0);
urc->rcItem.top = msgTop - 25 - (bBottomToolbar ? 0 : 28) - ((dat->bNotOnList || dat->dwFlagsEx & MWF_SHOW_SCROLLINGDISABLED) ? 20 : 0);
}
- if (!showToolbar && !bBottomToolbar) {
+ if (!bShowToolbar && !bBottomToolbar) {
urc->rcItem.bottom += 21;
urc->rcItem.top += 21;
}
return RD_ANCHORX_LEFT | RD_ANCHORY_BOTTOM;
+
case IDC_STATICTEXT:
case IDC_STATICERRORICON:
if (fErrorState) {
urc->rcItem.bottom = msgTop - 28 - (bBottomToolbar ? 0 : 28) - ((dat->bNotOnList || dat->dwFlagsEx & MWF_SHOW_SCROLLINGDISABLED) ? 20 : 0);
urc->rcItem.top = msgTop - 45 - (bBottomToolbar ? 0 : 28) - ((dat->bNotOnList || dat->dwFlagsEx & MWF_SHOW_SCROLLINGDISABLED) ? 20 : 0);
}
- if (!showToolbar && !bBottomToolbar) {
+ if (!bShowToolbar && !bBottomToolbar) {
urc->rcItem.bottom += 21;
urc->rcItem.top += 21;
}
@@ -1266,11 +1253,13 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
TContainerData *m_pContainer = 0;
TWindowData *dat = (TWindowData*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
HWND hwndTab = GetParent(hwndDlg), hwndContainer;
+ int iSelection;
if (dat == 0) {
if (msg == WM_ACTIVATE || msg == WM_SETFOCUS)
return 0;
- } else {
+ }
+ else {
m_pContainer = dat->pContainer;
hwndContainer = m_pContainer->hwnd;
}
@@ -1278,12 +1267,10 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
switch (msg) {
case WM_INITDIALOG:
{
- RECT rc;
+ RECT rc;
POINT pt;
- int i;
BOOL isThemed = PluginConfig.m_bIsXP;
- int dwLocalSmAdd = 0;
- DBVARIANT dbv = {0};
+ int i, dwLocalSmAdd = 0;
struct TNewWindowData *newData = (struct TNewWindowData *) lParam;
@@ -1299,7 +1286,6 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
Utils::RTF_CTableInit();
dat->dwFlags |= MWF_INITMODE;
-
dat->bType = SESSIONTYPE_IM;
dat->fInsertMode = FALSE;
dat->fLimitedUpdate = false;
@@ -1333,8 +1319,8 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
if (dat->hContact && dat->szProto != NULL) {
dat->wStatus = DBGetContactSettingWord(dat->hContact, dat->szProto, "Status", ID_STATUS_OFFLINE);
mir_sntprintf(dat->szStatus, SIZEOF(dat->szStatus), _T("%s"), (char *) CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, dat->szProto == NULL ? ID_STATUS_OFFLINE : dat->wStatus, GSMDF_TCHAR));
- } else
- dat->wStatus = ID_STATUS_OFFLINE;
+ }
+ else dat->wStatus = ID_STATUS_OFFLINE;
GetMYUIN(dat);
GetClientIcon(dat);
@@ -1411,11 +1397,11 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
}
dat->showPic = GetAvatarVisibility(hwndDlg, dat);
- GetWindowRect(GetDlgItem(hwndDlg, IDC_SMILEYBTN), &rc);
+ GetWindowRect( GetDlgItem(hwndDlg, IDC_SMILEYBTN), &rc);
Utils::showDlgControl(hwndDlg, IDC_MULTISPLITTER, SW_HIDE);
- GetWindowRect(GetDlgItem(hwndDlg, IDC_SPLITTER), &rc);
+ GetWindowRect( GetDlgItem(hwndDlg, IDC_SPLITTER), &rc);
pt.y = (rc.top + rc.bottom) / 2;
pt.x = 0;
ScreenToClient(hwndDlg, &pt);
@@ -1423,7 +1409,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
if (dat->splitterY == -1)
dat->splitterY = dat->originalSplitterY + 60;
- GetWindowRect(GetDlgItem(hwndDlg, IDC_MESSAGE), &rc);
+ GetWindowRect( GetDlgItem(hwndDlg, IDC_MESSAGE), &rc);
dat->minEditBoxSize.cx = rc.right - rc.left;
dat->minEditBoxSize.cy = rc.bottom - rc.top;
@@ -1434,8 +1420,8 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
!SkinItems[ID_EXTBKBUTTONSPRESSED].IGNORED && !SkinItems[ID_EXTBKBUTTONSMOUSEOVER].IGNORED)
isThemed = FALSE;
- SendMessage(GetDlgItem(hwndDlg, IDC_ADD), BUTTONSETASFLATBTN, TRUE, 0);
- SendMessage(GetDlgItem(hwndDlg, IDC_CANCELADD), BUTTONSETASFLATBTN, TRUE, 0);
+ SendMessage( GetDlgItem(hwndDlg, IDC_ADD), BUTTONSETASFLATBTN, TRUE, 0);
+ SendMessage( GetDlgItem(hwndDlg, IDC_CANCELADD), BUTTONSETASFLATBTN, TRUE, 0);
SendDlgItemMessage(hwndDlg, IDC_TOGGLESIDEBAR, BUTTONSETASFLATBTN, TRUE, 0);
SendDlgItemMessage(hwndDlg, IDC_TOGGLESIDEBAR, BUTTONSETASTHEMEDBTN, isThemed != 0, 0);
@@ -1450,10 +1436,10 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
SetDlgItemText(hwndDlg, IDC_LOGFROZENTEXT, dat->bNotOnList ? TranslateT("Contact not on list. You may add it...") :
TranslateT("Autoscrolling is disabled (press F12 to enable it)"));
- SendMessage(GetDlgItem(hwndDlg, IDC_SAVE), BUTTONADDTOOLTIP, (WPARAM)pszIDCSAVE_close, 0);
- SendMessage(GetDlgItem(hwndDlg, IDC_PROTOCOL), BUTTONADDTOOLTIP, (WPARAM) TranslateT("Click for contact menu\nClick dropdown for window settings"), 0);
+ SendMessage( GetDlgItem(hwndDlg, IDC_SAVE), BUTTONADDTOOLTIP, (WPARAM)pszIDCSAVE_close, 0);
+ SendMessage( GetDlgItem(hwndDlg, IDC_PROTOCOL), BUTTONADDTOOLTIP, (WPARAM) TranslateT("Click for contact menu\nClick dropdown for window settings"), 0);
- SetWindowText(GetDlgItem(hwndDlg, IDC_RETRY), TranslateT("Retry"));
+ SetWindowText( GetDlgItem(hwndDlg, IDC_RETRY), TranslateT("Retry"));
UINT _ctrls[] = {IDC_RETRY, IDC_CANCELSEND, IDC_MSGSENDLATER};
for (i=0; i < 3; i++) {
@@ -1462,8 +1448,8 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
SendDlgItemMessage(hwndDlg, _ctrls[i], BUTTONSETASTHEMEDBTN, TRUE, 0);
}
- SetWindowText(GetDlgItem(hwndDlg, IDC_CANCELSEND), TranslateT("Cancel"));
- SetWindowText(GetDlgItem(hwndDlg, IDC_MSGSENDLATER), TranslateT("Send later"));
+ SetWindowText( GetDlgItem(hwndDlg, IDC_CANCELSEND), TranslateT("Cancel"));
+ SetWindowText( GetDlgItem(hwndDlg, IDC_MSGSENDLATER), TranslateT("Send later"));
SendDlgItemMessage(hwndDlg, IDC_LOG, EM_SETUNDOLIMIT, 0, 0);
SendDlgItemMessage(hwndDlg, IDC_LOG, EM_SETEVENTMASK, 0, ENM_MOUSEEVENTS | ENM_KEYEVENTS | ENM_LINK);
@@ -1533,44 +1519,38 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
SetDlgItemTextW(hwndDlg, IDC_MESSAGE, (TCHAR *)newData->szInitialText);
else
SetDlgItemTextA(hwndDlg, IDC_MESSAGE, newData->szInitialText);
- len = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_MESSAGE));
- PostMessage(GetDlgItem(hwndDlg, IDC_MESSAGE), EM_SETSEL, len, len);
+ len = GetWindowTextLength( GetDlgItem(hwndDlg, IDC_MESSAGE));
+ PostMessage( GetDlgItem(hwndDlg, IDC_MESSAGE), EM_SETSEL, len, len);
if (len)
EnableSendButton(dat, TRUE);
}
- //dat->dwFlags &= ~MWF_INITMODE;
- {
- HANDLE hdbEvent = (HANDLE) CallService(MS_DB_EVENT_FINDLAST, (WPARAM) dat->hContact, 0);
- if (hdbEvent) {
- do {
- DBEVENTINFO dbei = { sizeof(dbei) };
- CallService(MS_DB_EVENT_GET, (WPARAM) hdbEvent, (LPARAM) & dbei);
- if (dbei.eventType == EVENTTYPE_MESSAGE && !(dbei.flags & DBEF_SENT)) {
- dat->lastMessage = dbei.timestamp;
- DM_UpdateLastMessage(dat);
- break;
- }
+
+ HANDLE hdbEvent = (HANDLE) CallService(MS_DB_EVENT_FINDLAST, (WPARAM) dat->hContact, 0);
+ if (hdbEvent) {
+ do {
+ DBEVENTINFO dbei = { sizeof(dbei) };
+ CallService(MS_DB_EVENT_GET, (WPARAM) hdbEvent, (LPARAM) & dbei);
+ if (dbei.eventType == EVENTTYPE_MESSAGE && !(dbei.flags & DBEF_SENT)) {
+ dat->lastMessage = dbei.timestamp;
+ DM_UpdateLastMessage(dat);
+ break;
}
- while (hdbEvent = (HANDLE) CallService(MS_DB_EVENT_FINDPREV, (WPARAM) hdbEvent, 0));
}
+ while (hdbEvent = (HANDLE) CallService(MS_DB_EVENT_FINDPREV, (WPARAM) hdbEvent, 0));
}
+
SendMessage(hwndContainer, DM_QUERYCLIENTAREA, 0, (LPARAM)&rc);
- {
- WNDCLASSA wndClass;
+ WNDCLASSA wndClass = { 0 };
+ GetClassInfoA(g_hInst, "RichEdit20A", &wndClass);
+ mir_subclassWindowFull( GetDlgItem(hwndDlg, IDC_LOG), MessageLogSubclassProc, wndClass.lpfnWndProc);
- ZeroMemory(&wndClass, sizeof(wndClass));
- GetClassInfoA(g_hInst, "RichEdit20A", &wndClass);
- mir_subclassWindowFull( GetDlgItem(hwndDlg, IDC_LOG), MessageLogSubclassProc, wndClass.lpfnWndProc);
- }
SetWindowPos(hwndDlg, 0, rc.left, rc.top, (rc.right - rc.left), (rc.bottom - rc.top), newData->iActivate ? 0 : SWP_NOZORDER | SWP_NOACTIVATE);
LoadSplitter(dat);
ShowPicture(dat, TRUE);
if (m_pContainer->dwFlags & CNT_CREATE_MINIMIZED || !newData->iActivate || m_pContainer->dwFlags & CNT_DEFERREDTABSELECT) {
DBEVENTINFO dbei = {0};
-
- dbei.flags = 0;
dbei.eventType = EVENTTYPE_MESSAGE;
dat->iFlashIcon = PluginConfig.g_IconMsgEvent;
SetTimer(hwndDlg, TIMERID_FLASHWND, TIMEOUT_FLASHWND, NULL);
@@ -1586,7 +1566,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
ShowWindow(hwndDlg, SW_SHOW);
SetActiveWindow(hwndDlg);
SetForegroundWindow(hwndDlg);
- //SetFocus(GetDlgItem(hwndDlg, IDC_MESSAGE));
+ //SetFocus( GetDlgItem(hwndDlg, IDC_MESSAGE));
PostMessage(hwndContainer, DM_UPDATETITLE, (WPARAM)dat->hContact, 0);
} else if (m_pContainer->dwFlags & CNT_CREATE_MINIMIZED) {
dat->dwFlags |= MWF_DEFERREDSCROLL;
@@ -1668,7 +1648,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
item = &SkinItems[item_ids[i]];
if (!item->IGNORED) {
- GetWindowRect(GetDlgItem(hwndDlg, ctl_ids[i]), &rcWindow);
+ GetWindowRect( GetDlgItem(hwndDlg, ctl_ids[i]), &rcWindow);
pt.x = rcWindow.left;
pt.y = rcWindow.top;
ScreenToClient(hwndDlg, &pt);
@@ -1831,17 +1811,17 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
rc.top = rc.bottom - dat->ipFieldHeight;
dat->rcUIN = rc;
- if (GetDlgItem(hwndDlg, IDC_CLIST) != 0) {
+ if ( GetDlgItem(hwndDlg, IDC_CLIST) != 0) {
RECT rc, rcClient, rcLog;
GetClientRect(hwndDlg, &rcClient);
- GetClientRect(GetDlgItem(hwndDlg, IDC_LOG), &rcLog);
+ GetClientRect( GetDlgItem(hwndDlg, IDC_LOG), &rcLog);
rc.top = 0;
rc.right = rcClient.right;
rc.left = rcClient.right - dat->multiSplitterX;
rc.bottom = rcLog.bottom;
if (dat->Panel->isActive())
rc.top += (dat->Panel->getHeight() + 1);
- MoveWindow(GetDlgItem(hwndDlg, IDC_CLIST), rc.left, rc.top, rc.right - rc.left, rcLog.bottom - rcLog.top, FALSE);
+ MoveWindow( GetDlgItem(hwndDlg, IDC_CLIST), rc.left, rc.top, rc.right - rc.left, rcLog.bottom - rcLog.top, FALSE);
}
if (dat->hwndIEView || dat->hwndHPP)
@@ -1927,7 +1907,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
case TABSRMM_HK_TOGGLESENDLATER:
if (sendLater->isAvail()) {
dat->sendMode ^= SMODE_SENDLATER;
- SetWindowPos(GetDlgItem(hwndDlg, IDC_MESSAGE), 0, 0, 0, 0, 0, SWP_DRAWFRAME|SWP_FRAMECHANGED|SWP_NOZORDER|
+ SetWindowPos( GetDlgItem(hwndDlg, IDC_MESSAGE), 0, 0, 0, 0, 0, SWP_DRAWFRAME|SWP_FRAMECHANGED|SWP_NOZORDER|
SWP_NOMOVE|SWP_NOSIZE|SWP_NOCOPYBITS);
RedrawWindow(hwndDlg, 0, 0, RDW_INVALIDATE|RDW_ERASE|RDW_UPDATENOW|RDW_ALLCHILDREN);
}
@@ -1970,8 +1950,8 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
if (dat->sendMode & SMODE_MULTIPLE) {
HWND hwndClist = DM_CreateClist(dat);
} else {
- if (IsWindow(GetDlgItem(hwndDlg, IDC_CLIST)))
- DestroyWindow(GetDlgItem(hwndDlg, IDC_CLIST));
+ if (IsWindow( GetDlgItem(hwndDlg, IDC_CLIST)))
+ DestroyWindow( GetDlgItem(hwndDlg, IDC_CLIST));
}
SetWindowPos(hwndEdit, 0, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOSIZE | SWP_NOMOVE);
SendMessage(hwndDlg, WM_SIZE, 0, 0);
@@ -1980,9 +1960,9 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
Utils::showDlgControl(hwndDlg, IDC_MULTISPLITTER, (dat->sendMode & SMODE_MULTIPLE) ? SW_SHOW : SW_HIDE);
Utils::showDlgControl(hwndDlg, IDC_CLIST, (dat->sendMode & SMODE_MULTIPLE) ? SW_SHOW : SW_HIDE);
if (dat->sendMode & SMODE_MULTIPLE)
- SetFocus(GetDlgItem(hwndDlg, IDC_CLIST));
+ SetFocus( GetDlgItem(hwndDlg, IDC_CLIST));
else
- SetFocus(GetDlgItem(hwndDlg, IDC_MESSAGE));
+ SetFocus( GetDlgItem(hwndDlg, IDC_MESSAGE));
RedrawWindow(hwndDlg, 0, 0, RDW_INVALIDATE|RDW_ERASE|RDW_UPDATENOW|RDW_ALLCHILDREN);
return(_dlgReturn(hwndDlg, 1));
}
@@ -2018,7 +1998,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
}
if (msg == WM_KEYDOWN) {
if ((wp == VK_INSERT && isShift && !isCtrl) || (wp == 'V' && isCtrl && !isShift && !isAlt)) {
- SendMessage(GetDlgItem(hwndDlg, IDC_MESSAGE), EM_PASTESPECIAL, CF_TEXTT, 0);
+ SendMessage( GetDlgItem(hwndDlg, IDC_MESSAGE), EM_PASTESPECIAL, CF_TEXTT, 0);
_clrMsgFilter(lParam);
return(_dlgReturn(hwndDlg, 1));
}
@@ -2055,11 +2035,11 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
return(_dlgReturn(hwndDlg, 1));
}
if (wp == VK_MULTIPLY) {
- SetFocus(GetDlgItem(hwndDlg, IDC_MESSAGE));
+ SetFocus( GetDlgItem(hwndDlg, IDC_MESSAGE));
return(_dlgReturn(hwndDlg, 1));
}
if (wp == VK_DIVIDE) {
- SetFocus(GetDlgItem(hwndDlg, IDC_LOG));
+ SetFocus( GetDlgItem(hwndDlg, IDC_LOG));
return(_dlgReturn(hwndDlg, 1));
}
if (wp == VK_ADD) {
@@ -2091,25 +2071,25 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
if (msg == WM_KEYDOWN && wp == VK_TAB) {
if (PluginConfig.m_AllowTab) {
if (((NMHDR *)lParam)->idFrom == IDC_MESSAGE)
- SendMessage(GetDlgItem(hwndDlg, IDC_MESSAGE), EM_REPLACESEL, (WPARAM)FALSE, (LPARAM)"\t");
+ SendMessage( GetDlgItem(hwndDlg, IDC_MESSAGE), EM_REPLACESEL, (WPARAM)FALSE, (LPARAM)"\t");
_clrMsgFilter(lParam);
if (((NMHDR *)lParam)->idFrom != IDC_MESSAGE)
- SetFocus(GetDlgItem(hwndDlg, IDC_MESSAGE));
+ SetFocus( GetDlgItem(hwndDlg, IDC_MESSAGE));
return(_dlgReturn(hwndDlg, 1));
}
else {
if (((NMHDR *)lParam)->idFrom == IDC_MESSAGE) {
if (GetSendButtonState(hwndDlg) != PBS_DISABLED && !(dat->pContainer->dwFlags & CNT_HIDETOOLBAR)) {
- SetFocus(GetDlgItem(hwndDlg, IDOK));
+ SetFocus( GetDlgItem(hwndDlg, IDOK));
return(_dlgReturn(hwndDlg, 1));
}
else {
- SetFocus(GetDlgItem(hwndDlg, IDC_LOG));
+ SetFocus( GetDlgItem(hwndDlg, IDC_LOG));
return(_dlgReturn(hwndDlg, 1));
}
}
if (((NMHDR *)lParam)->idFrom == IDC_LOG) {
- SetFocus(GetDlgItem(hwndDlg, IDC_MESSAGE));
+ SetFocus( GetDlgItem(hwndDlg, IDC_MESSAGE));
return(_dlgReturn(hwndDlg, 1));
}
}
@@ -2121,14 +2101,14 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
POINT pt;
GetCursorPos(&pt);
- GetWindowRect(GetDlgItem(hwndDlg, IDC_LOG), &rc);
+ GetWindowRect( GetDlgItem(hwndDlg, IDC_LOG), &rc);
if (PtInRect(&rc, pt)) {
short wDirection = (short)HIWORD(wp);
if (LOWORD(wp) & MK_SHIFT) {
if (wDirection < 0)
- SendMessage(GetDlgItem(hwndDlg, IDC_LOG), WM_VSCROLL, MAKEWPARAM(SB_PAGEDOWN, 0), 0);
+ SendMessage( GetDlgItem(hwndDlg, IDC_LOG), WM_VSCROLL, MAKEWPARAM(SB_PAGEDOWN, 0), 0);
else if (wDirection > 0)
- SendMessage(GetDlgItem(hwndDlg, IDC_LOG), WM_VSCROLL, MAKEWPARAM(SB_PAGEUP, 0), 0);
+ SendMessage( GetDlgItem(hwndDlg, IDC_LOG), WM_VSCROLL, MAKEWPARAM(SB_PAGEUP, 0), 0);
return 0;
}
return 0;
@@ -2206,25 +2186,25 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
case WM_LBUTTONUP:
if (((NMHDR *) lParam)->idFrom == IDC_LOG) {
CHARRANGE cr;
- SendMessage(GetDlgItem(hwndDlg, IDC_LOG), EM_EXGETSEL, 0, (LPARAM)&cr);
+ SendMessage( GetDlgItem(hwndDlg, IDC_LOG), EM_EXGETSEL, 0, (LPARAM)&cr);
if (cr.cpMax != cr.cpMin) {
cr.cpMin = cr.cpMax;
if (isCtrl && M->GetByte("autocopy", 1)) {
SETTEXTEX stx = {ST_KEEPUNDO | ST_SELECTION, CP_UTF8};
char *streamOut = NULL;
if (isAlt)
- streamOut = Message_GetFromStream(GetDlgItem(hwndDlg, IDC_LOG), dat, (CP_UTF8 << 16) | (SF_RTFNOOBJS | SFF_PLAINRTF | SFF_SELECTION | SF_USECODEPAGE));
+ streamOut = Message_GetFromStream( GetDlgItem(hwndDlg, IDC_LOG), dat, (CP_UTF8 << 16) | (SF_RTFNOOBJS | SFF_PLAINRTF | SFF_SELECTION | SF_USECODEPAGE));
else
- streamOut = Message_GetFromStream(GetDlgItem(hwndDlg, IDC_LOG), dat, (CP_UTF8 << 16) | (SF_TEXT | SFF_SELECTION | SF_USECODEPAGE));
+ streamOut = Message_GetFromStream( GetDlgItem(hwndDlg, IDC_LOG), dat, (CP_UTF8 << 16) | (SF_TEXT | SFF_SELECTION | SF_USECODEPAGE));
if (streamOut) {
Utils::FilterEventMarkers(streamOut);
- SendMessage(GetDlgItem(hwndDlg, IDC_MESSAGE), EM_SETTEXTEX, (WPARAM)&stx, (LPARAM)streamOut);
+ SendMessage( GetDlgItem(hwndDlg, IDC_MESSAGE), EM_SETTEXTEX, (WPARAM)&stx, (LPARAM)streamOut);
free(streamOut);
}
- SetFocus(GetDlgItem(hwndDlg, IDC_MESSAGE));
+ SetFocus( GetDlgItem(hwndDlg, IDC_MESSAGE));
} else if (M->GetByte("autocopy", 1) && !isShift) {
- SendMessage(GetDlgItem(hwndDlg, IDC_LOG), WM_COPY, 0, 0);
- SetFocus(GetDlgItem(hwndDlg, IDC_MESSAGE));
+ SendMessage( GetDlgItem(hwndDlg, IDC_LOG), WM_COPY, 0, 0);
+ SetFocus( GetDlgItem(hwndDlg, IDC_MESSAGE));
if (m_pContainer->hwndStatus)
SendMessage(m_pContainer->hwndStatus, SB_SETTEXT, 0, (LPARAM)TranslateT("Selection copied to clipboard"));
}
@@ -2312,7 +2292,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
return TRUE;
} else {
CallService(MS_UTILS_OPENURL, 1, (LPARAM) tr.lpstrText);
- SetFocus(GetDlgItem(hwndDlg, IDC_MESSAGE));
+ SetFocus( GetDlgItem(hwndDlg, IDC_MESSAGE));
}
}
mir_free(tr.lpstrText);
@@ -2371,7 +2351,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
case DM_CONFIGURETOOLBAR:
dat->showUIElements = m_pContainer->dwFlags & CNT_HIDETOOLBAR ? 0 : 1;
- SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_SPLITTER), GWL_EXSTYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_SPLITTER), GWL_EXSTYLE) & ~WS_EX_STATICEDGE);
+ SetWindowLongPtr( GetDlgItem(hwndDlg, IDC_SPLITTER), GWL_EXSTYLE, GetWindowLongPtr( GetDlgItem(hwndDlg, IDC_SPLITTER), GWL_EXSTYLE) & ~WS_EX_STATICEDGE);
if (lParam == 1) {
GetSendFormat(dat, 1);
@@ -2414,7 +2394,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
case DM_ADDDIVIDER:
if (!(dat->dwFlags & MWF_DIVIDERSET) && PluginConfig.m_UseDividers) {
- if (GetWindowTextLengthA(GetDlgItem(hwndDlg, IDC_LOG)) > 0) {
+ if (GetWindowTextLengthA( GetDlgItem(hwndDlg, IDC_LOG)) > 0) {
dat->dwFlags |= MWF_DIVIDERWANTED;
dat->dwFlags |= MWF_DIVIDERSET;
}
@@ -2438,7 +2418,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
}
}
MsgWindowUpdateState(dat, WM_SETFOCUS);
- SetFocus(GetDlgItem(hwndDlg, IDC_MESSAGE));
+ SetFocus( GetDlgItem(hwndDlg, IDC_MESSAGE));
return 1;
case WM_ACTIVATE:
@@ -2521,7 +2501,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
RECT rc;
POINT pt;
- GetClientRect(GetDlgItem(hwndDlg, IDC_LOG), &rc);
+ GetClientRect( GetDlgItem(hwndDlg, IDC_LOG), &rc);
pt.x = 0;
pt.y = wParam;
ScreenToClient(hwndDlg, &pt);
@@ -2590,53 +2570,55 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
TranslateT("Autoscrolling is disabled (press F12 to enable it)"));
return 0;
- case DM_SCROLLIEVIEW: {
- IEVIEWWINDOW iew = {0};
-
- iew.cbSize = sizeof(IEVIEWWINDOW);
- iew.iType = IEW_SCROLLBOTTOM;
- if (dat->hwndIEView) {
- iew.hwnd = dat->hwndIEView;
- CallService(MS_IEVIEW_WINDOW, 0, (LPARAM)&iew);
- } else if (dat->hwndHPP) {
- iew.hwnd = dat->hwndHPP;
- CallService(MS_HPP_EG_WINDOW, 0, (LPARAM)&iew);
+ case DM_SCROLLIEVIEW:
+ {
+ IEVIEWWINDOW iew = { sizeof(iew) };
+ iew.iType = IEW_SCROLLBOTTOM;
+ if (dat->hwndIEView) {
+ iew.hwnd = dat->hwndIEView;
+ CallService(MS_IEVIEW_WINDOW, 0, (LPARAM)&iew);
+ }
+ else if (dat->hwndHPP) {
+ iew.hwnd = dat->hwndHPP;
+ CallService(MS_HPP_EG_WINDOW, 0, (LPARAM)&iew);
+ }
}
return 0;
- }
- case DM_FORCESCROLL: {
- SCROLLINFO *psi = (SCROLLINFO *)lParam;
- POINT *ppt = (POINT *)wParam;
- HWND hwnd = GetDlgItem(hwndDlg, IDC_LOG);
- int len;
+ case DM_FORCESCROLL:
+ {
+ SCROLLINFO *psi = (SCROLLINFO *)lParam;
+ POINT *ppt = (POINT *)wParam;
- if (wParam == 0 && lParam == 0) {
- DM_ScrollToBottom(dat, 0, 1);
- return 0;
- }
+ HWND hwnd = GetDlgItem(hwndDlg, IDC_LOG);
+ int len;
- if (dat->hwndIEView == 0 && dat->hwndHPP == 0) {
- len = GetWindowTextLengthA(GetDlgItem(hwndDlg, IDC_LOG));
- SendDlgItemMessage(hwndDlg, IDC_LOG, EM_SETSEL, len - 1, len - 1);
- }
+ if (wParam == 0 && lParam == 0) {
+ DM_ScrollToBottom(dat, 0, 1);
+ return 0;
+ }
- if (psi == NULL) {
- DM_ScrollToBottom(dat, 0, 0);
- return 0;
- }
+ if (dat->hwndIEView == 0 && dat->hwndHPP == 0) {
+ len = GetWindowTextLengthA( GetDlgItem(hwndDlg, IDC_LOG));
+ SendDlgItemMessage(hwndDlg, IDC_LOG, EM_SETSEL, len - 1, len - 1);
+ }
- if ((UINT)psi->nPos >= (UINT)psi->nMax - psi->nPage - 5 || psi->nMax - psi->nMin - psi->nPage < 50)
- DM_ScrollToBottom(dat, 0, 0);
- else
- SendMessage((dat->hwndIEView || dat->hwndHPP) ? (dat->hwndIEView ? dat->hwndIEView : dat->hwndHPP) : hwnd, EM_SETSCROLLPOS, 0, (LPARAM)ppt);
+ if (psi == NULL) {
+ DM_ScrollToBottom(dat, 0, 0);
+ return 0;
+ }
+ if ((UINT)psi->nPos >= (UINT)psi->nMax - psi->nPage - 5 || psi->nMax - psi->nMin - psi->nPage < 50)
+ DM_ScrollToBottom(dat, 0, 0);
+ else
+ SendMessage((dat->hwndIEView || dat->hwndHPP) ? (dat->hwndIEView ? dat->hwndIEView : dat->hwndHPP) : hwnd, EM_SETSCROLLPOS, 0, (LPARAM)ppt);
+ }
return 0;
- }
- /*
- * this is called whenever a new event has been added to the database.
- * this CAN be posted (some sanity checks required).
- */
+
+ /*
+ * this is called whenever a new event has been added to the database.
+ * this CAN be posted (some sanity checks required).
+ */
case HM_DBEVENTADDED:
if (!dat)
return 0;
@@ -2646,6 +2628,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
return 0;
DM_EventAdded(dat, wParam, lParam);
return 0;
+
case WM_TIMER:
/*
* timer to control info panel hovering
@@ -2693,62 +2676,58 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
case DM_ERRORDECIDED:
switch (wParam) {
case MSGERROR_CANCEL:
- case MSGERROR_SENDLATER: {
- int iNextFailed;
-
- if (!(dat->dwFlags & MWF_ERRORSTATE))
- break;
-
- dat->cache->saveHistory(0, 0);
- if (wParam == MSGERROR_SENDLATER)
- sendQueue->doSendLater(dat->iCurrentQueueError, dat); // to be implemented at a later time
- dat->iOpenJobs--;
- sendQueue->dec();
- if (dat->iCurrentQueueError >= 0 && dat->iCurrentQueueError < SendQueue::NR_SENDJOBS)
- sendQueue->clearJob(dat->iCurrentQueueError);
- dat->iCurrentQueueError = -1;
- sendQueue->showErrorControls(dat, FALSE);
- if (wParam != MSGERROR_CANCEL || (wParam == MSGERROR_CANCEL && lParam == 0))
- SetDlgItemText(hwndDlg, IDC_MESSAGE, _T(""));
- sendQueue->checkQueue(dat);
- if ((iNextFailed = sendQueue->findNextFailed(dat)) >= 0)
- sendQueue->handleError(dat, iNextFailed);
- break;
- }
- case MSGERROR_RETRY: {
- int resent = 0;;
-
- if (!(dat->dwFlags & MWF_ERRORSTATE))
- break;
-
- dat->cache->saveHistory(0, 0);
- if (dat->iCurrentQueueError >= 0 && dat->iCurrentQueueError < SendQueue::NR_SENDJOBS) {
- SendJob *job = sendQueue->getJobByIndex(dat->iCurrentQueueError);
-
- if (job->hSendId == 0 && job->hOwner == 0)
- break;
- job->hSendId = (HANDLE) CallContactService(job->hOwner,
- SendQueue::MsgServiceName(job->hOwner, dat, job->dwFlags), (dat->sendMode & SMODE_FORCEANSI) ? (job->dwFlags & ~PREF_UNICODE) : job->dwFlags, (LPARAM) job->sendBuffer);
- resent++;
- }
-
- if (resent) {
+ case MSGERROR_SENDLATER:
+ if ( dat->dwFlags & MWF_ERRORSTATE) {
int iNextFailed;
- SendJob *job = sendQueue->getJobByIndex(dat->iCurrentQueueError);
-
- SetTimer(hwndDlg, TIMERID_MSGSEND + dat->iCurrentQueueError, PluginConfig.m_MsgTimeout, NULL);
- job->iStatus = SendQueue::SQ_INPROGRESS;
+ dat->cache->saveHistory(0, 0);
+ if (wParam == MSGERROR_SENDLATER)
+ sendQueue->doSendLater(dat->iCurrentQueueError, dat); // to be implemented at a later time
+ dat->iOpenJobs--;
+ sendQueue->dec();
+ if (dat->iCurrentQueueError >= 0 && dat->iCurrentQueueError < SendQueue::NR_SENDJOBS)
+ sendQueue->clearJob(dat->iCurrentQueueError);
dat->iCurrentQueueError = -1;
sendQueue->showErrorControls(dat, FALSE);
- SetDlgItemText(hwndDlg, IDC_MESSAGE, _T(""));
+ if (wParam != MSGERROR_CANCEL || (wParam == MSGERROR_CANCEL && lParam == 0))
+ SetDlgItemText(hwndDlg, IDC_MESSAGE, _T(""));
sendQueue->checkQueue(dat);
if ((iNextFailed = sendQueue->findNextFailed(dat)) >= 0)
sendQueue->handleError(dat, iNextFailed);
}
- }
- break;
+ break;
+
+ case MSGERROR_RETRY:
+ if ( dat->dwFlags & MWF_ERRORSTATE) {
+ int resent = 0;
+
+ dat->cache->saveHistory(0, 0);
+ if (dat->iCurrentQueueError >= 0 && dat->iCurrentQueueError < SendQueue::NR_SENDJOBS) {
+ SendJob *job = sendQueue->getJobByIndex(dat->iCurrentQueueError);
+
+ if (job->hSendId == 0 && job->hOwner == 0)
+ break;
+ job->hSendId = (HANDLE) CallContactService(job->hOwner,
+ SendQueue::MsgServiceName(job->hOwner, dat, job->dwFlags), (dat->sendMode & SMODE_FORCEANSI) ? (job->dwFlags & ~PREF_UNICODE) : job->dwFlags, (LPARAM) job->sendBuffer);
+ resent++;
+ }
+
+ if (resent) {
+ int iNextFailed;
+ SendJob *job = sendQueue->getJobByIndex(dat->iCurrentQueueError);
+
+ SetTimer(hwndDlg, TIMERID_MSGSEND + dat->iCurrentQueueError, PluginConfig.m_MsgTimeout, NULL);
+ job->iStatus = SendQueue::SQ_INPROGRESS;
+ dat->iCurrentQueueError = -1;
+ sendQueue->showErrorControls(dat, FALSE);
+ SetDlgItemText(hwndDlg, IDC_MESSAGE, _T(""));
+ sendQueue->checkQueue(dat);
+ if ((iNextFailed = sendQueue->findNextFailed(dat)) >= 0)
+ sendQueue->handleError(dat, iNextFailed);
+ }
+ }
}
break;
+
case DM_SELECTTAB:
SendMessage(hwndContainer, DM_SELECTTAB, wParam, lParam); // pass the msg to our container
return 0;
@@ -2769,33 +2748,35 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
* 0 if there is none
* lParam = pointer to a dword receiving the value.
*/
- case DM_QUERYLASTUNREAD: {
- DWORD *pdw = (DWORD *)lParam;
- if (pdw)
- *pdw = dat->dwTickLastEvent;
+ case DM_QUERYLASTUNREAD:
+ {
+ DWORD *pdw = (DWORD *)lParam;
+ if (pdw)
+ *pdw = dat->dwTickLastEvent;
+ }
return 0;
- }
- case DM_QUERYCONTAINER: {
- struct TContainerData **pc = (struct TContainerData **) lParam;
- if (pc)
- *pc = m_pContainer;
+
+ case DM_QUERYCONTAINER:
+ {
+ struct TContainerData **pc = (struct TContainerData **) lParam;
+ if (pc)
+ *pc = m_pContainer;
+ }
return 0;
- }
- case DM_QUERYHCONTACT: {
- HANDLE *phContact = (HANDLE *) lParam;
- if (phContact)
- *phContact = dat->hContact;
+ case DM_QUERYHCONTACT:
+ {
+ HANDLE *phContact = (HANDLE *) lParam;
+ if (phContact)
+ *phContact = dat->hContact;
+ }
return 0;
- }
case DM_UPDATELASTMESSAGE:
DM_UpdateLastMessage(dat);
return 0;
- case DM_SAVESIZE: {
- RECT rcClient;
-
+ case DM_SAVESIZE:
if (dat->dwFlags & MWF_NEEDCHECKSIZE)
lParam = 0;
@@ -2805,29 +2786,32 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
if (dat->lastMessage)
DM_UpdateLastMessage(dat);
}
- SendMessage(hwndContainer, DM_QUERYCLIENTAREA, 0, (LPARAM)&rcClient);
- MoveWindow(hwndDlg, rcClient.left, rcClient.top, (rcClient.right - rcClient.left), (rcClient.bottom - rcClient.top), TRUE);
- if (dat->dwFlags & MWF_WASBACKGROUNDCREATE) {
- dat->dwFlags &= ~MWF_WASBACKGROUNDCREATE;
- SendMessage(hwndDlg, WM_SIZE, 0, 0);
- PostMessage(hwndDlg, DM_UPDATEPICLAYOUT, 0, 0);
- if (PluginConfig.m_AutoLocaleSupport) {
- if (dat->hkl == 0)
- DM_LoadLocale(dat);
- else
- PostMessage(hwndDlg, DM_SETLOCALE, 0, 0);
+ {
+ RECT rcClient;
+ SendMessage(hwndContainer, DM_QUERYCLIENTAREA, 0, (LPARAM)&rcClient);
+ MoveWindow(hwndDlg, rcClient.left, rcClient.top, (rcClient.right - rcClient.left), (rcClient.bottom - rcClient.top), TRUE);
+ if (dat->dwFlags & MWF_WASBACKGROUNDCREATE) {
+ dat->dwFlags &= ~MWF_WASBACKGROUNDCREATE;
+ SendMessage(hwndDlg, WM_SIZE, 0, 0);
+ PostMessage(hwndDlg, DM_UPDATEPICLAYOUT, 0, 0);
+ if (PluginConfig.m_AutoLocaleSupport) {
+ if (dat->hkl == 0)
+ DM_LoadLocale(dat);
+ else
+ PostMessage(hwndDlg, DM_SETLOCALE, 0, 0);
+ }
+ if (dat->hwndIEView != 0)
+ SetFocus( GetDlgItem(hwndDlg, IDC_MESSAGE));
+ if (dat->pContainer->dwFlags & CNT_SIDEBAR)
+ dat->pContainer->SideBar->Layout();
+ } else {
+ SendMessage(hwndDlg, WM_SIZE, 0, 0);
+ if (lParam == 0)
+ PostMessage(hwndDlg, DM_FORCESCROLL, 0, 0);
}
- if (dat->hwndIEView != 0)
- SetFocus(GetDlgItem(hwndDlg, IDC_MESSAGE));
- if (dat->pContainer->dwFlags & CNT_SIDEBAR)
- dat->pContainer->SideBar->Layout();
- } else {
- SendMessage(hwndDlg, WM_SIZE, 0, 0);
- if (lParam == 0)
- PostMessage(hwndDlg, DM_FORCESCROLL, 0, 0);
}
return 0;
- }
+
case DM_CHECKSIZE:
dat->dwFlags |= MWF_NEEDCHECKSIZE;
return 0;
@@ -2838,7 +2822,8 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
SendMessage(hwndContainer, DM_QUERYPENDING, wParam, lParam);
return 0;
- case WM_LBUTTONDOWN: {
+ case WM_LBUTTONDOWN:
+ {
POINT tmp; //+ Protogenes
POINTS cur; //+ Protogenes
GetCursorPos(&tmp); //+ Protogenes
@@ -2846,90 +2831,92 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
cur.y = (SHORT)tmp.y; //+ Protogenes
if (!dat->Panel->isHovered())
SendMessage(hwndContainer, WM_NCLBUTTONDOWN, HTCAPTION, *((LPARAM*)(&cur))); //+ Protogenes
- break;
}
- case WM_LBUTTONUP: {
- POINT tmp; //+ Protogenes
- POINTS cur; //+ Protogenes
- GetCursorPos(&tmp); //+ Protogenes
- if (dat->Panel->isHovered())
- dat->Panel->handleClick(tmp);
- else {
- cur.x = (SHORT)tmp.x; //+ Protogenes
- cur.y = (SHORT)tmp.y; //+ Protogenes
- SendMessage(hwndContainer, WM_NCLBUTTONUP, HTCAPTION, *((LPARAM*)(&cur))); //+ Protogenes
- }
break;
- }
- case WM_RBUTTONUP: {
- POINT pt;
- int iSelection;
- HMENU subMenu;
- int isHandled;
- RECT rcPicture, rcPanelNick = {0};
- int menuID = 0;
-
- GetWindowRect(GetDlgItem(hwndDlg, IDC_CONTACTPIC), &rcPicture);
- rcPanelNick.left = rcPanelNick.right - 30;
- GetCursorPos(&pt);
+ case WM_LBUTTONUP:
+ {
+ POINT tmp; //+ Protogenes
+ POINTS cur; //+ Protogenes
+ GetCursorPos(&tmp); //+ Protogenes
+ if (dat->Panel->isHovered())
+ dat->Panel->handleClick(tmp);
+ else {
+ cur.x = (SHORT)tmp.x; //+ Protogenes
+ cur.y = (SHORT)tmp.y; //+ Protogenes
+ SendMessage(hwndContainer, WM_NCLBUTTONUP, HTCAPTION, *((LPARAM*)(&cur))); //+ Protogenes
+ }
+ }
+ break;
- if (dat->Panel->invokeConfigDialog(pt))
- break;
+ case WM_RBUTTONUP:
+ {
+ POINT pt;
+ HMENU subMenu;
+ RECT rcPicture, rcPanelNick = {0};
+ int menuID = 0;
- if (PtInRect(&rcPicture, pt))
- menuID = MENU_PICMENU;
+ GetWindowRect( GetDlgItem(hwndDlg, IDC_CONTACTPIC), &rcPicture);
+ rcPanelNick.left = rcPanelNick.right - 30;
+ GetCursorPos(&pt);
- if ((menuID == MENU_PICMENU && ((dat->ace ? dat->ace->hbmPic : PluginConfig.g_hbmUnknown) || dat->hOwnPic) && dat->showPic != 0)) {
- int iSelection, isHandled;
- HMENU submenu = 0;
+ if (dat->Panel->invokeConfigDialog(pt))
+ break;
- submenu = GetSubMenu(m_pContainer->hMenuContext, menuID == MENU_PICMENU ? 1 : 11);
- GetCursorPos(&pt);
- MsgWindowUpdateMenu(dat, submenu, menuID);
- iSelection = TrackPopupMenu(submenu, TPM_RETURNCMD, pt.x, pt.y, 0, hwndDlg, NULL);
- isHandled = MsgWindowMenuHandler(dat, iSelection, menuID);
- break;
- }
- subMenu = GetSubMenu(m_pContainer->hMenuContext, 0);
+ if (PtInRect(&rcPicture, pt))
+ menuID = MENU_PICMENU;
- MsgWindowUpdateMenu(dat, subMenu, MENU_TABCONTEXT);
+ if ((menuID == MENU_PICMENU && ((dat->ace ? dat->ace->hbmPic : PluginConfig.g_hbmUnknown) || dat->hOwnPic) && dat->showPic != 0)) {
+ HMENU submenu = GetSubMenu(m_pContainer->hMenuContext, menuID == MENU_PICMENU ? 1 : 11);
+ GetCursorPos(&pt);
+ MsgWindowUpdateMenu(dat, submenu, menuID);
+ iSelection = TrackPopupMenu(submenu, TPM_RETURNCMD, pt.x, pt.y, 0, hwndDlg, NULL);
+ MsgWindowMenuHandler(dat, iSelection, menuID);
+ break;
+ }
+ subMenu = GetSubMenu(m_pContainer->hMenuContext, 0);
- iSelection = TrackPopupMenu(subMenu, TPM_RETURNCMD, pt.x, pt.y, 0, hwndDlg, NULL);
- if (iSelection >= IDM_CONTAINERMENU) {
- DBVARIANT dbv = {0};
- char szIndex[10];
- char *szKey = "TAB_ContainersW";
+ MsgWindowUpdateMenu(dat, subMenu, MENU_TABCONTEXT);
- _snprintf(szIndex, 8, "%d", iSelection - IDM_CONTAINERMENU);
- if (iSelection - IDM_CONTAINERMENU >= 0) {
- if (!M->GetTString(NULL, szKey, szIndex, &dbv)) {
- SendMessage(hwndDlg, DM_CONTAINERSELECTED, 0, (LPARAM)dbv.ptszVal);
- DBFreeVariant(&dbv);
+ iSelection = TrackPopupMenu(subMenu, TPM_RETURNCMD, pt.x, pt.y, 0, hwndDlg, NULL);
+ if (iSelection >= IDM_CONTAINERMENU) {
+ DBVARIANT dbv;
+ char szIndex[10];
+ char *szKey = "TAB_ContainersW";
+
+ _snprintf(szIndex, 8, "%d", iSelection - IDM_CONTAINERMENU);
+ if (iSelection - IDM_CONTAINERMENU >= 0) {
+ if (!M->GetTString(NULL, szKey, szIndex, &dbv)) {
+ SendMessage(hwndDlg, DM_CONTAINERSELECTED, 0, (LPARAM)dbv.ptszVal);
+ DBFreeVariant(&dbv);
+ }
}
- }
- break;
+ break;
+ }
+ MsgWindowMenuHandler(dat, iSelection, MENU_TABCONTEXT);
}
- isHandled = MsgWindowMenuHandler(dat, iSelection, MENU_TABCONTEXT);
break;
- }
- case WM_MOUSEMOVE: {
- POINT pt;
- GetCursorPos(&pt);
- DM_DismissTip(dat, pt);
- dat->Panel->trackMouse(pt);
+
+ case WM_MOUSEMOVE:
+ {
+ POINT pt;
+ GetCursorPos(&pt);
+ DM_DismissTip(dat, pt);
+ dat->Panel->trackMouse(pt);
+ }
break;
- }
- case WM_MEASUREITEM: {
- LPMEASUREITEMSTRUCT lpmi = (LPMEASUREITEMSTRUCT) lParam;
- if (dat->Panel->isHovered()) {
- lpmi->itemHeight = 0;
- lpmi->itemWidth = 6;
- return(TRUE);
+
+ case WM_MEASUREITEM:
+ {
+ LPMEASUREITEMSTRUCT lpmi = (LPMEASUREITEMSTRUCT) lParam;
+ if (dat->Panel->isHovered()) {
+ lpmi->itemHeight = 0;
+ lpmi->itemWidth = 6;
+ return(TRUE);
+ }
}
return CallService(MS_CLIST_MENUMEASUREITEM, wParam, lParam);
- }
case WM_NCHITTEST:
SendMessage(hwndContainer, WM_NCHITTEST, wParam, lParam);
@@ -2986,7 +2973,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
if (GetSendButtonState(hwndDlg) == PBS_DISABLED)
break;
- streamOut = Message_GetFromStream(GetDlgItem(hwndDlg, IDC_MESSAGE), dat, final_sendformat ? 0 : (CP_UTF8 << 16) | (SF_TEXT | SF_USECODEPAGE));
+ streamOut = Message_GetFromStream( GetDlgItem(hwndDlg, IDC_MESSAGE), dat, final_sendformat ? 0 : (CP_UTF8 << 16) | (SF_TEXT | SF_USECODEPAGE));
if (streamOut != NULL) {
decoded = mir_utf8decodeW(streamOut);
if (decoded != NULL) {
@@ -3048,7 +3035,7 @@ INT_PTR CALLBACK DlgProcMessage(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
int tabCount = TabCtrl_GetItemCount(hwndTab), i;
char *szFromStream = NULL;
- szFromStream = Message_GetFromStream(GetDlgItem(hwndDlg, IDC_MESSAGE), dat, dat->SendFormat ? 0 : (CP_UTF8 << 16) | (SF_TEXT | SF_USECODEPAGE));
+ szFromStream = Message_GetFromStream( GetDlgItem(hwndDlg, IDC_MESSAGE), dat, dat->SendFormat ? 0 : (CP_UTF8 << 16) | (SF_TEXT | SF_USECODEPAGE));
ZeroMemory((void*)&tci, sizeof(tci));
tci.mask = TCIF_PARAM;
@@ -3169,7 +3156,7 @@ quote_from_last:
mir_free(szConverted);
} else {
wchar_t *converted = 0;
- szFromStream = Message_GetFromStream(GetDlgItem(hwndDlg, IDC_LOG), dat, SF_TEXT | SF_USECODEPAGE | SFF_SELECTION);
+ szFromStream = Message_GetFromStream( GetDlgItem(hwndDlg, IDC_LOG), dat, SF_TEXT | SF_USECODEPAGE | SFF_SELECTION);
converted = mir_utf8decodeW(szFromStream);
Utils::FilterEventMarkers(converted);
szQuoted = QuoteText(converted, iCharsPerLine, 0);
@@ -3178,7 +3165,7 @@ quote_from_last:
mir_free(converted);
free(szFromStream);
}
- SetFocus(GetDlgItem(hwndDlg, IDC_MESSAGE));
+ SetFocus( GetDlgItem(hwndDlg, IDC_MESSAGE));
}
break;
@@ -3221,16 +3208,14 @@ quote_from_last:
SendQueue::UpdateSaveAndSendButton(dat);
if (!(GetKeyState(VK_CONTROL) & 0x8000)) {
dat->nLastTyping = GetTickCount();
- if (GetWindowTextLength(GetDlgItem(hwndDlg, IDC_MESSAGE))) {
+ if (GetWindowTextLength( GetDlgItem(hwndDlg, IDC_MESSAGE))) {
if (dat->nTypeMode == PROTOTYPE_SELFTYPING_OFF) {
if (!(dat->dwFlags & MWF_INITMODE))
DM_NotifyTyping(dat, PROTOTYPE_SELFTYPING_ON);
}
- } else {
- if (dat->nTypeMode == PROTOTYPE_SELFTYPING_ON) {
- DM_NotifyTyping(dat, PROTOTYPE_SELFTYPING_OFF);
- }
}
+ else if (dat->nTypeMode == PROTOTYPE_SELFTYPING_ON)
+ DM_NotifyTyping(dat, PROTOTYPE_SELFTYPING_OFF);
}
}
break;
@@ -3239,16 +3224,15 @@ quote_from_last:
break;
}
break;
+
case WM_CONTEXTMENU:
{
- //mad
- DWORD idFrom=GetDlgCtrlID((HWND)wParam);
-
- if (idFrom>=MIN_CBUTTONID&&idFrom<=MAX_CBUTTONID) {
- BB_CustomButtonClick(dat,idFrom,(HWND) wParam,1);
+ DWORD idFrom = GetDlgCtrlID((HWND)wParam);
+ if (idFrom >= MIN_CBUTTONID && idFrom <= MAX_CBUTTONID) {
+ BB_CustomButtonClick(dat, idFrom, (HWND)wParam, 1);
break;
}
- //
+
if ((HWND)wParam == GetDlgItem(hwndDlg,IDC_NAME/* IDC_PROTOCOL*/) && dat->hContact != 0) {
POINT pt;
HMENU hMC;
@@ -3256,7 +3240,6 @@ quote_from_last:
GetCursorPos(&pt);
hMC = BuildMCProtocolMenu(hwndDlg);
if (hMC) {
- int iSelection = 0;
iSelection = TrackPopupMenu(hMC, TPM_RETURNCMD, pt.x, pt.y, 0, hwndDlg, NULL);
if (iSelection < 1000 && iSelection >= 100) { // the "force" submenu...
if (iSelection == 999) { // un-force
@@ -3304,7 +3287,7 @@ quote_from_last:
*/
case DM_CONTAINERSELECTED:
{
- struct TContainerData *pNewContainer = 0;
+ TContainerData *pNewContainer = 0;
TCHAR *szNewName = (TCHAR *)lParam;
if (!_tcscmp(szNewName, TranslateT("Default container")))
@@ -3408,8 +3391,7 @@ quote_from_last:
case DM_MYAVATARCHANGED:
{
const char *szProto = dat->cache->getActiveProto();
-
- if (!strcmp((char *)wParam, szProto) && lstrlenA(szProto) == lstrlenA((char *)wParam))
+ if ( !strcmp((char *)wParam, szProto) && lstrlenA(szProto) == lstrlenA((char *)wParam))
LoadOwnAvatar(dat);
}
break;
@@ -3445,17 +3427,21 @@ quote_from_last:
case DM_REMOVEPOPUPS:
DeletePopupsForContact(dat->hContact, (DWORD)wParam);
return 0;
+
case EM_THEMECHANGED:
DM_FreeTheme(dat);
return DM_ThemeChanged(dat);
+
case DM_PLAYINCOMINGSOUND:
if (!dat)
return 0;
PlayIncomingSound(dat);
return 0;
+
case DM_REFRESHTABINDEX:
dat->iTabID = GetTabIndexFromHWND(GetParent(hwndDlg), hwndDlg);
return 0;
+
case DM_STATUSICONCHANGE:
if (m_pContainer->hwndStatus) {
SendMessage(dat->pContainer->hwnd, WM_SIZE, 0, 0);
@@ -3464,6 +3450,7 @@ quote_from_last:
}
return 0;
//mad: bb-api
+
case DM_BBNEEDUPDATE:
if (lParam)
CB_ChangeButton(hwndDlg,dat,(CustomButtonData*)lParam);
@@ -3525,7 +3512,7 @@ quote_from_last:
}
char *szHTTPText = "DEBUG";
SendDlgItemMessageA(hwndDlg, IDC_MESSAGE, EM_REPLACESEL, TRUE, (LPARAM)szHTTPText);
- SetFocus(GetDlgItem(hwndDlg, IDC_MESSAGE));
+ SetFocus( GetDlgItem(hwndDlg, IDC_MESSAGE));
}
}
for (i=0;ppFiles[i];i++)
@@ -3544,56 +3531,48 @@ quote_from_last:
return 0;
case WM_CLOSE:
- {
- int iTabs, i;
- TCITEM item = {0};
- RECT rc;
- TContainerData *pContainer = dat->pContainer;
-
- // esc handles error controls if we are in error state (error controls visible)
-
- if (wParam == 0 && lParam == 0 && dat->dwFlags & MWF_ERRORSTATE) {
- SendMessage(hwndDlg, DM_ERRORDECIDED, MSGERROR_CANCEL, 0);
- return TRUE;
- }
+ // esc handles error controls if we are in error state (error controls visible)
+ if (wParam == 0 && lParam == 0 && dat->dwFlags & MWF_ERRORSTATE) {
+ SendMessage(hwndDlg, DM_ERRORDECIDED, MSGERROR_CANCEL, 0);
+ return TRUE;
+ }
- if (wParam == 0 && lParam == 0) {
- if (PluginConfig.m_EscapeCloses == 1) {
- SendMessage(hwndContainer, WM_SYSCOMMAND, SC_MINIMIZE, 0);
- return(TRUE);
- } else if (PluginConfig.m_HideOnClose && PluginConfig.m_EscapeCloses == 2) {
- ShowWindow(hwndContainer, SW_HIDE);
- return(TRUE);
- }
- _dlgReturn(hwndDlg, TRUE);
+ if (wParam == 0 && lParam == 0) {
+ if (PluginConfig.m_EscapeCloses == 1) {
+ SendMessage(hwndContainer, WM_SYSCOMMAND, SC_MINIMIZE, 0);
+ return(TRUE);
+ } else if (PluginConfig.m_HideOnClose && PluginConfig.m_EscapeCloses == 2) {
+ ShowWindow(hwndContainer, SW_HIDE);
+ return(TRUE);
}
+ _dlgReturn(hwndDlg, TRUE);
+ }
- if (dat->iOpenJobs > 0 && lParam != 2) {
- if (dat->dwFlags & MWF_ERRORSTATE)
- SendMessage(hwndDlg, DM_ERRORDECIDED, MSGERROR_CANCEL, 1);
- else if (dat) {
- LRESULT result;
+ if (dat->iOpenJobs > 0 && lParam != 2) {
+ if (dat->dwFlags & MWF_ERRORSTATE)
+ SendMessage(hwndDlg, DM_ERRORDECIDED, MSGERROR_CANCEL, 1);
+ else if (dat) {
+ LRESULT result;
- if (dat->dwFlagsEx & MWF_EX_WARNCLOSE)
- return TRUE;
+ if (dat->dwFlagsEx & MWF_EX_WARNCLOSE)
+ return TRUE;
- dat->dwFlagsEx |= MWF_EX_WARNCLOSE;
- result = SendQueue::WarnPendingJobs(0);
- dat->dwFlagsEx &= ~MWF_EX_WARNCLOSE;
- if (result == IDNO)
- return TRUE;
- }
+ dat->dwFlagsEx |= MWF_EX_WARNCLOSE;
+ result = SendQueue::WarnPendingJobs(0);
+ dat->dwFlagsEx &= ~MWF_EX_WARNCLOSE;
+ if (result == IDNO)
+ return TRUE;
}
- iTabs = TabCtrl_GetItemCount(hwndTab);
+ }
+ {
+ int iTabs = TabCtrl_GetItemCount(hwndTab);
if (iTabs == 1) {
PostMessage(hwndContainer, WM_CLOSE, 0, 1);
return 1;
}
- TStatusBarIconNode *current;
-
while (dat->pSINod) {
- current = dat->pSINod;
+ TStatusBarIconNode *current = dat->pSINod;
dat->pSINod = dat->pSINod->next;
mir_free(current->sid.szModule);
@@ -3604,7 +3583,7 @@ quote_from_last:
}
m_pContainer->iChilds--;
- i = GetTabIndexFromHWND(hwndTab, hwndDlg);
+ int i = GetTabIndexFromHWND(hwndTab, hwndDlg);
/*
* after closing a tab, we need to activate the tab to the left side of
@@ -3618,10 +3597,14 @@ quote_from_last:
else
i++;
TabCtrl_SetCurSel(hwndTab, i);
+
+ TCITEM item = {0};
item.mask = TCIF_PARAM;
TabCtrl_GetItem(hwndTab, i, &item); // retrieve dialog hwnd for the now active tab...
m_pContainer->hwndActive = (HWND) item.lParam;
+
+ RECT rc;
SendMessage(hwndContainer, DM_QUERYCLIENTAREA, 0, (LPARAM)&rc);
SetWindowPos(m_pContainer->hwndActive, HWND_TOP, rc.left, rc.top, (rc.right - rc.left), (rc.bottom - rc.top), SWP_SHOWWINDOW);
ShowWindow((HWND)item.lParam, SW_SHOW);
@@ -3634,7 +3617,7 @@ quote_from_last:
if (iTabs == 1)
PostMessage(GetParent(GetParent(hwndDlg)), WM_CLOSE, 0, 1);
else
- SendMessage(pContainer->hwnd, WM_SIZE, 0, 0);
+ SendMessage(dat->pContainer->hwnd, WM_SIZE, 0, 0);
}
break;
@@ -3667,17 +3650,15 @@ quote_from_last:
AddContactToFavorites(dat->hContact, dat->cache->getNick(), dat->cache->getActiveProto(), dat->szStatus, dat->wStatus,
LoadSkinnedProtoIcon(dat->cache->getActiveProto(), dat->cache->getActiveStatus()), 1, PluginConfig.g_hMenuRecent);
if (dat->hContact) {
-
if (!dat->fEditNotesActive) {
- char *msg = Message_GetFromStream(GetDlgItem(hwndDlg, IDC_MESSAGE), dat, (CP_UTF8 << 16) | (SF_TEXT | SF_USECODEPAGE));
+ char *msg = Message_GetFromStream( GetDlgItem(hwndDlg, IDC_MESSAGE), dat, (CP_UTF8 << 16) | (SF_TEXT | SF_USECODEPAGE));
if (msg) {
- DBWriteContactSettingString(dat->hContact, SRMSGMOD, "SavedMsg", msg);
+ db_set_utf(dat->hContact, SRMSGMOD, "SavedMsg", msg);
free(msg);
- } else
- DBWriteContactSettingString(dat->hContact, SRMSGMOD, "SavedMsg", "");
+ }
+ else db_unset(dat->hContact, SRMSGMOD, "SavedMsg");
}
- else
- SendMessage(hwndDlg, WM_COMMAND, IDC_PIC, 0);
+ else SendMessage(hwndDlg, WM_COMMAND, IDC_PIC, 0);
}
}
diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp
index 0570d4db2a..67278db5e5 100644
--- a/plugins/TabSRMM/src/msgdlgutils.cpp
+++ b/plugins/TabSRMM/src/msgdlgutils.cpp
@@ -506,7 +506,7 @@ void TSAPI UpdateReadChars(const TWindowData *dat)
szIndicators[0] = 0;
if (dat->bType == SESSIONTYPE_CHAT)
- len = GetWindowTextLength(GetDlgItem(dat->hwnd, IDC_CHAT_MESSAGE));
+ len = GetWindowTextLength( GetDlgItem(dat->hwnd, IDC_CHAT_MESSAGE));
else {
/*
* retrieve text length in UTF8 bytes, because this is the relevant length for most protocols
@@ -588,7 +588,7 @@ void TSAPI HandleIconFeedback(TWindowData *dat, HICON iIcon)
if (dat->pContainer->dwFlags & CNT_SIDEBAR)
dat->pContainer->SideBar->updateSession(dat);
else
- TabCtrl_SetItem(GetDlgItem(dat->pContainer->hwnd, IDC_MSGTABS), dat->iTabID, &item);
+ TabCtrl_SetItem( GetDlgItem(dat->pContainer->hwnd, IDC_MSGTABS), dat->iTabID, &item);
}
/*
@@ -867,12 +867,12 @@ void TSAPI AdjustBottomAvatarDisplay(TWindowData *dat)
dat->dynaSplitter = dat->splitterY - DPISCALEY_S(34);
DM_RecalcPictureSize(dat);
Utils::showDlgControl(hwndDlg, IDC_CONTACTPIC, dat->showPic ? SW_SHOW : SW_HIDE);
- InvalidateRect(GetDlgItem(hwndDlg, IDC_CONTACTPIC), NULL, TRUE);
+ InvalidateRect( GetDlgItem(hwndDlg, IDC_CONTACTPIC), NULL, TRUE);
} else {
dat->showPic = GetAvatarVisibility(hwndDlg, dat);
Utils::showDlgControl(hwndDlg, IDC_CONTACTPIC, dat->showPic ? SW_SHOW : SW_HIDE);
dat->pic.cy = dat->pic.cx = DPISCALEY_S(60);
- InvalidateRect(GetDlgItem(hwndDlg, IDC_CONTACTPIC), NULL, TRUE);
+ InvalidateRect( GetDlgItem(hwndDlg, IDC_CONTACTPIC), NULL, TRUE);
}
}
}
@@ -901,7 +901,7 @@ void TSAPI ShowPicture(TWindowData *dat, BOOL showNewPic)
dat->showPic = dat->showPic ? 0 : 1;
DBWriteContactSettingByte(dat->hContact, SRMSGMOD_T, "MOD_ShowPic", (BYTE)dat->showPic);
}
- GetWindowRect(GetDlgItem(hwndDlg, IDC_CONTACTPIC), &rc);
+ GetWindowRect( GetDlgItem(hwndDlg, IDC_CONTACTPIC), &rc);
if (dat->minEditBoxSize.cy + DPISCALEY_S(3)> dat->splitterY)
SendMessage(hwndDlg, DM_SPLITTERMOVED, (WPARAM)rc.bottom - dat->minEditBoxSize.cy, (LPARAM)GetDlgItem(hwndDlg, IDC_SPLITTER));
if (!showNewPic)
@@ -1713,8 +1713,8 @@ void TSAPI HandlePasteAndSend(const TWindowData *dat)
return; // feature disabled
}
- SendMessage(GetDlgItem(dat->hwnd, ctrlID), EM_PASTESPECIAL, CF_TEXTT, 0);
- if (GetWindowTextLengthA(GetDlgItem(dat->hwnd, ctrlID)) > 0)
+ SendMessage( GetDlgItem(dat->hwnd, ctrlID), EM_PASTESPECIAL, CF_TEXTT, 0);
+ if (GetWindowTextLengthA( GetDlgItem(dat->hwnd, ctrlID)) > 0)
SendMessage(dat->hwnd, WM_COMMAND, IDOK, 0);
}
@@ -2171,7 +2171,7 @@ void TSAPI ConfigureSmileyButton(TWindowData *dat)
{
HWND hwndDlg = dat->hwnd;
int nrSmileys = 0;
- int showToolbar = dat->pContainer->dwFlags & CNT_HIDETOOLBAR ? 0 : 1;
+ int bShowToolbar = dat->pContainer->dwFlags & CNT_HIDETOOLBAR ? 0 : 1;
int iItemID = IDC_SMILEYBTN;
if (PluginConfig.g_SmileyAddAvail) {
@@ -2182,7 +2182,7 @@ void TSAPI ConfigureSmileyButton(TWindowData *dat)
if (nrSmileys == 0 || dat->hContact == 0)
dat->doSmileys = 0;
- Utils::showDlgControl(hwndDlg, iItemID, (dat->doSmileys && showToolbar) ? SW_SHOW : SW_HIDE);
+ Utils::showDlgControl(hwndDlg, iItemID, (dat->doSmileys && bShowToolbar) ? SW_SHOW : SW_HIDE);
Utils::enableDlgControl(hwndDlg, iItemID, dat->doSmileys ? TRUE : FALSE);
}
@@ -2211,8 +2211,8 @@ LRESULT TSAPI GetSendButtonState(HWND hwnd)
void TSAPI EnableSendButton(const TWindowData *dat, int iMode)
{
HWND hwndOK;
- SendMessage(GetDlgItem(dat->hwnd, IDOK), BUTTONSETASNORMAL, iMode, 0);
- SendMessage(GetDlgItem(dat->hwnd, IDC_PIC), BUTTONSETASNORMAL, dat->fEditNotesActive ? TRUE : (!iMode && dat->iOpenJobs == 0) ? TRUE : FALSE, 0);
+ SendMessage( GetDlgItem(dat->hwnd, IDOK), BUTTONSETASNORMAL, iMode, 0);
+ SendMessage( GetDlgItem(dat->hwnd, IDC_PIC), BUTTONSETASNORMAL, dat->fEditNotesActive ? TRUE : (!iMode && dat->iOpenJobs == 0) ? TRUE : FALSE, 0);
hwndOK = GetDlgItem(GetParent(GetParent(dat->hwnd)), IDOK);
@@ -2392,7 +2392,7 @@ void TSAPI DetermineMinHeight(TWindowData* dat)
LONG height = (dat->Panel->isActive() ? dat->Panel->getHeight() + 2 : 0);
if (!(dat->pContainer->dwFlags & CNT_HIDETOOLBAR))
height += DPISCALEY_S(24); // toolbar
- GetClientRect(GetDlgItem(dat->hwnd, dat->bType == SESSIONTYPE_IM ? IDC_MESSAGE : IDC_CHAT_MESSAGE), &rc);
+ GetClientRect( GetDlgItem(dat->hwnd, dat->bType == SESSIONTYPE_IM ? IDC_MESSAGE : IDC_CHAT_MESSAGE), &rc);
height += rc.bottom; // input area
height += 40; // min space for log area and some padding
diff --git a/plugins/TabSRMM/src/msglog.cpp b/plugins/TabSRMM/src/msglog.cpp
index 047476d6fe..4a8156c1a1 100644
--- a/plugins/TabSRMM/src/msglog.cpp
+++ b/plugins/TabSRMM/src/msglog.cpp
@@ -1356,7 +1356,7 @@ void TSAPI StreamInEvents(HWND hwndDlg, HANDLE hDbEventFirst, int count, int fAp
streamData.hDbEvent = hDbEventFirst;
streamData.dlgDat = dat;
streamData.eventsToInsert = count;
- streamData.isEmpty = fAppend ? GetWindowTextLength(GetDlgItem(hwndDlg, IDC_LOG)) == 0 : 1;
+ streamData.isEmpty = fAppend ? GetWindowTextLength( GetDlgItem(hwndDlg, IDC_LOG)) == 0 : 1;
streamData.dbei = dbei_s;
stream.pfnCallback = LogStreamInEvents;
stream.dwCookie = (DWORD_PTR) & streamData;
@@ -1367,7 +1367,7 @@ void TSAPI StreamInEvents(HWND hwndDlg, HANDLE hDbEventFirst, int count, int fAp
gtxl.codepage = 1200;
gtxl.flags = GTL_DEFAULT | GTL_PRECISE | GTL_NUMCHARS;
fi.chrg.cpMin = SendDlgItemMessage(hwndDlg, IDC_LOG, EM_GETTEXTLENGTHEX, (WPARAM) & gtxl, 0);
- sel.cpMin = sel.cpMax = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_LOG));
+ sel.cpMin = sel.cpMax = GetWindowTextLength( GetDlgItem(hwndDlg, IDC_LOG));
SendDlgItemMessage(hwndDlg, IDC_LOG, EM_EXSETSEL, 0, (LPARAM) & sel);
} else {
SetDlgItemText(hwndDlg, IDC_LOG, _T(""));
@@ -1420,8 +1420,8 @@ void TSAPI StreamInEvents(HWND hwndDlg, HANDLE hDbEventFirst, int count, int fAp
SendMessage(hwndDlg, DM_FORCESCROLL, (WPARAM)&pt, (LPARAM)psi);
SendDlgItemMessage(hwndDlg, IDC_LOG, WM_SETREDRAW, TRUE, 0);
- InvalidateRect(GetDlgItem(hwndDlg, IDC_LOG), NULL, FALSE);
- EnableWindow(GetDlgItem(hwndDlg, IDC_QUOTE), dat->hDbEventLast != NULL);
+ InvalidateRect( GetDlgItem(hwndDlg, IDC_LOG), NULL, FALSE);
+ EnableWindow( GetDlgItem(hwndDlg, IDC_QUOTE), dat->hDbEventLast != NULL);
if (streamData.buffer) free(streamData.buffer);
}
diff --git a/plugins/TabSRMM/src/msgoptions.cpp b/plugins/TabSRMM/src/msgoptions.cpp
index f4abde6c78..a3d75970e0 100644
--- a/plugins/TabSRMM/src/msgoptions.cpp
+++ b/plugins/TabSRMM/src/msgoptions.cpp
@@ -231,7 +231,7 @@ static INT_PTR CALLBACK DlgProcSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
{
switch (msg) {
case WM_INITDIALOG: {
- RescanSkins(GetDlgItem(hwndDlg, IDC_SKINNAME));
+ RescanSkins( GetDlgItem(hwndDlg, IDC_SKINNAME));
BYTE loadMode = M->GetByte("skin_loadmode", 0);
TranslateDialogDefault(hwndDlg);
@@ -306,8 +306,8 @@ static INT_PTR CALLBACK DlgProcSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
break;
case IDC_RESCANSKIN:
- FreeComboData(GetDlgItem(hwndDlg, IDC_SKINNAME));
- RescanSkins(GetDlgItem(hwndDlg, IDC_SKINNAME));
+ FreeComboData( GetDlgItem(hwndDlg, IDC_SKINNAME));
+ RescanSkins( GetDlgItem(hwndDlg, IDC_SKINNAME));
break;
case IDC_THEMEEXPORT: {
@@ -407,7 +407,7 @@ static INT_PTR CALLBACK DlgProcSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
case WM_DESTROY:
KillTimer(hwndDlg, 1000);
- FreeComboData(GetDlgItem(hwndDlg, IDC_SKINNAME));
+ FreeComboData( GetDlgItem(hwndDlg, IDC_SKINNAME));
break;
}
return FALSE;
@@ -424,7 +424,7 @@ static INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LP
DWORD dwFlags = DBGetContactSettingDword(NULL, SRMSGMOD_T, "mwflags", MWF_LOG_DEFAULT);
TranslateDialogDefault(hwndDlg);
- SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_WINDOWOPTIONS), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_WINDOWOPTIONS), GWL_STYLE) | (TVS_NOHSCROLL | TVS_CHECKBOXES));
+ SetWindowLongPtr( GetDlgItem(hwndDlg, IDC_WINDOWOPTIONS), GWL_STYLE, GetWindowLongPtr( GetDlgItem(hwndDlg, IDC_WINDOWOPTIONS), GWL_STYLE) | (TVS_NOHSCROLL | TVS_CHECKBOXES));
g_himlOptions = (HIMAGELIST)SendDlgItemMessage(hwndDlg, IDC_WINDOWOPTIONS, TVM_SETIMAGELIST, TVSIL_STATE, (LPARAM)CreateStateImageList());
@@ -442,7 +442,7 @@ static INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LP
tvi.item.pszText = TranslateTS(defaultGroups[i].szName);
tvi.item.stateMask = TVIS_STATEIMAGEMASK | TVIS_EXPANDED | TVIS_BOLD;
tvi.item.state = INDEXTOSTATEIMAGEMASK(0) | TVIS_EXPANDED | TVIS_BOLD;
- defaultGroups[i].handle = (LRESULT)TreeView_InsertItem(GetDlgItem(hwndDlg, IDC_WINDOWOPTIONS), &tvi);
+ defaultGroups[i].handle = (LRESULT)TreeView_InsertItem( GetDlgItem(hwndDlg, IDC_WINDOWOPTIONS), &tvi);
}
TOptionListItem *defaultItems = CTranslator::getTree(CTranslator::TREE_MSG);
@@ -455,7 +455,7 @@ static INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LP
tvi.item.stateMask = TVIS_STATEIMAGEMASK;
if (defaultItems[i].uType == LOI_TYPE_SETTING)
tvi.item.state = INDEXTOSTATEIMAGEMASK(M->GetByte((char *)defaultItems[i].lParam, (BYTE)defaultItems[i].id) ? 3 : 2);
- defaultItems[i].handle = (LRESULT)TreeView_InsertItem(GetDlgItem(hwndDlg, IDC_WINDOWOPTIONS), &tvi);
+ defaultItems[i].handle = (LRESULT)TreeView_InsertItem( GetDlgItem(hwndDlg, IDC_WINDOWOPTIONS), &tvi);
}
SetDlgItemInt(hwndDlg, IDC_MAXAVATARHEIGHT, M->GetDword("avatarheight", 100), FALSE);
@@ -586,7 +586,7 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam,
Utils::enableDlgControl(hwndDlg, IDC_STMINSOLD, TRUE);
break;
}
- SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_LOGOPTIONS), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_LOGOPTIONS), GWL_STYLE) | (TVS_NOHSCROLL | TVS_CHECKBOXES));
+ SetWindowLongPtr( GetDlgItem(hwndDlg, IDC_LOGOPTIONS), GWL_STYLE, GetWindowLongPtr( GetDlgItem(hwndDlg, IDC_LOGOPTIONS), GWL_STYLE) | (TVS_NOHSCROLL | TVS_CHECKBOXES));
g_himlOptions = (HIMAGELIST)SendDlgItemMessage(hwndDlg, IDC_LOGOPTIONS, TVM_SETIMAGELIST, TVSIL_STATE, (LPARAM)CreateStateImageList());
ImageList_Destroy(g_himlOptions);
@@ -603,7 +603,7 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam,
tvi.item.pszText = TranslateTS(lvGroups[i].szName);
tvi.item.stateMask = TVIS_STATEIMAGEMASK | TVIS_EXPANDED | TVIS_BOLD;
tvi.item.state = INDEXTOSTATEIMAGEMASK(0) | TVIS_EXPANDED | TVIS_BOLD;
- lvGroups[i].handle = (LRESULT)TreeView_InsertItem(GetDlgItem(hwndDlg, IDC_LOGOPTIONS), &tvi);
+ lvGroups[i].handle = (LRESULT)TreeView_InsertItem( GetDlgItem(hwndDlg, IDC_LOGOPTIONS), &tvi);
}
TOptionListItem *lvItems = CTranslator::getTree(CTranslator::TREE_LOG);
@@ -618,7 +618,7 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam,
tvi.item.state = INDEXTOSTATEIMAGEMASK((dwFlags & (UINT)lvItems[i].lParam) ? 3 : 2);
else if (lvItems[i].uType == LOI_TYPE_SETTING)
tvi.item.state = INDEXTOSTATEIMAGEMASK(M->GetByte((char *)lvItems[i].lParam, lvItems[i].id) ? 3 : 2); // NOTE: was 2 : 1 without state image mask
- lvItems[i].handle = (LRESULT)TreeView_InsertItem(GetDlgItem(hwndDlg, IDC_LOGOPTIONS), &tvi);
+ lvItems[i].handle = (LRESULT)TreeView_InsertItem( GetDlgItem(hwndDlg, IDC_LOGOPTIONS), &tvi);
}
SendDlgItemMessage(hwndDlg, IDC_LOADCOUNTSPIN, UDM_SETRANGE, 0, MAKELONG(100, 0));
@@ -663,7 +663,7 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam,
}
else
{
- EnableWindow(GetDlgItem(hwndDlg, IDC_MSGLOGDIDSPLAY),FALSE);
+ EnableWindow( GetDlgItem(hwndDlg, IDC_MSGLOGDIDSPLAY),FALSE);
}
SetDlgItemText(hwndDlg, IDC_EXPLAINMSGLOGSETTINGS, TranslateT("You have chosen to use an external plugin for displaying the message history in the chat window. Most of the settings on this page are for the standard message log viewer only and will have no effect. To change the appearance of the message log, you must configure either IEView or History++."));
SendMessage(hwndDlg, WM_USER + 100, 0, 0);
@@ -679,7 +679,7 @@ static INT_PTR CALLBACK DlgProcLogOptions(HWND hwndDlg, UINT msg, WPARAM wParam,
LRESULT r = SendDlgItemMessage(hwndDlg, IDC_MSGLOGDIDSPLAY, CB_GETCURSEL, 0, 0);
Utils::showDlgControl(hwndDlg, IDC_EXPLAINMSGLOGSETTINGS, r == 0 ? SW_HIDE : SW_SHOW);
Utils::showDlgControl(hwndDlg, IDC_LOGOPTIONS, r == 0 ? SW_SHOW : SW_HIDE);
- Utils::enableDlgControl(GetDlgItem(hwndDlg, IDC_MSGLOGDIDSPLAY),r == 0 ? FALSE : TRUE);
+ Utils::enableDlgControl( GetDlgItem(hwndDlg, IDC_MSGLOGDIDSPLAY),r == 0 ? FALSE : TRUE);
for (int i=0; i < SIZEOF(__ctrls); i++)
Utils::enableDlgControl(hwndDlg, __ctrls[i], r == 0 ? TRUE : FALSE);
return 0;
@@ -900,7 +900,7 @@ static INT_PTR CALLBACK DlgProcTypeOptions(HWND hwndDlg, UINT msg, WPARAM wParam
cii.pszText = TranslateT("** Unknown contacts **");
hItemUnknown = (HANDLE) SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_ADDINFOITEM, 0, (LPARAM) & cii);
}
- SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_CLIST), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_CLIST), GWL_STYLE) | (CLS_SHOWHIDDEN));
+ SetWindowLongPtr( GetDlgItem(hwndDlg, IDC_CLIST), GWL_STYLE, GetWindowLongPtr( GetDlgItem(hwndDlg, IDC_CLIST), GWL_STYLE) | (CLS_SHOWHIDDEN));
ResetCList(hwndDlg);
RebuildList(hwndDlg, hItemNew, hItemUnknown);
@@ -924,7 +924,7 @@ static INT_PTR CALLBACK DlgProcTypeOptions(HWND hwndDlg, UINT msg, WPARAM wParam
if (!ServiceExists(MS_CLIST_SYSTRAY_NOTIFY)) {
Utils::enableDlgControl(hwndDlg, IDC_NOTIFYBALLOON, FALSE);
- SetWindowText(GetDlgItem(hwndDlg, IDC_NOTIFYBALLOON), TranslateT("Show balloon popup (unsupported system)"));
+ SetWindowText( GetDlgItem(hwndDlg, IDC_NOTIFYBALLOON), TranslateT("Show balloon popup (unsupported system)"));
}
SendDlgItemMessage(hwndDlg, IDC_MTN_POPUPMODE, CB_INSERTSTRING, -1, (LPARAM)TranslateT("Always"));
@@ -1009,7 +1009,7 @@ static INT_PTR CALLBACK DlgProcTabbedOptions(HWND hwndDlg, UINT msg, WPARAM wPar
int i;
TranslateDialogDefault(hwndDlg);
- SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_TABMSGOPTIONS), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_TABMSGOPTIONS), GWL_STYLE) | (TVS_NOHSCROLL | TVS_CHECKBOXES));
+ SetWindowLongPtr( GetDlgItem(hwndDlg, IDC_TABMSGOPTIONS), GWL_STYLE, GetWindowLongPtr( GetDlgItem(hwndDlg, IDC_TABMSGOPTIONS), GWL_STYLE) | (TVS_NOHSCROLL | TVS_CHECKBOXES));
g_himlOptions = (HIMAGELIST)SendDlgItemMessage(hwndDlg, IDC_TABMSGOPTIONS, TVM_SETIMAGELIST, TVSIL_STATE, (LPARAM)CreateStateImageList());
ImageList_Destroy(g_himlOptions);
@@ -1026,7 +1026,7 @@ static INT_PTR CALLBACK DlgProcTabbedOptions(HWND hwndDlg, UINT msg, WPARAM wPar
tvi.item.pszText = TranslateTS(tabGroups[i].szName);
tvi.item.stateMask = TVIS_STATEIMAGEMASK | TVIS_EXPANDED | TVIS_BOLD;
tvi.item.state = INDEXTOSTATEIMAGEMASK(0) | TVIS_EXPANDED | TVIS_BOLD;
- tabGroups[i].handle = (LRESULT)TreeView_InsertItem(GetDlgItem(hwndDlg, IDC_TABMSGOPTIONS), &tvi);
+ tabGroups[i].handle = (LRESULT)TreeView_InsertItem( GetDlgItem(hwndDlg, IDC_TABMSGOPTIONS), &tvi);
}
TOptionListItem *tabItems = CTranslator::getTree(CTranslator::TREE_TAB);
@@ -1039,7 +1039,7 @@ static INT_PTR CALLBACK DlgProcTabbedOptions(HWND hwndDlg, UINT msg, WPARAM wPar
tvi.item.stateMask = TVIS_STATEIMAGEMASK;
if (tabItems[i].uType == LOI_TYPE_SETTING)
tvi.item.state = INDEXTOSTATEIMAGEMASK(M->GetByte((char *)tabItems[i].lParam, (BYTE)tabItems[i].id) ? 3 : 2/*2 : 1*/);
- tabItems[i].handle = (LRESULT)TreeView_InsertItem(GetDlgItem(hwndDlg, IDC_TABMSGOPTIONS), &tvi);
+ tabItems[i].handle = (LRESULT)TreeView_InsertItem( GetDlgItem(hwndDlg, IDC_TABMSGOPTIONS), &tvi);
}
CheckDlgButton(hwndDlg, IDC_CUT_TABTITLE, M->GetByte("cuttitle", 0));
@@ -1550,8 +1550,8 @@ static INT_PTR CALLBACK DlgProcTabSrmmModernOptions(HWND hwndDlg, UINT msg, WPAR
CheckDlgButton(hwndDlg, IDC_USETABS, BST_CHECKED);
else
{
- LONG s = (GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_USETABS), GWL_STYLE) & ~BS_TYPEMASK) | BS_AUTO3STATE;
- SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_USETABS), GWL_STYLE, s);
+ LONG s = (GetWindowLongPtr( GetDlgItem(hwndDlg, IDC_USETABS), GWL_STYLE) & ~BS_TYPEMASK) | BS_AUTO3STATE;
+ SetWindowLongPtr( GetDlgItem(hwndDlg, IDC_USETABS), GWL_STYLE, s);
CheckDlgButton(hwndDlg, IDC_USETABS, BST_INDETERMINATE);
}
}
@@ -1694,7 +1694,7 @@ INT_PTR CALLBACK DlgProcSetupStatusModes(HWND hwndDlg, UINT msg, WPARAM wParam,
SetWindowText(hwndDlg, TranslateT("Choose status modes"));
for (i = ID_STATUS_ONLINE; i <= ID_STATUS_OUTTOLUNCH; i++) {
- SetWindowText(GetDlgItem(hwndDlg, i), (TCHAR *)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, (WPARAM)i, GSMDF_TCHAR));
+ SetWindowText( GetDlgItem(hwndDlg, i), (TCHAR *)CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, (WPARAM)i, GSMDF_TCHAR));
if (dwStatusMask != -1 && (dwStatusMask & (1 << (i - ID_STATUS_ONLINE))))
CheckDlgButton(hwndDlg, i, TRUE);
Utils::enableDlgControl(hwndDlg, i, dwStatusMask != -1);
diff --git a/plugins/TabSRMM/src/msgoptions_plus.cpp b/plugins/TabSRMM/src/msgoptions_plus.cpp
index 9ebb60fea0..42679b30aa 100644
--- a/plugins/TabSRMM/src/msgoptions_plus.cpp
+++ b/plugins/TabSRMM/src/msgoptions_plus.cpp
@@ -48,7 +48,7 @@ static void FillDialog(HWND hwndDlg)
tvi.item.pszText = TranslateTS(lvGroups[i].szName);
tvi.item.stateMask = TVIS_STATEIMAGEMASK | TVIS_EXPANDED | TVIS_BOLD;
tvi.item.state = INDEXTOSTATEIMAGEMASK(0) | TVIS_EXPANDED | TVIS_BOLD;
- lvGroups[i].handle = (LRESULT)TreeView_InsertItem(GetDlgItem(hwndDlg, IDC_PLUS_CHECKTREE), &tvi);
+ lvGroups[i].handle = (LRESULT)TreeView_InsertItem( GetDlgItem(hwndDlg, IDC_PLUS_CHECKTREE), &tvi);
}
TOptionListItem *lvItems = CTranslator::getTree(CTranslator::TREE_MODPLUS);
@@ -61,7 +61,7 @@ static void FillDialog(HWND hwndDlg)
tvi.item.stateMask = TVIS_STATEIMAGEMASK;
if (lvItems[i].uType == LOI_TYPE_SETTING)
tvi.item.state = INDEXTOSTATEIMAGEMASK(M->GetByte((char *)lvItems[i].lParam, lvItems[i].id) ? 3 : 2); // NOTE: was 2 : 1 without state image mask
- lvItems[i].handle = (LRESULT)TreeView_InsertItem(GetDlgItem(hwndDlg, IDC_PLUS_CHECKTREE), &tvi);
+ lvItems[i].handle = (LRESULT)TreeView_InsertItem( GetDlgItem(hwndDlg, IDC_PLUS_CHECKTREE), &tvi);
}
PluginConfig.g_bClientInStatusBar = M->GetByte("adv_ClientIconInStatusBar", 0);
@@ -78,7 +78,7 @@ INT_PTR CALLBACK PlusOptionsProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lPar
switch(msg) {
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
- SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_PLUS_CHECKTREE), GWL_STYLE, GetWindowLongPtr(GetDlgItem(hwndDlg, IDC_PLUS_CHECKTREE), GWL_STYLE) | (TVS_NOHSCROLL | TVS_CHECKBOXES));
+ SetWindowLongPtr( GetDlgItem(hwndDlg, IDC_PLUS_CHECKTREE), GWL_STYLE, GetWindowLongPtr( GetDlgItem(hwndDlg, IDC_PLUS_CHECKTREE), GWL_STYLE) | (TVS_NOHSCROLL | TVS_CHECKBOXES));
g_himlOptions = (HIMAGELIST)SendDlgItemMessage(hwndDlg, IDC_PLUS_CHECKTREE, TVM_SETIMAGELIST, TVSIL_STATE, (LPARAM)CreateStateImageList());
ImageList_Destroy(g_himlOptions);
@@ -165,7 +165,7 @@ INT_PTR CALLBACK PlusOptionsProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARAM lPar
if (lvItems[i].uType == LOI_TYPE_SETTING)
M->WriteByte(SRMSGMOD_T, (char *)lvItems[i].lParam, (BYTE)lvItems[i].id);
- TreeView_DeleteAllItems(GetDlgItem(hwndDlg, IDC_PLUS_CHECKTREE));
+ TreeView_DeleteAllItems( GetDlgItem(hwndDlg, IDC_PLUS_CHECKTREE));
FillDialog(hwndDlg);
break;
}
diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp
index b08d31f0a9..4da1d72c94 100644
--- a/plugins/TabSRMM/src/msgs.cpp
+++ b/plugins/TabSRMM/src/msgs.cpp
@@ -617,8 +617,8 @@ int TSAPI ActivateExistingTab(TContainerData *pContainer, HWND hwndChild)
if (dat && pContainer) {
ZeroMemory((void*)&nmhdr, sizeof(nmhdr));
nmhdr.code = TCN_SELCHANGE;
- if (TabCtrl_GetItemCount(GetDlgItem(pContainer->hwnd, IDC_MSGTABS)) > 1 && !(pContainer->dwFlags & CNT_DEFERREDTABSELECT)) {
- TabCtrl_SetCurSel(GetDlgItem(pContainer->hwnd, IDC_MSGTABS), GetTabIndexFromHWND(GetDlgItem(pContainer->hwnd, IDC_MSGTABS), hwndChild));
+ if (TabCtrl_GetItemCount( GetDlgItem(pContainer->hwnd, IDC_MSGTABS)) > 1 && !(pContainer->dwFlags & CNT_DEFERREDTABSELECT)) {
+ TabCtrl_SetCurSel( GetDlgItem(pContainer->hwnd, IDC_MSGTABS), GetTabIndexFromHWND( GetDlgItem(pContainer->hwnd, IDC_MSGTABS), hwndChild));
SendMessage(pContainer->hwnd, WM_NOTIFY, 0, (LPARAM) &nmhdr); // just select the tab and let WM_NOTIFY do the rest
}
if (dat->bType == SESSIONTYPE_IM)
@@ -650,7 +650,7 @@ int TSAPI ActivateExistingTab(TContainerData *pContainer, HWND hwndChild)
else if (GetForegroundWindow() != pContainer->hwnd)
SetForegroundWindow(pContainer->hwnd);
if (dat->bType == SESSIONTYPE_IM)
- SetFocus(GetDlgItem(hwndChild, IDC_MESSAGE));
+ SetFocus( GetDlgItem(hwndChild, IDC_MESSAGE));
return TRUE;
} else
return FALSE;
@@ -752,7 +752,7 @@ HWND TSAPI CreateNewTabForContact(struct TContainerData *pContainer, HANDLE hCon
newItem = TabCtrl_InsertItem(hwndTab, pContainer->iTabIndex, &newData.item);
SendMessage(hwndTab, EM_REFRESHWITHOUTCLIP, 0, 0);
if (bActivateTab)
- TabCtrl_SetCurSel(GetDlgItem(pContainer->hwnd, IDC_MSGTABS), newItem);
+ TabCtrl_SetCurSel( GetDlgItem(pContainer->hwnd, IDC_MSGTABS), newItem);
newData.iTabID = newItem;
newData.iTabImage = newData.item.iImage;
newData.pContainer = pContainer;
diff --git a/plugins/TabSRMM/src/selectcontainer.cpp b/plugins/TabSRMM/src/selectcontainer.cpp
index dd9eb22145..7e83c22c10 100644
--- a/plugins/TabSRMM/src/selectcontainer.cpp
+++ b/plugins/TabSRMM/src/selectcontainer.cpp
@@ -108,9 +108,9 @@ INT_PTR CALLBACK SelectContainerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
int iLen, iItem;
struct TContainerData *pCurrent = pFirstContainer;
- iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_NEWCONTAINERNAME));
+ iLen = GetWindowTextLength( GetDlgItem(hwndDlg, IDC_NEWCONTAINERNAME));
if (iLen) {
- GetWindowText(GetDlgItem(hwndDlg, IDC_NEWCONTAINERNAME), szNewName, CONTAINER_NAMELEN);
+ GetWindowText( GetDlgItem(hwndDlg, IDC_NEWCONTAINERNAME), szNewName, CONTAINER_NAMELEN);
if (!_tcsncmp(szNewName, CGlobals::m_default_container_name, CONTAINER_NAMELEN) || !_tcsncmp(szNewName, TranslateT("Default container"), CONTAINER_NAMELEN)) {
MessageBox(hwndDlg, TranslateT("You cannot rename the default container"), TranslateT("Error"), MB_OK | MB_ICONERROR);
break;
@@ -122,7 +122,7 @@ INT_PTR CALLBACK SelectContainerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_GETTEXT, (WPARAM) iItem, (LPARAM) szOldName);
if (lstrlen(szOldName) == lstrlen(szNewName)) {
MessageBox(0, TranslateT("This name is already in use"), TranslateT("Error"), MB_OK | MB_ICONERROR);
- SetFocus(GetDlgItem(hwndDlg, IDC_NEWCONTAINERNAME));
+ SetFocus( GetDlgItem(hwndDlg, IDC_NEWCONTAINERNAME));
break;
}
}
@@ -152,15 +152,15 @@ INT_PTR CALLBACK SelectContainerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
int iLen, iItem;
TCHAR szNewName[CONTAINER_NAMELEN], szName[CONTAINER_NAMELEN + 1];
- iLen = GetWindowTextLength(GetDlgItem(hwndDlg, IDC_NEWCONTAINER));
+ iLen = GetWindowTextLength( GetDlgItem(hwndDlg, IDC_NEWCONTAINER));
if (iLen) {
- GetWindowText(GetDlgItem(hwndDlg, IDC_NEWCONTAINER), szNewName, CONTAINER_NAMELEN);
+ GetWindowText( GetDlgItem(hwndDlg, IDC_NEWCONTAINER), szNewName, CONTAINER_NAMELEN);
iItem = SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_FINDSTRING, (WPARAM) - 1, (LPARAM) szNewName);
if (iItem != LB_ERR || !_tcsncmp(szNewName, CGlobals::m_default_container_name, CONTAINER_NAMELEN)) {
SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_GETTEXT, (WPARAM)iItem, (LPARAM)szName);
if (lstrlen(szName) == lstrlen(szNewName) || !_tcsncmp(szNewName, CGlobals::m_default_container_name, CONTAINER_NAMELEN)) {
MessageBox(0, TranslateT("This name is already in use"), TranslateT("Error"), MB_OK | MB_ICONERROR);
- SetFocus(GetDlgItem(hwndDlg, IDC_NEWCONTAINER));
+ SetFocus( GetDlgItem(hwndDlg, IDC_NEWCONTAINER));
break;
}
}
diff --git a/plugins/TabSRMM/src/sendqueue.cpp b/plugins/TabSRMM/src/sendqueue.cpp
index e2a609db61..64839b95ff 100644
--- a/plugins/TabSRMM/src/sendqueue.cpp
+++ b/plugins/TabSRMM/src/sendqueue.cpp
@@ -156,7 +156,7 @@ entry_found:
dat->cache->saveHistory(0, 0);
::SetDlgItemText(hwndDlg, IDC_MESSAGE, _T(""));
- ::SetFocus(GetDlgItem(hwndDlg, IDC_MESSAGE));
+ ::SetFocus( GetDlgItem(hwndDlg, IDC_MESSAGE));
UpdateSaveAndSendButton(dat);
sendQueued(dat, iFound);
@@ -617,7 +617,7 @@ void SendQueue::showErrorControls(TWindowData *dat, const int showCmd) const
dat->hTabIcon = PluginConfig.g_iconErr;
item.mask = TCIF_IMAGE;
item.iImage = 0;
- TabCtrl_SetItem(GetDlgItem(dat->pContainer->hwnd, IDC_MSGTABS), dat->iTabID, &item);
+ TabCtrl_SetItem( GetDlgItem(dat->pContainer->hwnd, IDC_MSGTABS), dat->iTabID, &item);
dat->dwFlags |= MWF_ERRORSTATE;
}
else {
@@ -626,7 +626,7 @@ void SendQueue::showErrorControls(TWindowData *dat, const int showCmd) const
}
for (i=0; i < 5; i++) {
- if (IsWindow(GetDlgItem(hwndDlg, myerrorControls[i])))
+ if (IsWindow( GetDlgItem(hwndDlg, myerrorControls[i])))
Utils::showDlgControl(hwndDlg, myerrorControls[i], showCmd ? SW_SHOW : SW_HIDE);
}
@@ -638,7 +638,7 @@ void SendQueue::showErrorControls(TWindowData *dat, const int showCmd) const
void SendQueue::recallFailed(const TWindowData *dat, int iEntry) const
{
- int iLen = GetWindowTextLengthA(GetDlgItem(dat->hwnd, IDC_MESSAGE));
+ int iLen = GetWindowTextLengthA( GetDlgItem(dat->hwnd, IDC_MESSAGE));
if (dat) {
NotifyDeliveryFailure(dat);
diff --git a/plugins/TabSRMM/src/tabctrl.cpp b/plugins/TabSRMM/src/tabctrl.cpp
index 714a362291..f4509a679d 100644
--- a/plugins/TabSRMM/src/tabctrl.cpp
+++ b/plugins/TabSRMM/src/tabctrl.cpp
@@ -862,7 +862,7 @@ page_done:
FillRect(hdc, &rcPage, CSkin::m_BrushBack);
rcPage.top = 0;
}
- GetWindowRect(GetDlgItem(tabdat->helperDat->hwnd, tabdat->helperDat->bType == SESSIONTYPE_IM ? IDC_LOG : IDC_CHAT_LOG), &rcLog);
+ GetWindowRect( GetDlgItem(tabdat->helperDat->hwnd, tabdat->helperDat->bType == SESSIONTYPE_IM ? IDC_LOG : IDC_CHAT_LOG), &rcLog);
pt.y = rcLog.top;
pt.x = rcLog.left;
ScreenToClient(hwnd, &pt);
@@ -1491,8 +1491,8 @@ INT_PTR CALLBACK DlgProcTabConfig(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
FreeTabConfig();
ReloadTabConfig();
while (pContainer) {
- TabCtrl_SetPadding(GetDlgItem(pContainer->hwnd, IDC_MSGTABS), GetDlgItemInt(hwndDlg, IDC_HTABPADDING, NULL, FALSE), GetDlgItemInt(hwndDlg, IDC_TABPADDING, NULL, FALSE));
- RedrawWindow(GetDlgItem(pContainer->hwnd, IDC_MSGTABS), NULL, NULL, RDW_INVALIDATE | RDW_ERASE);
+ TabCtrl_SetPadding( GetDlgItem(pContainer->hwnd, IDC_MSGTABS), GetDlgItemInt(hwndDlg, IDC_HTABPADDING, NULL, FALSE), GetDlgItemInt(hwndDlg, IDC_TABPADDING, NULL, FALSE));
+ RedrawWindow( GetDlgItem(pContainer->hwnd, IDC_MSGTABS), NULL, NULL, RDW_INVALIDATE | RDW_ERASE);
pContainer = pContainer->pNextContainer;
}
return TRUE;
diff --git a/plugins/TabSRMM/src/templates.cpp b/plugins/TabSRMM/src/templates.cpp
index 94b7f53425..e99a6bc741 100644
--- a/plugins/TabSRMM/src/templates.cpp
+++ b/plugins/TabSRMM/src/templates.cpp
@@ -193,7 +193,7 @@ INT_PTR CALLBACK DlgProcTemplateEditor(HWND hwndDlg, UINT msg, WPARAM wParam, LP
SendDlgItemMessage(hwndDlg, IDC_COLOR3, CPM_SETCOLOUR, 0, M->GetDword("cc3", SRMSGDEFSET_BKGCOLOUR));
SendDlgItemMessage(hwndDlg, IDC_COLOR4, CPM_SETCOLOUR, 0, M->GetDword("cc4", SRMSGDEFSET_BKGCOLOUR));
SendDlgItemMessage(hwndDlg, IDC_COLOR5, CPM_SETCOLOUR, 0, M->GetDword("cc5", SRMSGDEFSET_BKGCOLOUR));
- SendMessage(GetDlgItem(hwndDlg, IDC_EDITTEMPLATE), EM_SETREADONLY, TRUE, 0);
+ SendMessage( GetDlgItem(hwndDlg, IDC_EDITTEMPLATE), EM_SETREADONLY, TRUE, 0);
}
return TRUE;
@@ -224,8 +224,8 @@ INT_PTR CALLBACK DlgProcTemplateEditor(HWND hwndDlg, UINT msg, WPARAM wParam, LP
teInfo->inEdit = iIndex;
teInfo->changed = FALSE;
teInfo->selchanging = FALSE;
- SetFocus(GetDlgItem(hwndDlg, IDC_EDITTEMPLATE));
- SendMessage(GetDlgItem(hwndDlg, IDC_EDITTEMPLATE), EM_SETREADONLY, FALSE, 0);
+ SetFocus( GetDlgItem(hwndDlg, IDC_EDITTEMPLATE));
+ SendMessage( GetDlgItem(hwndDlg, IDC_EDITTEMPLATE), EM_SETREADONLY, FALSE, 0);
}
break;
@@ -237,7 +237,7 @@ INT_PTR CALLBACK DlgProcTemplateEditor(HWND hwndDlg, UINT msg, WPARAM wParam, LP
teInfo->inEdit = iIndex;
teInfo->changed = FALSE;
}
- SendMessage(GetDlgItem(hwndDlg, IDC_EDITTEMPLATE), EM_SETREADONLY, TRUE, 0);
+ SendMessage( GetDlgItem(hwndDlg, IDC_EDITTEMPLATE), EM_SETREADONLY, TRUE, 0);
}
break;
@@ -255,14 +255,14 @@ INT_PTR CALLBACK DlgProcTemplateEditor(HWND hwndDlg, UINT msg, WPARAM wParam, LP
Utils::enableDlgControl(hwndDlg, IDC_TEMPLATELIST, FALSE);
Utils::enableDlgControl(hwndDlg, IDC_REVERT, TRUE);
}
- InvalidateRect(GetDlgItem(hwndDlg, IDC_TEMPLATELIST), NULL, FALSE);
+ InvalidateRect( GetDlgItem(hwndDlg, IDC_TEMPLATELIST), NULL, FALSE);
}
break;
case IDC_SAVETEMPLATE:
{
TCHAR newTemplate[TEMPLATE_LENGTH + 2];
- GetWindowText(GetDlgItem(hwndDlg, IDC_EDITTEMPLATE), newTemplate, TEMPLATE_LENGTH);
+ GetWindowText( GetDlgItem(hwndDlg, IDC_EDITTEMPLATE), newTemplate, TEMPLATE_LENGTH);
CopyMemory(tSet->szTemplates[teInfo->inEdit], newTemplate, sizeof(TCHAR) * TEMPLATE_LENGTH);
teInfo->changed = FALSE;
teInfo->updateInfo[teInfo->inEdit] = FALSE;
@@ -270,9 +270,9 @@ INT_PTR CALLBACK DlgProcTemplateEditor(HWND hwndDlg, UINT msg, WPARAM wParam, LP
Utils::enableDlgControl(hwndDlg, IDC_FORGET, FALSE);
Utils::enableDlgControl(hwndDlg, IDC_TEMPLATELIST, TRUE);
Utils::enableDlgControl(hwndDlg, IDC_REVERT, FALSE);
- InvalidateRect(GetDlgItem(hwndDlg, IDC_TEMPLATELIST), NULL, FALSE);
+ InvalidateRect( GetDlgItem(hwndDlg, IDC_TEMPLATELIST), NULL, FALSE);
M->WriteTString(teInfo->hContact, teInfo->rtl ? RTLTEMPLATES_MODULE : TEMPLATES_MODULE, TemplateNames[teInfo->inEdit], newTemplate);
- SendMessage(GetDlgItem(hwndDlg, IDC_EDITTEMPLATE), EM_SETREADONLY, TRUE, 0);
+ SendMessage( GetDlgItem(hwndDlg, IDC_EDITTEMPLATE), EM_SETREADONLY, TRUE, 0);
}
break;
@@ -281,14 +281,14 @@ INT_PTR CALLBACK DlgProcTemplateEditor(HWND hwndDlg, UINT msg, WPARAM wParam, LP
teInfo->updateInfo[teInfo->inEdit] = FALSE;
teInfo->selchanging = TRUE;
SetDlgItemText(hwndDlg, IDC_EDITTEMPLATE, tSet->szTemplates[teInfo->inEdit]);
- SetFocus(GetDlgItem(hwndDlg, IDC_EDITTEMPLATE));
- InvalidateRect(GetDlgItem(hwndDlg, IDC_TEMPLATELIST), NULL, FALSE);
+ SetFocus( GetDlgItem(hwndDlg, IDC_EDITTEMPLATE));
+ InvalidateRect( GetDlgItem(hwndDlg, IDC_TEMPLATELIST), NULL, FALSE);
Utils::enableDlgControl(hwndDlg, IDC_SAVETEMPLATE, FALSE);
Utils::enableDlgControl(hwndDlg, IDC_FORGET, FALSE);
Utils::enableDlgControl(hwndDlg, IDC_TEMPLATELIST, TRUE);
Utils::enableDlgControl(hwndDlg, IDC_REVERT, FALSE);
teInfo->selchanging = FALSE;
- SendMessage(GetDlgItem(hwndDlg, IDC_EDITTEMPLATE), EM_SETREADONLY, TRUE, 0);
+ SendMessage( GetDlgItem(hwndDlg, IDC_EDITTEMPLATE), EM_SETREADONLY, TRUE, 0);
break;
case IDC_REVERT:
@@ -298,14 +298,14 @@ INT_PTR CALLBACK DlgProcTemplateEditor(HWND hwndDlg, UINT msg, WPARAM wParam, LP
CopyMemory(tSet->szTemplates[teInfo->inEdit], LTR_Default.szTemplates[teInfo->inEdit], sizeof(TCHAR) * TEMPLATE_LENGTH);
SetDlgItemText(hwndDlg, IDC_EDITTEMPLATE, tSet->szTemplates[teInfo->inEdit]);
DBDeleteContactSetting(teInfo->hContact, teInfo->rtl ? RTLTEMPLATES_MODULE : TEMPLATES_MODULE, TemplateNames[teInfo->inEdit]);
- SetFocus(GetDlgItem(hwndDlg, IDC_EDITTEMPLATE));
- InvalidateRect(GetDlgItem(hwndDlg, IDC_TEMPLATELIST), NULL, FALSE);
+ SetFocus( GetDlgItem(hwndDlg, IDC_EDITTEMPLATE));
+ InvalidateRect( GetDlgItem(hwndDlg, IDC_TEMPLATELIST), NULL, FALSE);
teInfo->selchanging = FALSE;
Utils::enableDlgControl(hwndDlg, IDC_SAVETEMPLATE, FALSE);
Utils::enableDlgControl(hwndDlg, IDC_REVERT, FALSE);
Utils::enableDlgControl(hwndDlg, IDC_FORGET, FALSE);
Utils::enableDlgControl(hwndDlg, IDC_TEMPLATELIST, TRUE);
- SendMessage(GetDlgItem(hwndDlg, IDC_EDITTEMPLATE), EM_SETREADONLY, TRUE, 0);
+ SendMessage( GetDlgItem(hwndDlg, IDC_EDITTEMPLATE), EM_SETREADONLY, TRUE, 0);
break;
case IDC_UPDATEPREVIEW:
@@ -365,7 +365,7 @@ INT_PTR CALLBACK DlgProcTemplateEditor(HWND hwndDlg, UINT msg, WPARAM wParam, LP
dbei.flags |= (teInfo->rtl ? DBEF_RTL : 0);
dat->lastEventTime = (iIndex == 4 || iIndex == 5) ? time(NULL) - 1 : 0;
dat->iLastEventType = MAKELONG(dbei.flags, dbei.eventType);
- SetWindowText(GetDlgItem(hwndDlg, IDC_PREVIEW), _T(""));
+ SetWindowText( GetDlgItem(hwndDlg, IDC_PREVIEW), _T(""));
dat->dwFlags = MWF_LOG_ALL;
dat->dwFlags = (teInfo->rtl ? dat->dwFlags | MWF_LOG_RTL : dat->dwFlags & ~MWF_LOG_RTL);
dat->dwFlags = (iIndex == 0 || iIndex == 1) ? dat->dwFlags & ~MWF_LOG_GROUPMODE : dat->dwFlags | MWF_LOG_GROUPMODE;
diff --git a/plugins/TabSRMM/src/themes.cpp b/plugins/TabSRMM/src/themes.cpp
index f2c0a8e1f3..39d7462774 100644
--- a/plugins/TabSRMM/src/themes.cpp
+++ b/plugins/TabSRMM/src/themes.cpp
@@ -2539,10 +2539,10 @@ void CSkin::initAeroEffect()
TContainerData *pContainer = pFirstContainer;
while (pContainer) {
- InvalidateRect(GetDlgItem(pContainer->hwnd, IDC_MSGTABS), NULL, TRUE);
+ InvalidateRect( GetDlgItem(pContainer->hwnd, IDC_MSGTABS), NULL, TRUE);
InvalidateRect(pContainer->hwnd, NULL, TRUE);
- if (IsWindow(GetDlgItem(pContainer->hwnd, 5000)))
- InvalidateRect(GetDlgItem(pContainer->hwnd, 5000), NULL, TRUE);
+ if (IsWindow( GetDlgItem(pContainer->hwnd, 5000)))
+ InvalidateRect( GetDlgItem(pContainer->hwnd, 5000), NULL, TRUE);
pContainer = pContainer->pNextContainer;
}
}
diff --git a/plugins/TabSRMM/src/userprefs.cpp b/plugins/TabSRMM/src/userprefs.cpp
index 7a99d15480..6f465f4d91 100644
--- a/plugins/TabSRMM/src/userprefs.cpp
+++ b/plugins/TabSRMM/src/userprefs.cpp
@@ -490,7 +490,7 @@ INT_PTR CALLBACK DlgProcUserPrefsFrame(HWND hwndDlg, UINT msg, WPARAM wParam, LP
tci.mask = TCIF_PARAM | TCIF_TEXT;
tci.lParam = (LPARAM)CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_USERPREFS), hwndDlg, DlgProcUserPrefs, (LPARAM)hContact);
tci.pszText = TranslateT("General");
- TabCtrl_InsertItem(GetDlgItem(hwndDlg, IDC_OPTIONSTAB), 0, &tci);
+ TabCtrl_InsertItem( GetDlgItem(hwndDlg, IDC_OPTIONSTAB), 0, &tci);
MoveWindow((HWND)tci.lParam, 6, DPISCALEY_S(32), rcClient.right - 12, rcClient.bottom - DPISCALEY_S(80), 1);
ShowWindow((HWND)tci.lParam, SW_SHOW);
if (CMimAPI::m_pfnEnableThemeDialogTexture)
@@ -499,12 +499,12 @@ INT_PTR CALLBACK DlgProcUserPrefsFrame(HWND hwndDlg, UINT msg, WPARAM wParam, LP
tci.lParam = (LPARAM)CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_USERPREFS1), hwndDlg, DlgProcUserPrefsLogOptions, (LPARAM)hContact);
tci.pszText = TranslateT("Message Log");
- TabCtrl_InsertItem(GetDlgItem(hwndDlg, IDC_OPTIONSTAB), 1, &tci);
+ TabCtrl_InsertItem( GetDlgItem(hwndDlg, IDC_OPTIONSTAB), 1, &tci);
MoveWindow((HWND)tci.lParam, 6, DPISCALEY_S(32), rcClient.right - 12, rcClient.bottom - DPISCALEY_S(80), 1);
ShowWindow((HWND)tci.lParam, SW_HIDE);
if (CMimAPI::m_pfnEnableThemeDialogTexture)
CMimAPI::m_pfnEnableThemeDialogTexture((HWND)tci.lParam, ETDT_ENABLETAB);
- TabCtrl_SetCurSel(GetDlgItem(hwndDlg, IDC_OPTIONSTAB), 0);
+ TabCtrl_SetCurSel( GetDlgItem(hwndDlg, IDC_OPTIONSTAB), 0);
ShowWindow(hwndDlg, SW_SHOW);
return TRUE;
}
@@ -516,7 +516,7 @@ INT_PTR CALLBACK DlgProcUserPrefsFrame(HWND hwndDlg, UINT msg, WPARAM wParam, LP
TCITEM tci;
tci.mask = TCIF_PARAM;
- TabCtrl_GetItem(GetDlgItem(hwndDlg, IDC_OPTIONSTAB), TabCtrl_GetCurSel(GetDlgItem(hwndDlg, IDC_OPTIONSTAB)), &tci);
+ TabCtrl_GetItem( GetDlgItem(hwndDlg, IDC_OPTIONSTAB), TabCtrl_GetCurSel( GetDlgItem(hwndDlg, IDC_OPTIONSTAB)), &tci);
ShowWindow((HWND)tci.lParam, SW_HIDE);
}
break;
@@ -524,7 +524,7 @@ INT_PTR CALLBACK DlgProcUserPrefsFrame(HWND hwndDlg, UINT msg, WPARAM wParam, LP
TCITEM tci;
tci.mask = TCIF_PARAM;
- TabCtrl_GetItem(GetDlgItem(hwndDlg, IDC_OPTIONSTAB), TabCtrl_GetCurSel(GetDlgItem(hwndDlg, IDC_OPTIONSTAB)), &tci);
+ TabCtrl_GetItem( GetDlgItem(hwndDlg, IDC_OPTIONSTAB), TabCtrl_GetCurSel( GetDlgItem(hwndDlg, IDC_OPTIONSTAB)), &tci);
ShowWindow((HWND)tci.lParam, SW_SHOW);
}
break;
@@ -542,9 +542,9 @@ INT_PTR CALLBACK DlgProcUserPrefsFrame(HWND hwndDlg, UINT msg, WPARAM wParam, LP
tci.mask = TCIF_PARAM;
- count = TabCtrl_GetItemCount(GetDlgItem(hwndDlg, IDC_OPTIONSTAB));
+ count = TabCtrl_GetItemCount( GetDlgItem(hwndDlg, IDC_OPTIONSTAB));
for (i=0;i < count;i++) {
- TabCtrl_GetItem(GetDlgItem(hwndDlg, IDC_OPTIONSTAB), i, &tci);
+ TabCtrl_GetItem( GetDlgItem(hwndDlg, IDC_OPTIONSTAB), i, &tci);
SendMessage((HWND)tci.lParam, WM_COMMAND, WM_USER + 100, (LPARAM)&dwActionToTake);
}
if (hwnd) {