summaryrefslogtreecommitdiff
path: root/src/core/stduserinfo
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-02-10 08:04:30 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-02-10 08:04:30 +0000
commitddba4ede6b451d0cfcd0d32b5180fbd0689966bf (patch)
tree5d74f37a7013d13b92c182628d6b68a58e148ae4 /src/core/stduserinfo
parentc39340bf493a1745a41317bbf937fc7eb6cbb26a (diff)
- HANDLE hContact => HCONTACT
- GCF_* prefix was added to chat constants to avoid name conflicts git-svn-id: http://svn.miranda-ng.org/main/trunk@8078 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/core/stduserinfo')
-rw-r--r--src/core/stduserinfo/contactinfo.cpp4
-rw-r--r--src/core/stduserinfo/stdinfo.cpp61
-rw-r--r--src/core/stduserinfo/userinfo.cpp8
3 files changed, 37 insertions, 36 deletions
diff --git a/src/core/stduserinfo/contactinfo.cpp b/src/core/stduserinfo/contactinfo.cpp
index f674685200..fd38ad1758 100644
--- a/src/core/stduserinfo/contactinfo.cpp
+++ b/src/core/stduserinfo/contactinfo.cpp
@@ -252,7 +252,7 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
case M_REMAKELISTS:
{
- HANDLE hContact = (HANDLE)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+ HCONTACT hContact = (HCONTACT)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
if (hContact != NULL) {
char *szProto = GetContactProto(hContact);
if (szProto == NULL)
@@ -436,7 +436,7 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
NMLISTVIEW *nm = (NMLISTVIEW*)lParam;
LVITEM lvi;
TCHAR szEmail[256];
- HANDLE hContact = (HANDLE)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+ HCONTACT hContact = (HCONTACT)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
char *szIdTemplate = (nm->hdr.idFrom == IDC_PHONES) ? "MyPhone%d" : "Mye-mail%d";
LVHITTESTINFO hti;
diff --git a/src/core/stduserinfo/stdinfo.cpp b/src/core/stduserinfo/stdinfo.cpp
index b807e8f37e..ac02608694 100644
--- a/src/core/stduserinfo/stdinfo.cpp
+++ b/src/core/stduserinfo/stdinfo.cpp
@@ -35,7 +35,7 @@ INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP
#define SVS_SIGNED 6
#define SVS_TIMEZONE 7
-static int Proto_GetContactInfoSetting(HANDLE hContact, const char *szProto, const char *szModule, const char *szSetting, DBVARIANT *dbv, const int nType)
+static int Proto_GetContactInfoSetting(HCONTACT hContact, const char *szProto, const char *szModule, const char *szSetting, DBVARIANT *dbv, const int nType)
{
DBCONTACTGETSETTING cgs = {szModule, szSetting, dbv};
dbv->type = (BYTE)nType;
@@ -64,7 +64,7 @@ static void Proto_FreeInfoVariant(DBVARIANT *dbv)
dbv->type = 0;
}
-static void SetValue(HWND hwndDlg, int idCtrl, HANDLE hContact, char *szModule, char *szSetting, int special)
+static void SetValue(HWND hwndDlg, int idCtrl, HCONTACT hContact, char *szModule, char *szSetting, int special)
{
char str[80], *pstr = NULL;
TCHAR* ptstr = NULL;
@@ -194,7 +194,7 @@ static INT_PTR CALLBACK SummaryDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
switch (((LPNMHDR)lParam)->idFrom) {
case 0:
if (((LPNMHDR)lParam)->code == PSN_INFOCHANGED) {
- HANDLE hContact = (HANDLE)((LPPSHNOTIFY)lParam)->lParam;
+ HCONTACT hContact = (HCONTACT)((LPPSHNOTIFY)lParam)->lParam;
if (hContact != NULL) {
char *szProto = GetContactProto(hContact);
if (szProto == NULL)
@@ -244,13 +244,13 @@ static INT_PTR CALLBACK LocationDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
TranslateDialogDefault(hwndDlg);
SetTimer(hwndDlg, 1, 1000, NULL);
- tmi.prepareList((HANDLE)lParam, GetDlgItem(hwndDlg, IDC_TIMEZONESELECT), TZF_PLF_CB);
+ tmi.prepareList((HCONTACT)lParam, GetDlgItem(hwndDlg, IDC_TIMEZONESELECT), TZF_PLF_CB);
SendMessage(hwndDlg, WM_TIMER, 0, 0);
break;
case WM_TIMER:
{
- HANDLE hContact = (HANDLE)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+ HCONTACT hContact = (HCONTACT)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
if (hContact != NULL) {
TCHAR szTime[80];
if (tmi.printDateTimeByContact(hContact, _T("s"), szTime, SIZEOF(szTime), TZF_KNOWNONLY)) {
@@ -269,7 +269,7 @@ static INT_PTR CALLBACK LocationDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
switch (((LPNMHDR)lParam)->idFrom) {
case 0:
if (((LPNMHDR)lParam)->code == PSN_INFOCHANGED) {
- HANDLE hContact = (HANDLE)((LPPSHNOTIFY)lParam)->lParam;
+ HCONTACT hContact = (HCONTACT)((LPPSHNOTIFY)lParam)->lParam;
if (hContact != NULL) {
char *szProto = GetContactProto(hContact);
if (szProto == NULL)
@@ -297,7 +297,7 @@ static INT_PTR CALLBACK LocationDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
case IDC_TIMEZONESELECT:
if (HIWORD(wParam) == CBN_SELCHANGE) {
- HANDLE hContact = (HANDLE)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
+ HCONTACT hContact = (HCONTACT)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
tmi.storeListResults(hContact, GetDlgItem(hwndDlg, IDC_TIMEZONESELECT), TZF_PLF_CB);
@@ -319,7 +319,7 @@ static INT_PTR CALLBACK WorkDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
switch (((LPNMHDR)lParam)->idFrom) {
case 0:
if (((LPNMHDR)lParam)->code == PSN_INFOCHANGED) {
- HANDLE hContact = (HANDLE)((LPPSHNOTIFY)lParam)->lParam;
+ HCONTACT hContact = (HCONTACT)((LPPSHNOTIFY)lParam)->lParam;
if (hContact != NULL) {
char *szProto = GetContactProto(hContact);
if (szProto == NULL) break;
@@ -395,7 +395,7 @@ static INT_PTR CALLBACK BackgroundDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
int i;
char idstr[33];
DBVARIANT dbv, dbvText;
- HANDLE hContact = (HANDLE)((LPPSHNOTIFY)lParam)->lParam;
+ HCONTACT hContact = (HCONTACT)((LPPSHNOTIFY)lParam)->lParam;
if (hContact != NULL) {
char *szProto = GetContactProto(hContact);
@@ -522,7 +522,7 @@ static INT_PTR CALLBACK NotesDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
hFont = CreateFontIndirect(&lf);
SendDlgItemMessage(hwndDlg, IDC_ABOUT, WM_SETFONT, (WPARAM) hFont, MAKELPARAM(TRUE, 0));
- if ( !db_get_s((HANDLE)lParam, "UserInfo", "MyNotes", &dbv)) {
+ if (!db_get_s((HCONTACT)lParam, "UserInfo", "MyNotes", &dbv)) {
SetDlgItemTextA(hwndDlg, IDC_MYNOTES, dbv.pszVal);
db_free(&dbv);
}
@@ -531,30 +531,31 @@ static INT_PTR CALLBACK NotesDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
break;
case WM_NOTIFY:
switch (((LPNMHDR)lParam)->idFrom) {
- case 0:
- switch (((LPNMHDR)lParam)->code) {
- case PSN_INFOCHANGED:
- { char *szProto;
- HANDLE hContact = (HANDLE)((LPPSHNOTIFY)lParam)->lParam;
- if (hContact != NULL) {
- szProto = GetContactProto(hContact);
- if (szProto == NULL) break;
+ case 0:
+ switch (((LPNMHDR)lParam)->code) {
+ case PSN_INFOCHANGED:
+ {
+ HCONTACT hContact = (HCONTACT)((LPPSHNOTIFY)lParam)->lParam;
+ if (hContact != NULL) {
+ char *szProto = GetContactProto(hContact);
+ if (szProto != NULL)
SetValue(hwndDlg, IDC_ABOUT, hContact, szProto, "About", 0);
- }
- break;
}
- case PSN_APPLY:
- { HANDLE hContact = (HANDLE)((LPPSHNOTIFY)lParam)->lParam;
- if (GetWindowTextLength(GetDlgItem(hwndDlg, IDC_MYNOTES))) {
- char text[2048];
- GetDlgItemTextA(hwndDlg, IDC_MYNOTES, text, SIZEOF(text));
- db_set_s(hContact, "UserInfo", "MyNotes", text);
- }
- else db_unset(hContact, "UserInfo", "MyNotes");
- break;
+ }
+ break;
+ case PSN_APPLY:
+ {
+ HCONTACT hContact = (HCONTACT)((LPPSHNOTIFY)lParam)->lParam;
+ if (GetWindowTextLength(GetDlgItem(hwndDlg, IDC_MYNOTES))) {
+ char text[2048];
+ GetDlgItemTextA(hwndDlg, IDC_MYNOTES, text, SIZEOF(text));
+ db_set_s(hContact, "UserInfo", "MyNotes", text);
}
+ else db_unset(hContact, "UserInfo", "MyNotes");
}
break;
+ }
+ break;
}
break;
case WM_COMMAND:
@@ -578,7 +579,7 @@ int DetailsInit(WPARAM wParam, LPARAM lParam)
if (lParam == NULL)
return 0;
- if (GetContactProto((HANDLE)lParam) == 0)
+ if (GetContactProto((HCONTACT)lParam) == 0)
return 0;
OPTIONSDIALOGPAGE odp = { sizeof(odp) };
diff --git a/src/core/stduserinfo/userinfo.cpp b/src/core/stduserinfo/userinfo.cpp
index adb844c56e..d7312c0134 100644
--- a/src/core/stduserinfo/userinfo.cpp
+++ b/src/core/stduserinfo/userinfo.cpp
@@ -51,7 +51,7 @@ struct DetailsPageData
struct DetailsData
{
- HANDLE hContact;
+ HCONTACT hContact;
HANDLE hProtoAckEvent;
HINSTANCE hInstIcmp;
HFONT hBoldFont;
@@ -95,7 +95,7 @@ static int PageSortProc(OPTIONSDIALOGPAGE *item1, OPTIONSDIALOGPAGE *item2)
static INT_PTR ShowDetailsDialogCommand(WPARAM wParam, LPARAM)
{
HWND hwnd;
- if (hwnd = WindowList_Find(hWindowList, (HANDLE)wParam)) {
+ if (hwnd = WindowList_Find(hWindowList, (HCONTACT)wParam)) {
SetForegroundWindow(hwnd);
SetFocus(hwnd);
return 0;
@@ -222,7 +222,7 @@ static void CreateDetailsPageWindow(HWND hwndDlg, DetailsData *dat, DetailsPageD
static int UserInfoContactDelete(WPARAM wParam, LPARAM)
{
- HWND hwnd = WindowList_Find(hWindowList, (HANDLE)wParam);
+ HWND hwnd = WindowList_Find(hWindowList, (HCONTACT)wParam);
if (hwnd != NULL)
DestroyWindow(hwnd);
return 0;
@@ -245,7 +245,7 @@ static INT_PTR CALLBACK DlgProcDetails(HWND hwndDlg, UINT msg, WPARAM wParam, LP
PROPSHEETHEADER *psh = (PROPSHEETHEADER*)lParam;
dat = (DetailsData*)mir_calloc(sizeof(DetailsData));
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, (LONG_PTR)dat);
- dat->hContact = (HANDLE)psh->pszCaption;
+ dat->hContact = (HCONTACT)psh->pszCaption;
dat->hProtoAckEvent = HookEventMessage(ME_PROTO_ACK, hwndDlg, HM_PROTOACK);
WindowList_Add(hWindowList, hwndDlg, dat->hContact);