summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-05-05 22:15:11 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-05-05 22:15:11 +0000
commitb0782cc92dbcf328a47c7a702386723d15e56497 (patch)
tree4502cc006ffed030b93a57d7c6f5ec59d8d97e49
parent2aabf6594cb0fb4f8db16771c988bf5a6eab2c4b (diff)
some another sudden Unicode appearances
git-svn-id: http://svn.miranda-ng.org/main/trunk@13457 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--plugins/DbEditorPP/src/moduletree.cpp175
-rw-r--r--plugins/NewAwaySysMod/src/MsgTree.cpp10
-rw-r--r--plugins/Popup/src/opt_class.cpp3
-rw-r--r--plugins/QuickMessages/src/options.cpp78
-rw-r--r--plugins/TabSRMM/src/msgoptions.cpp31
-rw-r--r--plugins/TrafficCounter/src/opttree.cpp22
-rw-r--r--protocols/JabberG/src/jabber_disco.cpp29
-rw-r--r--protocols/JabberG/src/jabber_opttree.cpp23
-rw-r--r--protocols/Xfire/src/options.cpp6
9 files changed, 159 insertions, 218 deletions
diff --git a/plugins/DbEditorPP/src/moduletree.cpp b/plugins/DbEditorPP/src/moduletree.cpp
index 62044be21e..171cc0d808 100644
--- a/plugins/DbEditorPP/src/moduletree.cpp
+++ b/plugins/DbEditorPP/src/moduletree.cpp
@@ -396,7 +396,7 @@ void __cdecl PopulateModuleTreeThreadFunc(LPVOID di)
case 2: // restore saved
if (GetValue(NULL, modname, "LastModule", SelectedModule, SIZEOF(SelectedModule))) {
- hSelectedContact = db_get_dw(NULL, modname, "LastContact", (DWORD)INVALID_HANDLE_VALUE);
+ hSelectedContact = db_get_dw(NULL, modname, "LastContact", INVALID_CONTACT_ID);
if (hSelectedContact != INVALID_CONTACT_ID)
Select = 1;
GetValue(NULL, modname, "LastSetting", SelectedSetting, SIZEOF(SelectedSetting));
@@ -534,8 +534,7 @@ void moduleListRightClick(HWND hwnd, WPARAM wParam, LPARAM lParam);
void moduleListWM_NOTIFY(HWND hwnd, UINT, WPARAM wParam, LPARAM lParam)// hwnd here is to the main window, NOT the treview
{
switch (((NMHDR *)lParam)->code) {
- case TVN_ITEMEXPANDINGA:
- case TVN_ITEMEXPANDINGW:
+ case TVN_ITEMEXPANDING:
if (populating && ((LPNMTREEVIEW)lParam)->action == TVE_EXPAND) {
ModuleTreeInfoStruct *mtis = (ModuleTreeInfoStruct *)((LPNMTREEVIEW)lParam)->itemNew.lParam;
if (mtis && (mtis->type == (CONTACT | EMPTY))) {
@@ -580,119 +579,117 @@ void moduleListWM_NOTIFY(HWND hwnd, UINT, WPARAM wParam, LPARAM lParam)// hwnd h
break;
case TVN_SELCHANGED:
- {
- ModuleTreeInfoStruct *mtis;
- LPNMTREEVIEW pnmtv = (LPNMTREEVIEW)lParam;
- TVITEM tvi = { 0 };
- char text[264];
- MCONTACT hContact;
- HWND hwnd2Settings = GetDlgItem(hwnd, IDC_SETTINGS);
- tvi.mask = TVIF_HANDLE | TVIF_PARAM | TVIF_TEXT;
- tvi.hItem = pnmtv->itemNew.hItem;
- tvi.pszText = text;
- tvi.cchTextMax = SIZEOF(text);
- TreeView_GetItem(pnmtv->hdr.hwndFrom, &tvi);
-
- if (tvi.lParam) {
- mtis = (ModuleTreeInfoStruct *)tvi.lParam;
- hContact = mtis->hContact;
-
- if (mtis->type == STUB)
- break;
+ {
+ ModuleTreeInfoStruct *mtis;
+ LPNMTREEVIEW pnmtv = (LPNMTREEVIEW)lParam;
+ TVITEM tvi = { 0 };
+ char text[264];
+ MCONTACT hContact;
+ HWND hwnd2Settings = GetDlgItem(hwnd, IDC_SETTINGS);
+ tvi.mask = TVIF_HANDLE | TVIF_PARAM | TVIF_TEXT;
+ tvi.hItem = pnmtv->itemNew.hItem;
+ tvi.pszText = text;
+ tvi.cchTextMax = SIZEOF(text);
+ TreeView_GetItem(pnmtv->hdr.hwndFrom, &tvi);
- if (populating)
- Select = 0;
+ if (tvi.lParam) {
+ mtis = (ModuleTreeInfoStruct *)tvi.lParam;
+ hContact = mtis->hContact;
- if (mtis->type == MODULE) {
- SettingListInfo *info = (SettingListInfo *)GetWindowLongPtr(hwnd2Settings, GWLP_USERDATA);
- BOOL refresh = 1;
+ if (mtis->type == STUB)
+ break;
- if (info) {
- if (info->hContact == hContact && !mir_strcmp(info->module, text))
- refresh = 0;
- }
+ if (populating)
+ Select = 0;
- if (refresh)
- PopulateSettings(hwnd2Settings, hContact, text);
- }
- else if (((mtis->type & CONTACT) == CONTACT && hContact) || (mtis->type == CONTACT_ROOT_ITEM && !hContact)) {
- char data[32], szProto[256];
- int index, loaded, multi = 0;
- LVITEM lvi = { 0 };
- lvi.mask = LVIF_IMAGE | LVIF_TEXT | LVIF_PARAM;
- lvi.iImage = 6;
+ if (mtis->type == MODULE) {
+ SettingListInfo *info = (SettingListInfo *)GetWindowLongPtr(hwnd2Settings, GWLP_USERDATA);
+ BOOL refresh = 1;
- ClearListview(hwnd2Settings);
- SetWindowLongPtr(hwnd2Settings, GWLP_USERDATA, 0);
- if (himl2)
- ListView_SetImageList(hwnd2Settings, himl2, LVSIL_SMALL);
+ if (info) {
+ if (info->hContact == hContact && !mir_strcmp(info->module, text))
+ refresh = 0;
+ }
- if (mtis->type == CONTACT_ROOT_ITEM && !hContact) {
- multi = 1;
- hContact = db_find_first();
+ if (refresh)
+ PopulateSettings(hwnd2Settings, hContact, text);
}
+ else if (((mtis->type & CONTACT) == CONTACT && hContact) || (mtis->type == CONTACT_ROOT_ITEM && !hContact)) {
+ char data[32], szProto[256];
+ int index, loaded, multi = 0;
+ LVITEM lvi = { 0 };
+ lvi.mask = LVIF_IMAGE | LVIF_TEXT | LVIF_PARAM;
+ lvi.iImage = 6;
+
+ ClearListview(hwnd2Settings);
+ SetWindowLongPtr(hwnd2Settings, GWLP_USERDATA, 0);
+ if (himl2)
+ ListView_SetImageList(hwnd2Settings, himl2, LVSIL_SMALL);
+
+ if (mtis->type == CONTACT_ROOT_ITEM && !hContact) {
+ multi = 1;
+ hContact = db_find_first();
+ }
- while (hContact && hwnd2mainWindow) {
- if (multi) {
- // filter
- if (GetValue(hContact, "Protocol", "p", szProto, SIZEOF(szProto)))
- loaded = IsProtocolLoaded(szProto);
- else
- loaded = 0;
-
- if ((loaded && Mode == MODE_UNLOADED) || (!loaded && Mode == MODE_LOADED)) {
- hContact = db_find_next(hContact);
- continue;
+ while (hContact && hwnd2mainWindow) {
+ if (multi) {
+ // filter
+ if (GetValue(hContact, "Protocol", "p", szProto, SIZEOF(szProto)))
+ loaded = IsProtocolLoaded(szProto);
+ else
+ loaded = 0;
+
+ if ((loaded && Mode == MODE_UNLOADED) || (!loaded && Mode == MODE_LOADED)) {
+ hContact = db_find_next(hContact);
+ continue;
+ }
}
- }
- lvi.iItem = 0;
- lvi.pszText = (char *)GetContactName(hContact, NULL, FALSE);
+ lvi.iItem = 0;
+ lvi.pszText = (char *)GetContactName(hContact, NULL, FALSE);
- index = ListView_InsertItem(hwnd2Settings, &lvi);
+ index = ListView_InsertItem(hwnd2Settings, &lvi);
- mir_snprintf(data, SIZEOF(data), "0x%08X (%ld)", hContact, hContact);
+ mir_snprintf(data, SIZEOF(data), "0x%08X (%ld)", hContact, hContact);
- ListView_SetItemText(hwnd2Settings, index, 1, data);
- ListView_SetItemText(hwnd2Settings, index, 2, Translate("HANDLE"));
- ListView_SetItemText(hwnd2Settings, index, 3, "0x0004 (4)");
+ ListView_SetItemText(hwnd2Settings, index, 1, data);
+ ListView_SetItemText(hwnd2Settings, index, 2, Translate("HANDLE"));
+ ListView_SetItemText(hwnd2Settings, index, 3, "0x0004 (4)");
- if (!multi)
- break;
+ if (!multi)
+ break;
- hContact = db_find_next(hContact);
+ hContact = db_find_next(hContact);
+ }
}
+ else
+ ClearListview(hwnd2Settings);
}
- else
+ else // clear any settings that may be there...
ClearListview(hwnd2Settings);
}
- else // clear any settings that may be there...
- ClearListview(hwnd2Settings);
- }
- break; //TVN_SELCHANGED:
+ break; //TVN_SELCHANGED:
case NM_RCLICK:
if (((NMHDR *)lParam)->code == NM_RCLICK)
moduleListRightClick(hwnd, wParam, lParam);
break;
- case TVN_BEGINLABELEDITA: // subclass it..
- case TVN_BEGINLABELEDITW:
- {
- LPNMTVDISPINFO ptvdi = (LPNMTVDISPINFO)lParam;
- ModuleTreeInfoStruct *mtis = (ModuleTreeInfoStruct *)ptvdi->item.lParam;
- HWND hwnd2Edit = TreeView_GetEditControl(GetDlgItem(hwnd, IDC_MODULES));
- if (!mtis->type || (mtis->type == CONTACT)) {
- SetWindowLongPtr(hwnd, DWLP_MSGRESULT, TRUE);
- break;
+ case TVN_BEGINLABELEDIT: // subclass it..
+ {
+ LPNMTVDISPINFO ptvdi = (LPNMTVDISPINFO)lParam;
+ ModuleTreeInfoStruct *mtis = (ModuleTreeInfoStruct *)ptvdi->item.lParam;
+ HWND hwnd2Edit = TreeView_GetEditControl(GetDlgItem(hwnd, IDC_MODULES));
+ if (!mtis->type || (mtis->type == CONTACT)) {
+ SetWindowLongPtr(hwnd, DWLP_MSGRESULT, TRUE);
+ break;
+ }
+ mir_subclassWindow(hwnd2Edit, ModuleTreeLabelEditSubClassProc);
+ SetWindowLongPtr(hwnd, DWLP_MSGRESULT, FALSE);
}
- mir_subclassWindow(hwnd2Edit, ModuleTreeLabelEditSubClassProc);
- SetWindowLongPtr(hwnd, DWLP_MSGRESULT, FALSE);
- }
- break;
+ break;
- case TVN_ENDLABELEDITA:
- case TVN_ENDLABELEDITW:
+ case TVN_ENDLABELEDIT:
LPNMTVDISPINFO ptvdi = (LPNMTVDISPINFO)lParam;
TVITEM tvi = { 0 };
char text[264];
diff --git a/plugins/NewAwaySysMod/src/MsgTree.cpp b/plugins/NewAwaySysMod/src/MsgTree.cpp
index 70d5849aae..2d4ca2216f 100644
--- a/plugins/NewAwaySysMod/src/MsgTree.cpp
+++ b/plugins/NewAwaySysMod/src/MsgTree.cpp
@@ -70,8 +70,7 @@ static LRESULT CALLBACK ParentSubclassProc(HWND hWnd, UINT Msg, WPARAM wParam, L
case WM_NOTIFY:
if (((LPNMHDR)lParam)->hwndFrom == dat->hTreeView) {
switch (((LPNMHDR)lParam)->code) {
- case TVN_BEGINDRAGA:
- case TVN_BEGINDRAGW:
+ case TVN_BEGINDRAG:
{
LPNMTREEVIEW pnmtv = (LPNMTREEVIEW)lParam;
NMMSGTREE nm = { 0 };
@@ -92,8 +91,8 @@ static LRESULT CALLBACK ParentSubclassProc(HWND hWnd, UINT Msg, WPARAM wParam, L
}
}
break;
- case TVN_SELCHANGEDA:
- case TVN_SELCHANGEDW:
+
+ case TVN_SELCHANGED:
if (dat->UpdateLock)
return 0;
else {
@@ -119,8 +118,7 @@ static LRESULT CALLBACK ParentSubclassProc(HWND hWnd, UINT Msg, WPARAM wParam, L
}
break;
- case TVN_BEGINLABELEDITA:
- case TVN_BEGINLABELEDITW:
+ case TVN_BEGINLABELEDIT:
if (dat->GetTreeCtrl()->IDToOrder(((LPNMTVDISPINFO)lParam)->item.lParam) < 0)
return true; // cancel editing
diff --git a/plugins/Popup/src/opt_class.cpp b/plugins/Popup/src/opt_class.cpp
index d7ea7b264a..54c98eb7bf 100644
--- a/plugins/Popup/src/opt_class.cpp
+++ b/plugins/Popup/src/opt_class.cpp
@@ -475,8 +475,7 @@ INT_PTR CALLBACK DlgProcOptsClasses(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
case IDC_TREE1:
switch (((LPNMHDR)lParam)->code) {
- case TVN_SELCHANGEDA:
- case TVN_SELCHANGEDW:
+ case TVN_SELCHANGED:
PostMessage(hwnd, WM_USER, 0, 0);
break;
}
diff --git a/plugins/QuickMessages/src/options.cpp b/plugins/QuickMessages/src/options.cpp
index 6074f8e0a8..b1c66f66ad 100644
--- a/plugins/QuickMessages/src/options.cpp
+++ b/plugins/QuickMessages/src/options.cpp
@@ -753,14 +753,12 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
SendMessage(hdlg,WM_COMMAND,IDC_MTREEREMOVE,0);
}break;
- case TVN_BEGINLABELEDITA:
- case TVN_BEGINLABELEDITW:
+ case TVN_BEGINLABELEDIT:
hwndEdit=TreeView_GetEditControl(hMenuTree);
mir_subclassWindow(hwndEdit, LabelEditSubclassProc);
break;
- case TVN_ENDLABELEDITA:
- case TVN_ENDLABELEDITW:
+ case TVN_ENDLABELEDIT:
{
TVITEM tvi;
ButtonData* bd=NULL;
@@ -800,40 +798,34 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
TreeView_SetItem(hMenuTree, &tvi);
SendMessage(GetParent(hdlg),PSM_CHANGED,0,0);
}
- }break;
+ }
+ break;
case NM_KILLFOCUS:
TreeView_EndEditLabelNow(hButtonsList, 1);
break;
- case TVN_BEGINDRAGA:
- case TVN_BEGINDRAGW:
+ case TVN_BEGINDRAG:
SetCapture(hdlg);
drag=1;
hDragItem=((LPNMTREEVIEW)lparam)->itemNew.hItem;
TreeView_SelectItem(hMenuTree,hDragItem);
break;
- case TVN_SELCHANGINGA:
- case TVN_SELCHANGINGW:
+ case TVN_SELCHANGING:
{
- TVITEM tvi;
- HTREEITEM hti;
- ButtonData* bd;
-
- hti=TreeView_GetSelection(hMenuTree);
-
+ HTREEITEM hti = TreeView_GetSelection(hMenuTree);
if (hti==NULL)
break;
+ TVITEM tvi;
tvi.hItem=hti;
tvi.mask=TVIF_HANDLE|TVIF_PARAM;
TreeView_GetItem(hMenuTree,&tvi);
-
if (tvi.lParam == 0)
break;
- bd = ( ButtonData* )tvi.lParam;
+ ButtonData *bd = ( ButtonData* )tvi.lParam;
if (bd) {
TCHAR szValue[256];
GetDlgItemText(hdlg, IDC_MENUVALUE, szValue, SIZEOF(szValue));
@@ -846,26 +838,21 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
bd->bOpInQMenu=IsDlgButtonChecked(hdlg,IDC_INQMENU);
bd->bIsOpServName=IsDlgButtonChecked(hdlg,IDC_ISSERVNAME);
}
- }break;
- case TVN_SELCHANGEDA:
- case TVN_SELCHANGEDW:
- {
- TVITEM tvi;
- HTREEITEM hti;
- ButtonData* bd=NULL;
-
- hti=TreeView_GetSelection(hMenuTree);
+ }
+ break;
- if (hti==NULL)
+ case TVN_SELCHANGED:
+ {
+ HTREEITEM hti = TreeView_GetSelection(hMenuTree);
+ if (hti == NULL)
break;
+ TVITEM tvi;
tvi.mask=TVIF_HANDLE|TVIF_PARAM;
-
tvi.hItem=hti;
TreeView_GetItem(hMenuTree,&tvi);
-
- bd = ( ButtonData* )tvi.lParam;
+ ButtonData *bd = ( ButtonData* )tvi.lParam;
if (bd) {
if (!TreeView_GetChild(hMenuTree, tvi.hItem)&&!(bd->fEntryOpType&QMF_EX_SEPARATOR))
{
@@ -886,7 +873,8 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
CheckDlgButton(hdlg,IDC_ISSERVNAME,bd->bIsOpServName ? BST_CHECKED : BST_UNCHECKED);
}
}
- }break;
+ }
+ break;
case IDC_BUTTONSLIST:
switch (((LPNMHDR)lparam)->code) {
@@ -898,14 +886,12 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
SendMessage(hdlg,WM_COMMAND,IDC_BLISTREMOVE,0);
}break;
- case TVN_BEGINLABELEDITA:
- case TVN_BEGINLABELEDITW:
+ case TVN_BEGINLABELEDIT:
hwndEdit = TreeView_GetEditControl(hButtonsList);
mir_subclassWindow(hwndEdit, LabelEditSubclassProc);
break;
- case TVN_ENDLABELEDITA:
- case TVN_ENDLABELEDITW:
+ case TVN_ENDLABELEDIT:
{
TVITEM tvi;
TCHAR strbuf[128];
@@ -926,21 +912,16 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
TreeView_SetItem(hButtonsList, &tvi);
SendMessage(GetParent(hdlg),PSM_CHANGED,0,0);
- }break;
+ }
+ break;
- case TVN_SELCHANGINGA:
- case TVN_SELCHANGINGW:
+ case TVN_SELCHANGING:
SetMenuEntryProperties(hdlg);
break;
- case TVN_SELCHANGEDA:
- case TVN_SELCHANGEDW:
+ case TVN_SELCHANGED:
{
- TVITEM tvi;
- HTREEITEM hti;
-
- hti=TreeView_GetSelection(hButtonsList);
-
+ HTREEITEM hti = TreeView_GetSelection(hButtonsList);
if(hti==NULL||!TreeView_GetCount(hButtonsList)) {
EnableWindow(GetDlgItem(hdlg,IDC_MENUVALUE),FALSE);
EnableWindow(GetDlgItem(hdlg,IDC_ISSERVNAME),FALSE);
@@ -950,6 +931,7 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
break;
}
+ TVITEM tvi;
tvi.mask=TVIF_HANDLE|TVIF_PARAM;
tvi.hItem=hti;
TreeView_GetItem(hButtonsList,&tvi);
@@ -967,8 +949,10 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg,UINT msg,WPARAM wparam,LPARAM lparam)
SetDlgItemText(hdlg, IDC_RCLICKVALUE, ((ListData*)tvi.lParam)->ptszOPQValue);
else
SetDlgItemText(hdlg, IDC_RCLICKVALUE, _T(""));
- }break;
- }break;
+ }
+ break;
+ }
+ break;
}
break;
diff --git a/plugins/TabSRMM/src/msgoptions.cpp b/plugins/TabSRMM/src/msgoptions.cpp
index 66a9240eea..a4d23187b8 100644
--- a/plugins/TabSRMM/src/msgoptions.cpp
+++ b/plugins/TabSRMM/src/msgoptions.cpp
@@ -509,30 +509,19 @@ BOOL TreeViewHandleClick(HWND hwndDlg, HWND hwndTree, WPARAM, LPARAM lParam)
return FALSE;
item.hItem = (HTREEITEM)hti.hItem;
break;
+
case TVN_ITEMEXPANDEDW:
- {
- LPNMTREEVIEWW lpnmtv = (LPNMTREEVIEWW)lParam;
+ {
+ LPNMTREEVIEWW lpnmtv = (LPNMTREEVIEWW)lParam;
- item.mask = TVIF_HANDLE | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
- item.hItem = lpnmtv->itemNew.hItem;
- item.iImage = item.iSelectedImage =
- (lpnmtv->itemNew.state & TVIS_EXPANDED) ? IMG_GRPOPEN : IMG_GRPCLOSED;
- SendMessageW(((LPNMHDR)lParam)->hwndFrom, TVM_SETITEMW, 0, (LPARAM)&item);
- }
- return TRUE;
- break;
- case TVN_ITEMEXPANDEDA:
- {
- LPNMTREEVIEWA lpnmtv = (LPNMTREEVIEWA)lParam;
+ item.mask = TVIF_HANDLE | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
+ item.hItem = lpnmtv->itemNew.hItem;
+ item.iImage = item.iSelectedImage =
+ (lpnmtv->itemNew.state & TVIS_EXPANDED) ? IMG_GRPOPEN : IMG_GRPCLOSED;
+ SendMessageW(((LPNMHDR)lParam)->hwndFrom, TVM_SETITEMW, 0, (LPARAM)&item);
+ }
+ return TRUE;
- item.mask = TVIF_HANDLE | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
- item.hItem = lpnmtv->itemNew.hItem;
- item.iImage = item.iSelectedImage =
- (lpnmtv->itemNew.state & TVIS_EXPANDED) ? IMG_GRPOPEN : IMG_GRPCLOSED;
- SendMessageA(((LPNMHDR)lParam)->hwndFrom, TVM_SETITEMA, 0, (LPARAM)&item);
- }
- return TRUE;
- break;
default:
return FALSE;
}
diff --git a/plugins/TrafficCounter/src/opttree.cpp b/plugins/TrafficCounter/src/opttree.cpp
index 6f7c21e503..ced9f4db3e 100644
--- a/plugins/TrafficCounter/src/opttree.cpp
+++ b/plugins/TrafficCounter/src/opttree.cpp
@@ -328,29 +328,15 @@ BOOL OptTree_ProcessMessage(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam,
break;
}
- case TVN_ITEMEXPANDEDW:
- {
- LPNMTREEVIEWW lpnmtv = (LPNMTREEVIEWW)lparam;
- TVITEM tvi;
- tvi.mask=TVIF_HANDLE|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
- tvi.hItem = lpnmtv->itemNew.hItem;
- tvi.iImage = tvi.iSelectedImage =
- (lpnmtv->itemNew.state & TVIS_EXPANDED) ? IMG_GRPOPEN : IMG_GRPCLOSED;
- SendMessageW(lpnmhdr->hwndFrom, TVM_SETITEMW, 0, (LPARAM)&tvi);
- break;
- }
-
- case TVN_ITEMEXPANDEDA:
- {
- LPNMTREEVIEWA lpnmtv = (LPNMTREEVIEWA)lparam;
+ case TVN_ITEMEXPANDED:
+ LPNMTREEVIEW lpnmtv = (LPNMTREEVIEW)lparam;
TVITEM tvi;
- tvi.mask=TVIF_HANDLE|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
+ tvi.mask = TVIF_HANDLE|TVIF_IMAGE|TVIF_SELECTEDIMAGE;
tvi.hItem = lpnmtv->itemNew.hItem;
tvi.iImage = tvi.iSelectedImage =
(lpnmtv->itemNew.state & TVIS_EXPANDED) ? IMG_GRPOPEN : IMG_GRPCLOSED;
- SendMessageA(lpnmhdr->hwndFrom, TVM_SETITEMA, 0, (LPARAM)&tvi);
+ SendMessage(lpnmhdr->hwndFrom, TVM_SETITEM, 0, (LPARAM)&tvi);
break;
- }
}
break;
}
diff --git a/protocols/JabberG/src/jabber_disco.cpp b/protocols/JabberG/src/jabber_disco.cpp
index f4a7dbfad8..e15a37a8c5 100644
--- a/protocols/JabberG/src/jabber_disco.cpp
+++ b/protocols/JabberG/src/jabber_disco.cpp
@@ -989,7 +989,7 @@ INT_PTR CJabberDlgDiscovery::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
HWND hwndList = GetDlgItem(m_hwnd, IDC_TREE_DISCO);
RECT rcCtl; GetClientRect(hwndList, &rcCtl);
RECT rcHdr; GetClientRect(ListView_GetHeader(hwndList), &rcHdr);
- LVHITTESTINFO lvhti = {0};
+ LVHITTESTINFO lvhti = { 0 };
lvhti.pt.x = rcCtl.left + 5;
lvhti.pt.y = rcHdr.bottom + 5;
int iFirst = ListView_HitTest(hwndList, &lvhti);
@@ -1003,9 +1003,8 @@ INT_PTR CJabberDlgDiscovery::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
XmlNode packet(NULL);
{
mir_cslock lck(m_proto->m_SDManager.cs());
- for (int i = iFirst; i <= iLast; i++)
- {
- LVITEM lvi = {0};
+ for (int i = iFirst; i <= iLast; i++) {
+ LVITEM lvi = { 0 };
lvi.mask = LVIF_PARAM;
lvi.iItem = i;
ListView_GetItem(hwndList, &lvi);
@@ -1029,13 +1028,12 @@ INT_PTR CJabberDlgDiscovery::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
break;
case WM_CONTEXTMENU:
- if (GetWindowLongPtr((HWND)wParam, GWL_ID) == IDC_TREE_DISCO)
- {
+ if (GetWindowLongPtr((HWND)wParam, GWL_ID) == IDC_TREE_DISCO) {
HWND hwndList = (HWND)wParam;
POINT pt = { (signed short)LOWORD(lParam), (signed short)HIWORD(lParam) };
if ((pt.x == -1) && (pt.y == -1)) {
- LVITEM lvi = {0};
+ LVITEM lvi = { 0 };
lvi.iItem = ListView_GetNextItem(hwndList, -1, LVNI_SELECTED);
if (lvi.iItem < 0) return FALSE;
@@ -1103,13 +1101,11 @@ INT_PTR CJabberDlgDiscovery::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
}
return TRUE;
}
-
break;
case WM_COMMAND:
- switch (LOWORD(wParam))
- {
- case IDOK:
+ switch (LOWORD(wParam)) {
+ case IDOK:
{
HWND hwndFocus = GetFocus();
if (!hwndFocus) return TRUE;
@@ -1119,13 +1115,12 @@ INT_PTR CJabberDlgDiscovery::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
break;
else if ((GetWindowLongPtr(hwndFocus, GWL_ID) == IDC_COMBO_NODE) || (GetWindowLongPtr(hwndFocus, GWL_ID) == IDC_COMBO_JID))
PostMessage(m_hwnd, WM_COMMAND, MAKEWPARAM(IDC_BUTTON_BROWSE, 0), 0);
- return TRUE;
- }
- case IDCANCEL:
- {
- PostMessage(m_hwnd, WM_CLOSE, 0, 0);
- return TRUE;
}
+ return TRUE;
+
+ case IDCANCEL:
+ PostMessage(m_hwnd, WM_CLOSE, 0, 0);
+ return TRUE;
}
break;
diff --git a/protocols/JabberG/src/jabber_opttree.cpp b/protocols/JabberG/src/jabber_opttree.cpp
index 6395bdca3b..5eddddfb65 100644
--- a/protocols/JabberG/src/jabber_opttree.cpp
+++ b/protocols/JabberG/src/jabber_opttree.cpp
@@ -65,32 +65,22 @@ BOOL CCtrlTreeOpts::OnNotify(int idCtrl, NMHDR *pnmh)
hti.pt.y = (short)HIWORD(GetMessagePos());
ScreenToClient(pnmh->hwndFrom, &hti.pt);
if (HitTest(&hti))
- if (hti.flags&TVHT_ONITEMICON)
- ProcessItemClick(hti.hItem);
+ if (hti.flags & TVHT_ONITEMICON)
+ ProcessItemClick(hti.hItem);
}
break;
- case TVN_ITEMEXPANDEDW:
+ case TVN_ITEMEXPANDED:
{
- LPNMTREEVIEWW lpnmtv = (LPNMTREEVIEWW)pnmh;
+ LPNMTREEVIEW lpnmtv = (LPNMTREEVIEW)pnmh;
TVITEM tvi;
tvi.mask = TVIF_HANDLE | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
tvi.hItem = lpnmtv->itemNew.hItem;
tvi.iImage = tvi.iSelectedImage =
(lpnmtv->itemNew.state & TVIS_EXPANDED) ? IMG_GRPOPEN : IMG_GRPCLOSED;
- SendMessageW(pnmh->hwndFrom, TVM_SETITEMW, 0, (LPARAM)&tvi);
+ SendMessage(pnmh->hwndFrom, TVM_SETITEM, 0, (LPARAM)&tvi);
}
break;
-
- case TVN_ITEMEXPANDEDA:
- LPNMTREEVIEWA lpnmtv = (LPNMTREEVIEWA)pnmh;
- TVITEM tvi;
- tvi.mask = TVIF_HANDLE | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
- tvi.hItem = lpnmtv->itemNew.hItem;
- tvi.iImage = tvi.iSelectedImage =
- (lpnmtv->itemNew.state & TVIS_EXPANDED) ? IMG_GRPOPEN : IMG_GRPCLOSED;
- SendMessageA(pnmh->hwndFrom, TVM_SETITEMA, 0, (LPARAM)&tvi);
- break;
}
return CCtrlTreeView::OnNotify(idCtrl, pnmh);
@@ -201,6 +191,7 @@ void CCtrlTreeOpts::ProcessItemClick(HTREEITEM hti)
tvi.iImage = tvi.iSelectedImage = IMG_GRPCLOSED;
Expand(tvi.hItem, TVE_COLLAPSE);
break;
+
case IMG_GRPCLOSED:
tvi.iImage = tvi.iSelectedImage = IMG_GRPOPEN;
Expand(tvi.hItem, TVE_EXPAND);
@@ -210,10 +201,12 @@ void CCtrlTreeOpts::ProcessItemClick(HTREEITEM hti)
tvi.iImage = tvi.iSelectedImage = IMG_NOCHECK;
SendMessage(::GetParent(::GetParent(m_hwnd)), PSM_CHANGED, 0, 0);
break;
+
case IMG_NOCHECK:
tvi.iImage = tvi.iSelectedImage = IMG_CHECK;
SendMessage(::GetParent(::GetParent(m_hwnd)), PSM_CHANGED, 0, 0);
break;
+
case IMG_NORCHECK:
for (int i = 0; i < m_options.getCount(); i++) {
if (m_options[i]->m_groupId == m_options[tvi.lParam]->m_groupId) {
diff --git a/protocols/Xfire/src/options.cpp b/protocols/Xfire/src/options.cpp
index 1e5813467b..127f789b19 100644
--- a/protocols/Xfire/src/options.cpp
+++ b/protocols/Xfire/src/options.cpp
@@ -481,15 +481,15 @@ static INT_PTR CALLBACK DlgProcOpts3(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
break;
case WM_NOTIFY:
- {
switch (((LPNMHDR)lParam)->idFrom)
{
case IDC_TREE:
{
switch (((NMHDR*)lParam)->code) { //wenn was geändert wurde, apply aktivieren
- case TVN_SELCHANGEDA:
+ case TVN_SELCHANGED:
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
+
case TVN_KEYDOWN: //tastatursteuerung
{
NMTVKEYDOWN* ptkd = (NMTVKEYDOWN*)lParam;
@@ -512,7 +512,7 @@ static INT_PTR CALLBACK DlgProcOpts3(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
}
}
}
- }
+
switch (((LPNMHDR)lParam)->code)
{
case PSN_APPLY: