summaryrefslogtreecommitdiff
path: root/plugins/DbEditorPP
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/DbEditorPP')
-rw-r--r--plugins/DbEditorPP/src/addeditsettingsdlg.cpp6
-rw-r--r--plugins/DbEditorPP/src/copymodule.cpp10
-rw-r--r--plugins/DbEditorPP/src/deletemodule.cpp6
-rw-r--r--plugins/DbEditorPP/src/exportimport.cpp28
-rw-r--r--plugins/DbEditorPP/src/findwindow.cpp10
-rw-r--r--plugins/DbEditorPP/src/headers.h58
-rw-r--r--plugins/DbEditorPP/src/main.cpp26
-rw-r--r--plugins/DbEditorPP/src/main_window.cpp10
-rw-r--r--plugins/DbEditorPP/src/modsettingenum.cpp4
-rw-r--r--plugins/DbEditorPP/src/modsettingenum.h4
-rw-r--r--plugins/DbEditorPP/src/modules.cpp10
-rw-r--r--plugins/DbEditorPP/src/moduletree.cpp34
-rw-r--r--plugins/DbEditorPP/src/settinglist.cpp12
-rw-r--r--plugins/DbEditorPP/src/watchedvars.cpp10
14 files changed, 114 insertions, 114 deletions
diff --git a/plugins/DbEditorPP/src/addeditsettingsdlg.cpp b/plugins/DbEditorPP/src/addeditsettingsdlg.cpp
index 0a28996127..748e27cd2d 100644
--- a/plugins/DbEditorPP/src/addeditsettingsdlg.cpp
+++ b/plugins/DbEditorPP/src/addeditsettingsdlg.cpp
@@ -1,6 +1,6 @@
#include "headers.h"
-static BOOL Convert(HCONTACT hContact, char* module, char* setting, int value, int toType) // 0 = byte, 1 = word, 2 = dword, 3 = string
+static BOOL Convert(MCONTACT hContact, char* module, char* setting, int value, int toType) // 0 = byte, 1 = word, 2 = dword, 3 = string
{
int Result = 1;
char temp[64];
@@ -30,7 +30,7 @@ static BOOL Convert(HCONTACT hContact, char* module, char* setting, int value, i
}
-BOOL convertSetting(HCONTACT hContact, char* module, char* setting, int toType) // 0 = byte, 1 = word, 2 = dword, 3 = string, 4 = unicode
+BOOL convertSetting(MCONTACT hContact, char* module, char* setting, int toType) // 0 = byte, 1 = word, 2 = dword, 3 = string, 4 = unicode
{
DBVARIANT dbv = {0};
BOOL Result = 0;
@@ -419,7 +419,7 @@ INT_PTR CALLBACK EditSettingDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
return 0;
}
-void editSetting(HCONTACT hContact, char* module, char* setting)
+void editSetting(MCONTACT hContact, char* module, char* setting)
{
DBVARIANT dbv = {0}; // freed in the dialog
if (!GetSetting(hContact,module, setting, &dbv))
diff --git a/plugins/DbEditorPP/src/copymodule.cpp b/plugins/DbEditorPP/src/copymodule.cpp
index db23d4ab21..896f953a46 100644
--- a/plugins/DbEditorPP/src/copymodule.cpp
+++ b/plugins/DbEditorPP/src/copymodule.cpp
@@ -1,6 +1,6 @@
#include "headers.h"
-void copyModule(char* module, HCONTACT hContactFrom, HCONTACT hContactTo)
+void copyModule(char* module, MCONTACT hContactFrom, MCONTACT hContactTo)
{
ModuleSettingLL msll;
@@ -44,7 +44,7 @@ INT_PTR CALLBACK copyModDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara
{
int index, loaded;
char szProto[256];
- for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
if (GetValue(hContact,"Protocol","p",szProto,SIZEOF(szProto)))
loaded = IsProtocolLoaded(szProto);
else
@@ -100,12 +100,12 @@ INT_PTR CALLBACK copyModDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara
case IDOK:
if (!IsDlgButtonChecked(hwnd,CHK_COPY2ALL)) {
- HCONTACT hContact = (HCONTACT)SendMessage(GetDlgItem(hwnd, IDC_CONTACTS), CB_GETITEMDATA, SendMessage(GetDlgItem(hwnd, IDC_CONTACTS), CB_GETCURSEL, 0, 0), 0);
+ MCONTACT hContact = (MCONTACT)SendMessage(GetDlgItem(hwnd, IDC_CONTACTS), CB_GETITEMDATA, SendMessage(GetDlgItem(hwnd, IDC_CONTACTS), CB_GETCURSEL, 0, 0), 0);
copyModule(mac->module, mac->hContact, hContact);
}
else {
SetCursor(LoadCursor(NULL,IDC_WAIT));
- for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
+ for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
copyModule(mac->module, mac->hContact, hContact);
SetCursor(LoadCursor(NULL,IDC_ARROW));
@@ -124,7 +124,7 @@ INT_PTR CALLBACK copyModDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara
return 0;
}
-void copyModuleMenuItem(char* module, HCONTACT hContact)
+void copyModuleMenuItem(char* module, MCONTACT hContact)
{
ModuleAndContact *mac = (ModuleAndContact *)mir_calloc(sizeof(ModuleAndContact));
mac->hContact = hContact;
diff --git a/plugins/DbEditorPP/src/deletemodule.cpp b/plugins/DbEditorPP/src/deletemodule.cpp
index 73d277e100..394d4added 100644
--- a/plugins/DbEditorPP/src/deletemodule.cpp
+++ b/plugins/DbEditorPP/src/deletemodule.cpp
@@ -3,7 +3,7 @@
static int working;
static HWND hwnd2Delete = NULL;
-int deleteModule(char* module, HCONTACT hContact, int fromMenu)
+int deleteModule(char* module, MCONTACT hContact, int fromMenu)
{
char msg[1024];
ModuleSettingLL settinglist;
@@ -47,7 +47,7 @@ void __cdecl PopulateModuleDropListThreadFunc(LPVOID di)
module = module->next;
continue;
}
- for (HCONTACT hContact = db_find_first();moduleEmpty && hContact;hContact = db_find_next(hContact)) {
+ for (MCONTACT hContact = db_find_first();moduleEmpty && hContact;hContact = db_find_next(hContact)) {
if (!IsModuleEmpty(hContact,module->name)) {
SendDlgItemMessage(hwnd,IDC_CONTACTS,CB_ADDSTRING,0,(LPARAM)module->name);
moduleEmpty = 0;
@@ -94,7 +94,7 @@ INT_PTR CALLBACK DeleteModuleDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
char text[128];
GetDlgItemText(hwnd,IDC_CONTACTS,text,128);
SetCursor(LoadCursor(NULL,IDC_WAIT));
- for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
+ for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
deleteModule(text,hContact,1);
// do the null
diff --git a/plugins/DbEditorPP/src/exportimport.cpp b/plugins/DbEditorPP/src/exportimport.cpp
index b1c5cf436d..d15655fffb 100644
--- a/plugins/DbEditorPP/src/exportimport.cpp
+++ b/plugins/DbEditorPP/src/exportimport.cpp
@@ -81,7 +81,7 @@ char* StrReplace (char* Search, char* Replace, char* Resource)
return Resource;
}
-void exportModule(HCONTACT hContact, char* module, FILE* file)
+void exportModule(MCONTACT hContact, char* module, FILE* file)
{
char tmp[32];
ModuleSettingLL settinglist;
@@ -152,7 +152,7 @@ void exportModule(HCONTACT hContact, char* module, FILE* file)
FreeModuleSettingLL(&settinglist);
}
-char *NickFromHContact(HCONTACT hContact)
+char *NickFromHContact(MCONTACT hContact)
{
static char nick[512] = "";
@@ -193,7 +193,7 @@ char *NickFromHContact(HCONTACT hContact)
return nick;
}
-void exportDB(HCONTACT hContact, char* module) // hContact == -1 export entire db. module == NULL export entire contact.
+void exportDB(MCONTACT hContact, char* module) // hContact == -1 export entire db. module == NULL export entire contact.
{ // hContact == -1, module == "" - all contacts
FILE* file = NULL;
char fileName[MAX_PATH];
@@ -211,7 +211,7 @@ void exportDB(HCONTACT hContact, char* module) // hContact == -1 export entire d
SetCursor(LoadCursor(NULL,IDC_WAIT));
// exporting entire db
- if (hContact == (HCONTACT)INVALID_HANDLE_VALUE)
+ if (hContact == INVALID_CONTACT_ID)
{
hContact = NULL;
@@ -326,20 +326,20 @@ void exportDB(HCONTACT hContact, char* module) // hContact == -1 export entire d
FreeModuleSettingLL(&modlist);
}
-HCONTACT CheckNewContact(char *myProto, char *uid, char *myName)
+MCONTACT CheckNewContact(char *myProto, char *uid, char *myName)
{
char szProto[256], szName[256];
- for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
+ for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
if (DBGetContactSettingStringStatic(hContact, "Protocol", "p", szProto, 256))
if (!mir_strcmp(szProto, myProto))
if (GetValue(hContact, szProto, uid, szName, SIZEOF(szName)) && !mir_strcmp(szName, myName))
return hContact;
- return (HCONTACT)INVALID_HANDLE_VALUE;
+ return INVALID_CONTACT_ID;
}
-void importSettings(HCONTACT hContact, char *importstring )
+void importSettings(MCONTACT hContact, char *importstring )
{
char module[256] = "", setting[256] = "", *end;
int i=0, value, type;
@@ -364,7 +364,7 @@ void importSettings(HCONTACT hContact, char *importstring )
else if (!strncmp(&importstring[i],"CONTACT:", strlen("CONTACT:")))
{
int len, add = 1;
- hContact = (HCONTACT)INVALID_HANDLE_VALUE;
+ hContact = INVALID_CONTACT_ID;
i = i + (int)strlen("CONTACT:");
len = (int)strlen(&importstring[i]);
@@ -403,9 +403,9 @@ void importSettings(HCONTACT hContact, char *importstring )
}
}
- if (hContact == (HCONTACT)INVALID_HANDLE_VALUE)
+ if (hContact == INVALID_CONTACT_ID)
{
- HCONTACT temp = (HCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
+ MCONTACT temp = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
if (temp)
hContact = temp;
}
@@ -566,7 +566,7 @@ INT_PTR CALLBACK ImportDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam
case IDOK:
{
- HCONTACT hContact = (HCONTACT)GetWindowLongPtr(hwnd, GWLP_USERDATA);
+ MCONTACT hContact = (MCONTACT)GetWindowLongPtr(hwnd, GWLP_USERDATA);
int length = GetWindowTextLength(GetDlgItem(hwnd, IDC_TEXT));
char *string;
if (length)
@@ -591,7 +591,7 @@ INT_PTR CALLBACK ImportDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam
return 0;
}
-void ImportSettingsMenuItem(HCONTACT hContact)
+void ImportSettingsMenuItem(MCONTACT hContact)
{
if (hwnd2importWindow)
DestroyWindow(hwnd2importWindow);
@@ -625,7 +625,7 @@ BOOL Exists(LPCTSTR strName)
return GetFileAttributes(strName) != INVALID_FILE_ATTRIBUTES;
}
-void ImportSettingsFromFileMenuItem(HCONTACT hContact, char* FilePath)
+void ImportSettingsFromFileMenuItem(MCONTACT hContact, char* FilePath)
{
char szFileNames[MAX_PATH*10] = {0};
char szPath[MAX_PATH] = "";
diff --git a/plugins/DbEditorPP/src/findwindow.cpp b/plugins/DbEditorPP/src/findwindow.cpp
index 2f0f27e33a..6e981b1384 100644
--- a/plugins/DbEditorPP/src/findwindow.cpp
+++ b/plugins/DbEditorPP/src/findwindow.cpp
@@ -178,7 +178,7 @@ INT_PTR CALLBACK FindWindowDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
return 0;
}
-void ItemFound(HWND hwnd, HCONTACT hContact,const char *module,const char *setting,const char* value,int type)
+void ItemFound(HWND hwnd, MCONTACT hContact,const char *module,const char *setting,const char* value,int type)
{
ItemInfo *ii = (ItemInfo*)mir_calloc(sizeof(ItemInfo));
if (!ii) return;
@@ -262,7 +262,7 @@ char* multiReplace(const char* value, const char *find, const char *replace, int
return mir_tstrdup(value);
}
-int replaceValue(HWND hwnd, HCONTACT hContact, const char *module, const char *setting, DBVARIANT *dbv, const char *find, const char *replace, int mode)
+int replaceValue(HWND hwnd, MCONTACT hContact, const char *module, const char *setting, DBVARIANT *dbv, const char *find, const char *replace, int mode)
{
int count = 0;
DWORD num = 0;
@@ -334,7 +334,7 @@ int replaceValue(HWND hwnd, HCONTACT hContact, const char *module, const char *s
return count;
}
-int replaceSetting(HWND hwnd, HCONTACT hContact, const char *module, const char *setting, DBVARIANT *dbv, const char *find, const char *replace, int mode)
+int replaceSetting(HWND hwnd, MCONTACT hContact, const char *module, const char *setting, DBVARIANT *dbv, const char *find, const char *replace, int mode)
{
char *szSetting;
ptrA myreplace;
@@ -370,7 +370,7 @@ int replaceSetting(HWND hwnd, HCONTACT hContact, const char *module, const char
}
-int replaceModule(HWND hwnd, HCONTACT hContact, const char *module, const char *find, const char *replace, int mode)
+int replaceModule(HWND hwnd, MCONTACT hContact, const char *module, const char *find, const char *replace, int mode)
{
ModuleSettingLL msll;
ModSetLinkLinkItem *setting;
@@ -468,7 +468,7 @@ void __cdecl FindSettings(LPVOID di)
int options = ((FindInfo*)di)->options;
ModuleSettingLL ModuleList, SettingList;
ModSetLinkLinkItem *module, *setting;
- HCONTACT hContact;
+ MCONTACT hContact;
DBVARIANT dbv = { 0 };
int caseSensitive = options & FW_CASE;
int exactMatch = options & FW_EXACT;
diff --git a/plugins/DbEditorPP/src/headers.h b/plugins/DbEditorPP/src/headers.h
index 4e3a2f8b9f..d6e0c7006a 100644
--- a/plugins/DbEditorPP/src/headers.h
+++ b/plugins/DbEditorPP/src/headers.h
@@ -57,7 +57,7 @@ HICON LoadSkinnedDBEIcon(int icon);
int AddIconToList(HIMAGELIST hil, HICON hIcon);
void AddProtoIconsToList(HIMAGELIST hil, int newshift);
int GetProtoIcon(char *szProto);
-extern HCONTACT hRestore;
+extern MCONTACT hRestore;
extern HGENMENU hUserMenu;
/////////////////////
@@ -109,11 +109,11 @@ extern HGENMENU hUserMenu;
typedef struct {
int type; // from above types
- HCONTACT hContact;
+ MCONTACT hContact;
} ModuleTreeInfoStruct;
typedef struct {
- HCONTACT hContact;
+ MCONTACT hContact;
char* module;
HWND hwnd2Edit;
int selectedItem; // item that is currently selected
@@ -125,7 +125,7 @@ typedef struct {
struct DBsetting {
DBVARIANT dbv;
- HCONTACT hContact;
+ MCONTACT hContact;
char *module;
char *setting;
int WatchModule; // above defines
@@ -133,7 +133,7 @@ struct DBsetting {
typedef struct {
char module[256];
- HCONTACT hContact;
+ MCONTACT hContact;
} ModuleAndContact;
// find window
@@ -143,7 +143,7 @@ typedef struct {
typedef struct {
int type; // above types
- HCONTACT hContact;
+ MCONTACT hContact;
char module[256];
char setting[256];
} ItemInfo;
@@ -182,67 +182,67 @@ extern BOOL usePopups;
#define HEX_DWORD 4
//main.c
-int DBGetContactSettingStringStatic(HCONTACT hContact, char* szModule, char* szSetting, char* value, int maxLength);
-int WriteBlobFromString(HCONTACT hContact,const char *szModule,const char *szSetting, const char *Value, int len);
-int GetSetting(HCONTACT hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv);
-int GetValue(HCONTACT hContact, const char* szModule, const char* szSetting, char* Value, int length);
-int GetValueW(HCONTACT hContact, const char* szModule, const char* szSetting, WCHAR* Value, int length);
+int DBGetContactSettingStringStatic(MCONTACT hContact, char* szModule, char* szSetting, char* value, int maxLength);
+int WriteBlobFromString(MCONTACT hContact,const char *szModule,const char *szSetting, const char *Value, int len);
+int GetSetting(MCONTACT hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv);
+int GetValue(MCONTACT hContact, const char* szModule, const char* szSetting, char* Value, int length);
+int GetValueW(MCONTACT hContact, const char* szModule, const char* szSetting, WCHAR* Value, int length);
char* u2a( wchar_t* src );
wchar_t *a2u( char* src , wchar_t *buffer, int len );
-WCHAR *GetContactName(HCONTACT hContact, const char *szProto, int unicode);
+WCHAR *GetContactName(MCONTACT hContact, const char *szProto, int unicode);
BOOL IsProtocolLoaded(char* pszProtocolName);
// main_window.c
INT_PTR CALLBACK MainDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
// modules.c
-int deleteModule(char* module, HCONTACT hContact, int fromMenu);
+int deleteModule(char* module, MCONTACT hContact, int fromMenu);
void deleteModuleGui();
-void renameModule(char* oldName, char* newName, HCONTACT hContact);
+void renameModule(char* oldName, char* newName, MCONTACT hContact);
INT_PTR CALLBACK AddModDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
-int CloneContact(HCONTACT hContact);
+int CloneContact(MCONTACT hContact);
// moduletree.c
-void replaceTreeItem(HWND hwnd, HCONTACT hContact, const char *module, const char *newModule);
+void replaceTreeItem(HWND hwnd, MCONTACT hContact, const char *module, const char *newModule);
void refreshTree(BOOL restore);
void __cdecl PopulateModuleTreeThreadFunc(LPVOID di);
-void freeTree(HWND hwnd2Tree, HCONTACT hContact);
-int findItemInTree(HWND hwnd2Tree, HCONTACT hContact, char* module);
+void freeTree(HWND hwnd2Tree, MCONTACT hContact);
+int findItemInTree(HWND hwnd2Tree, MCONTACT hContact, char* module);
// settinglist.c
void setupSettingsList(HWND hwnd2List);
void saveListSettings(HWND hwnd2List);
void ClearListview(HWND hwnd2Settings);
-void DeleteSettingsFromList(HWND hSettings, HCONTACT hContact, char *module, char *setting);
-void PopulateSettings(HWND hwnd2Settings, HCONTACT hContact, char* module);
+void DeleteSettingsFromList(HWND hSettings, MCONTACT hContact, char *module, char *setting);
+void PopulateSettings(HWND hwnd2Settings, MCONTACT hContact, char* module);
void SelectSetting(char* setting);
// addeditsettingsdlg.c
INT_PTR CALLBACK EditSettingDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
-void editSetting(HCONTACT hContact, char* module, char* setting);
-BOOL convertSetting(HCONTACT hContact, char* module, char* setting, int toType); // 0 = byte, 1 = word, 2 = dword, 3 = string
+void editSetting(MCONTACT hContact, char* module, char* setting);
+BOOL convertSetting(MCONTACT hContact, char* module, char* setting, int toType); // 0 = byte, 1 = word, 2 = dword, 3 = string
// exportimport.c
-void exportDB(HCONTACT hContact, char* module); // hContact == -1 export entire db. module == NULL export entire contact
-void ImportSettingsMenuItem(HCONTACT hContact);
-void ImportSettingsFromFileMenuItem(HCONTACT hContact, char* FilePath);
+void exportDB(MCONTACT hContact, char* module); // hContact == -1 export entire db. module == NULL export entire contact
+void ImportSettingsMenuItem(MCONTACT hContact);
+void ImportSettingsFromFileMenuItem(MCONTACT hContact, char* FilePath);
// find window.c
INT_PTR CALLBACK FindWindowDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
// copymodule.c
-void copyModuleMenuItem(char* module, HCONTACT hContact);
-void copyModule(char* module, HCONTACT hContactFrom, HCONTACT hContactTo);
+void copyModuleMenuItem(char* module, MCONTACT hContact);
+void copyModule(char* module, MCONTACT hContactFrom, MCONTACT hContactTo);
// options.c
int OptInit(WPARAM wParam,LPARAM lParam);
// watchlist
-int addSettingToWatchList(HCONTACT hContact, char* module, char* setting);
+int addSettingToWatchList(MCONTACT hContact, char* module, char* setting);
void freeWatchListItem(int item);
void PopulateWatchedWindow(HWND hwnd);
void freeAllWatches();
INT_PTR CALLBACK WatchDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
-void popupWatchedVar(HCONTACT hContact,const char* module,const char* setting);
+void popupWatchedVar(MCONTACT hContact,const char* module,const char* setting);
#endif //_COMMONHEADERS_H \ No newline at end of file
diff --git a/plugins/DbEditorPP/src/main.cpp b/plugins/DbEditorPP/src/main.cpp
index 0c621f7169..d0691b97ec 100644
--- a/plugins/DbEditorPP/src/main.cpp
+++ b/plugins/DbEditorPP/src/main.cpp
@@ -11,7 +11,7 @@ int hLangpack;
BYTE nameOrder[NAMEORDERCOUNT];
HGENMENU hUserMenu;
WatchListArrayStruct WatchListArray;
-HCONTACT hRestore;
+MCONTACT hRestore;
HANDLE sMenuCommand, sImport, sServicemodeLaunch;
HANDLE hModulesLoadedHook = NULL, hSettingsChangedHook=NULL, hOptInitHook=NULL, hPreShutdownHook=NULL;
@@ -51,12 +51,12 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
return TRUE;
}
-void settingChanged(HWND hwnd2Settings, HCONTACT hContact, char* module, char* setting);
+void settingChanged(HWND hwnd2Settings, MCONTACT hContact, char* module, char* setting);
int DBSettingChanged(WPARAM wParam,LPARAM lParam)
{
DBCONTACTWRITESETTING *cws=(DBCONTACTWRITESETTING*)lParam;
- HCONTACT hContact = (HCONTACT)wParam;
+ MCONTACT hContact = (MCONTACT)wParam;
char *setting;
SettingListInfo* info;
@@ -106,7 +106,7 @@ int DBSettingChanged(WPARAM wParam,LPARAM lParam)
INT_PTR DBEditorppMenuCommand(WPARAM wParam, LPARAM lParam)
{
if (!hwnd2mainWindow) { // so only opens 1 at a time
- hRestore = (HCONTACT)wParam;
+ hRestore = (MCONTACT)wParam;
SetCursor(LoadCursor(NULL,IDC_WAIT));
CreateDialog(hInst, MAKEINTRESOURCE(IDD_MAIN), 0, MainDlgProc);
}
@@ -114,7 +114,7 @@ INT_PTR DBEditorppMenuCommand(WPARAM wParam, LPARAM lParam)
ShowWindow(hwnd2mainWindow, SW_RESTORE);
SetForegroundWindow(hwnd2mainWindow);
if (!hRestore && wParam) {
- hRestore = (HCONTACT)wParam;
+ hRestore = (MCONTACT)wParam;
refreshTree(4);
}
}
@@ -225,7 +225,7 @@ INT_PTR ServiceMode(WPARAM wParam, LPARAM lParam)
INT_PTR ImportFromFile(WPARAM wParam, LPARAM lParam)
{
- ImportSettingsFromFileMenuItem((HCONTACT)wParam, (char*)lParam);
+ ImportSettingsFromFileMenuItem((MCONTACT)wParam, (char*)lParam);
return 0;
}
@@ -267,7 +267,7 @@ extern "C" __declspec(dllexport) int Unload(void)
// db_get_s (prob shouldnt use this unless u know how big the string is gonna be..)
//=======================================================
-int DBGetContactSettingStringStatic(HCONTACT hContact, char* szModule, char* szSetting, char* value, int maxLength)
+int DBGetContactSettingStringStatic(MCONTACT hContact, char* szModule, char* szSetting, char* value, int maxLength)
{
DBVARIANT dbv;
if (!db_get(hContact, szModule, szSetting, &dbv)) {
@@ -283,7 +283,7 @@ int DBGetContactSettingStringStatic(HCONTACT hContact, char* szModule, char* szS
return 0;
}
-int WriteBlobFromString(HCONTACT hContact,const char *szModule,const char *szSetting, const char *szValue, int len)
+int WriteBlobFromString(MCONTACT hContact,const char *szModule,const char *szSetting, const char *szValue, int len)
{
int j=0, i = 0;
BYTE *data = NULL;
@@ -316,12 +316,12 @@ int WriteBlobFromString(HCONTACT hContact,const char *szModule,const char *szSet
return 0;
}
-int GetSetting(HCONTACT hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv)
+int GetSetting(MCONTACT hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv)
{
return db_get_s(hContact, szModule, szSetting, dbv, 0);
}
-int GetValue(HCONTACT hContact, const char* szModule, const char* szSetting, char* Value, int length)
+int GetValue(MCONTACT hContact, const char* szModule, const char* szSetting, char* Value, int length)
{
DBVARIANT dbv = {0};
@@ -361,7 +361,7 @@ int GetValue(HCONTACT hContact, const char* szModule, const char* szSetting, cha
return 0;
}
-int GetValueW(HCONTACT hContact, const char* szModule, const char* szSetting, WCHAR* Value, int length)
+int GetValueW(MCONTACT hContact, const char* szModule, const char* szSetting, WCHAR* Value, int length)
{
DBVARIANT dbv = { 0 };
WCHAR *wc;
@@ -435,7 +435,7 @@ wchar_t* a2u(char* src, wchar_t *buffer, int len)
return result;
}
-int GetDatabaseString(HCONTACT hContact, const char *szModule, const char* szSetting, WCHAR *Value, int length, BOOL unicode)
+int GetDatabaseString(MCONTACT hContact, const char *szModule, const char* szSetting, WCHAR *Value, int length, BOOL unicode)
{
if (unicode)
return GetValueW(hContact, szModule, szSetting, Value, length);
@@ -443,7 +443,7 @@ int GetDatabaseString(HCONTACT hContact, const char *szModule, const char* szSet
return GetValue(hContact, szModule, szSetting, (char*)Value, length);
}
-WCHAR* GetContactName(HCONTACT hContact, const char *szProto, int unicode)
+WCHAR* GetContactName(MCONTACT hContact, const char *szProto, int unicode)
{
int i, r = 0;
static WCHAR res[512];
diff --git a/plugins/DbEditorPP/src/main_window.cpp b/plugins/DbEditorPP/src/main_window.cpp
index 714a5cfed2..02b0c98c9b 100644
--- a/plugins/DbEditorPP/src/main_window.cpp
+++ b/plugins/DbEditorPP/src/main_window.cpp
@@ -113,7 +113,7 @@ LRESULT CALLBACK ModuleTreeSubclassProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM
tvi.cchTextMax = 255;
if (TreeView_GetItem(hwnd,&tvi) && tvi.lParam) {
ModuleTreeInfoStruct *mtis = (ModuleTreeInfoStruct*)tvi.lParam;
- HCONTACT hContact = mtis->hContact;
+ MCONTACT hContact = mtis->hContact;
if (wParam == VK_DELETE) {
if ((mtis->type) & MODULE) {
if (deleteModule(module, hContact,0)) {
@@ -161,7 +161,7 @@ static LRESULT CALLBACK SettingListSubclassProc(HWND hwnd,UINT msg,WPARAM wParam
case WM_KEYDOWN:
if (wParam == VK_DELETE || wParam == VK_F5 || (wParam == VK_F2 && ListView_GetSelectedCount(hwnd) == 1)) {
char *module, setting[256];
- HCONTACT hContact;
+ MCONTACT hContact;
SettingListInfo* sli = (SettingListInfo*)GetWindowLongPtr(hwnd,GWLP_USERDATA);
if (!sli) break;
hContact = sli->hContact;
@@ -369,7 +369,7 @@ INT_PTR CALLBACK MainDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
if (item = TreeView_GetSelection(hwnd2Tree)) {
int type = MODULE;
TVITEM tvi = {0};
- HCONTACT hContact = NULL;
+ MCONTACT hContact = NULL;
tvi.mask=TVIF_HANDLE|TVIF_PARAM|TVIF_TEXT;
tvi.pszText = module;
tvi.cchTextMax = 255;
@@ -470,10 +470,10 @@ INT_PTR CALLBACK MainDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
freeAllWatches();
break;
case MENU_EXPORTDB: // all db
- exportDB((HCONTACT)INVALID_HANDLE_VALUE, 0);
+ exportDB(INVALID_CONTACT_ID, 0);
break;
case MENU_EXPORTCONTACT: // all contacts
- exportDB((HCONTACT)INVALID_HANDLE_VALUE, "");
+ exportDB(INVALID_CONTACT_ID, "");
break;
case MENU_EXPORTMODULE: // all settings
exportDB(NULL, 0);
diff --git a/plugins/DbEditorPP/src/modsettingenum.cpp b/plugins/DbEditorPP/src/modsettingenum.cpp
index dfc4c82a51..42e21b67f0 100644
--- a/plugins/DbEditorPP/src/modsettingenum.cpp
+++ b/plugins/DbEditorPP/src/modsettingenum.cpp
@@ -56,7 +56,7 @@ int enumSettingsProc(const char *szSetting, LPARAM lParam)
return enumModulesSettingsProc(szSetting, 0, lParam);
}
-int EnumSettings(HCONTACT hContact, char* module, ModuleSettingLL *msll)
+int EnumSettings(MCONTACT hContact, char* module, ModuleSettingLL *msll)
{
DBCONTACTENUMSETTINGS dbces;
// enum all setting the contact has for the module
@@ -73,7 +73,7 @@ int CheckIfModuleIsEmptyProc(const char *szSetting, LPARAM lParam)
return 1;
}
-int IsModuleEmpty(HCONTACT hContact, char* szModule)
+int IsModuleEmpty(MCONTACT hContact, char* szModule)
{
DBCONTACTENUMSETTINGS dbces;
dbces.pfnEnumProc = CheckIfModuleIsEmptyProc;
diff --git a/plugins/DbEditorPP/src/modsettingenum.h b/plugins/DbEditorPP/src/modsettingenum.h
index 145202575f..ea37a0d00b 100644
--- a/plugins/DbEditorPP/src/modsettingenum.h
+++ b/plugins/DbEditorPP/src/modsettingenum.h
@@ -11,8 +11,8 @@ struct ModuleSettingLL
};
int EnumModules(ModuleSettingLL *msll);
-int EnumSettings(HCONTACT hContact, char *module, ModuleSettingLL *msll);
+int EnumSettings(MCONTACT hContact, char *module, ModuleSettingLL *msll);
void FreeModuleSettingLL(ModuleSettingLL *msll);
-int IsModuleEmpty(HCONTACT hContact, char *szModule);
+int IsModuleEmpty(MCONTACT hContact, char *szModule);
diff --git a/plugins/DbEditorPP/src/modules.cpp b/plugins/DbEditorPP/src/modules.cpp
index b0765bd9b0..0ba361fe45 100644
--- a/plugins/DbEditorPP/src/modules.cpp
+++ b/plugins/DbEditorPP/src/modules.cpp
@@ -1,6 +1,6 @@
#include "headers.h"
-void renameModule(char* oldName, char* newName, HCONTACT hContact)
+void renameModule(char* oldName, char* newName, MCONTACT hContact)
{
DBVARIANT dbv;
ModuleSettingLL settinglist;
@@ -56,10 +56,10 @@ INT_PTR CALLBACK AddModDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam
if (IsDlgButtonChecked(hwnd, CHK_ADD2ALL)) {
// null contact
db_set_b(NULL, modulename, "(Default)", 0);
- for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
+ for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
db_set_b(hContact, modulename, "(Default)", 0);
}
- else db_set_b((HCONTACT)GetWindowLongPtr(hwnd, GWLP_USERDATA), modulename, "(Default)", 0);
+ else db_set_b((MCONTACT)GetWindowLongPtr(hwnd, GWLP_USERDATA), modulename, "(Default)", 0);
refreshTree(1);
}
@@ -72,9 +72,9 @@ INT_PTR CALLBACK AddModDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam
return 0;
}
-int CloneContact(HCONTACT hContact)
+int CloneContact(MCONTACT hContact)
{
- HCONTACT newContact = (HCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
+ MCONTACT newContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
if (!newContact)
return 0;
diff --git a/plugins/DbEditorPP/src/moduletree.cpp b/plugins/DbEditorPP/src/moduletree.cpp
index f2ed81003f..b6b150e7f5 100644
--- a/plugins/DbEditorPP/src/moduletree.cpp
+++ b/plugins/DbEditorPP/src/moduletree.cpp
@@ -6,7 +6,7 @@ static ModuleTreeInfoStruct contacts_mtis = {CONTACT_ROOT_ITEM, 0};
static ModuleTreeInfoStruct settings_mtis = {CONTACT, 0};
-int doContacts(HWND hwnd2Tree, HTREEITEM contactsRoot, ModuleSettingLL *modlist, HCONTACT hSelectedContact, char *SelectedModule, char *SelectedSetting)
+int doContacts(HWND hwnd2Tree, HTREEITEM contactsRoot, ModuleSettingLL *modlist, MCONTACT hSelectedContact, char *SelectedModule, char *SelectedSetting)
{
TVINSERTSTRUCT tvi;
HTREEITEM contact;
@@ -23,7 +23,7 @@ int doContacts(HWND hwnd2Tree, HTREEITEM contactsRoot, ModuleSettingLL *modlist,
tvi.hInsertAfter = TVI_SORT;
tvi.item.cChildren = 1;
- for (HCONTACT hContact = db_find_first(); hContact && hwnd2mainWindow; hContact = db_find_next(hContact)) {
+ for (MCONTACT hContact = db_find_first(); hContact && hwnd2mainWindow; hContact = db_find_next(hContact)) {
char szProto[100];
if (DBGetContactSettingStringStatic(hContact, "Protocol", "p", szProto, SIZEOF(szProto))) {
icon = GetProtoIcon(szProto);
@@ -124,7 +124,7 @@ void doItems(HWND hwnd2Tree,ModuleSettingLL *modlist, int count)
{
TVINSERTSTRUCT tvi;
TVITEM item ={0};
- HCONTACT hContact;
+ MCONTACT hContact;
ModuleTreeInfoStruct *lParam;
ModSetLinkLinkItem *module;
char percent[96], title[64];
@@ -183,7 +183,7 @@ void doItems(HWND hwnd2Tree,ModuleSettingLL *modlist, int count)
SetWindowText(hwnd, TranslateT("Database Editor++"));
}
-int findItemInTree(HWND hwnd2Tree, HCONTACT hContact, char* module)
+int findItemInTree(HWND hwnd2Tree, MCONTACT hContact, char* module)
/* the following code to go through the whole tree is nicked from codeguru..
http://www.codeguru.com/Cpp/controls/treeview/treetraversal/comments.php/c683/?thread=7680 */
{
@@ -218,7 +218,7 @@ int findItemInTree(HWND hwnd2Tree, HCONTACT hContact, char* module)
return -1;
}
-void freeTree(HWND hwnd2Tree, HCONTACT hContact)
+void freeTree(HWND hwnd2Tree, MCONTACT hContact)
/* the following code to go through the whole tree is nicked from codeguru..
http://www.codeguru.com/Cpp/controls/treeview/treetraversal/comments.php/c683/?thread=7680 */
{
@@ -256,7 +256,7 @@ void freeTree(HWND hwnd2Tree, HCONTACT hContact)
while (item.hItem);
}
-BOOL findAndRemoveDuplicates(HWND hwnd2Tree, HCONTACT hContact, char* module)
+BOOL findAndRemoveDuplicates(HWND hwnd2Tree, MCONTACT hContact, char* module)
/* the following code to go through the whole tree is nicked from codeguru..
http://www.codeguru.com/Cpp/controls/treeview/treetraversal/comments.php/c683/?thread=7680 */
{
@@ -306,7 +306,7 @@ BOOL findAndRemoveDuplicates(HWND hwnd2Tree, HCONTACT hContact, char* module)
}
-void replaceTreeItem(HWND hwnd, HCONTACT hContact, const char *module, const char *newModule)
+void replaceTreeItem(HWND hwnd, MCONTACT hContact, const char *module, const char *newModule)
{
int hItem = findItemInTree(hwnd, hContact, (char*)module);
HTREEITEM hParent;
@@ -360,8 +360,8 @@ void __cdecl PopulateModuleTreeThreadFunc(LPVOID di)
HWND hwnd2Tree = GetDlgItem(hwnd2mainWindow,IDC_MODULES);
char SelectedModule[256] = {0};
char SelectedSetting[256] = {0};
- HCONTACT hSelectedContact = hRestore;
- HCONTACT hContact;
+ MCONTACT hSelectedContact = hRestore;
+ MCONTACT hContact;
HTREEITEM contact, contactsRoot;
int count;
@@ -402,8 +402,8 @@ void __cdecl PopulateModuleTreeThreadFunc(LPVOID di)
}
case 2: // restore saved
if (GetValue(NULL,modname,"LastModule",SelectedModule,SIZEOF(SelectedModule))) {
- hSelectedContact = (HCONTACT)db_get_dw(NULL, modname, "LastContact", (DWORD)INVALID_HANDLE_VALUE);
- if (hSelectedContact != (HCONTACT)INVALID_HANDLE_VALUE)
+ hSelectedContact = (MCONTACT)db_get_dw(NULL, modname, "LastContact", (DWORD)INVALID_HANDLE_VALUE);
+ if (hSelectedContact != INVALID_CONTACT_ID)
Select = 1;
GetValue(NULL,modname,"LastSetting",SelectedSetting,SIZEOF(SelectedSetting));
}
@@ -411,7 +411,7 @@ void __cdecl PopulateModuleTreeThreadFunc(LPVOID di)
case 3: // restore from user menu
case 4: // jump from user menu
- if (hSelectedContact && hSelectedContact != (HCONTACT)INVALID_HANDLE_VALUE)
+ if (hSelectedContact && hSelectedContact != INVALID_CONTACT_ID)
Select = 1;
break;
}
@@ -557,7 +557,7 @@ void moduleListWM_NOTIFY(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam)// hwnd
HWND hwnd2Tree = GetDlgItem(hwnd2mainWindow,IDC_MODULES);
ModSetLinkLinkItem *module;
ModuleSettingLL modlist;
- HCONTACT hContact = mtis->hContact;
+ MCONTACT hContact = mtis->hContact;
mtis->type = CONTACT;
@@ -598,7 +598,7 @@ void moduleListWM_NOTIFY(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam)// hwnd
LPNMTREEVIEW pnmtv = (LPNMTREEVIEW)lParam;
TVITEM tvi = {0};
char text[264];
- HCONTACT hContact;
+ MCONTACT hContact;
HWND hwnd2Settings = GetDlgItem(hwnd, IDC_SETTINGS);
tvi.mask = TVIF_HANDLE|TVIF_PARAM|TVIF_TEXT;
tvi.hItem = pnmtv->itemNew.hItem;
@@ -767,7 +767,7 @@ void moduleListRightClick(HWND hwnd, WPARAM wParam,LPARAM lParam) // hwnd here i
TreeView_GetItem(((LPNMHDR)lParam)->hwndFrom,&tvi);
if (tvi.lParam) {
ModuleTreeInfoStruct *mtis = (ModuleTreeInfoStruct *)tvi.lParam;
- HCONTACT hContact = mtis->hContact;
+ MCONTACT hContact = mtis->hContact;
GetCursorPos(&(hti.pt));
hMenu = LoadMenu(hInst, MAKEINTRESOURCE(IDR_CONTEXTMENU));
TranslateMenu(hMenu);
@@ -829,7 +829,7 @@ void moduleListRightClick(HWND hwnd, WPARAM wParam,LPARAM lParam) // hwnd here i
break;
case MENU_EXPORTDB:
- exportDB((HCONTACT)INVALID_HANDLE_VALUE, module);
+ exportDB(INVALID_CONTACT_ID, module);
break;
}
}
@@ -907,7 +907,7 @@ void moduleListRightClick(HWND hwnd, WPARAM wParam,LPARAM lParam) // hwnd here i
case 4: // Contacts root
switch ( TrackPopupMenu(hSubMenu, TPM_RETURNCMD, hti.pt.x, hti.pt.y, 0, hwnd, NULL)) {
case MENU_EXPORTCONTACT:
- exportDB((HCONTACT)INVALID_HANDLE_VALUE, "");
+ exportDB(INVALID_CONTACT_ID, "");
break;
case MENU_IMPORTFROMTEXT:
ImportSettingsMenuItem(NULL);
diff --git a/plugins/DbEditorPP/src/settinglist.cpp b/plugins/DbEditorPP/src/settinglist.cpp
index d98f8a0144..84b9e8a0a3 100644
--- a/plugins/DbEditorPP/src/settinglist.cpp
+++ b/plugins/DbEditorPP/src/settinglist.cpp
@@ -53,7 +53,7 @@ void ClearListview(HWND hwnd2Settings)
ListView_DeleteAllItems(hwnd2Settings);
}
-void DeleteSettingsFromList(HWND hSettings, HCONTACT hContact, char *module, char *setting)
+void DeleteSettingsFromList(HWND hSettings, MCONTACT hContact, char *module, char *setting)
{
int count = ListView_GetSelectedCount(hSettings);
@@ -93,7 +93,7 @@ void DeleteSettingsFromList(HWND hSettings, HCONTACT hContact, char *module, cha
}
}
-void additem(HWND hwnd2Settings,HCONTACT hContact, char* module, char* setting, int index)
+void additem(HWND hwnd2Settings,MCONTACT hContact, char* module, char* setting, int index)
{
char *data = NULL;
LVITEM lvi;
@@ -213,7 +213,7 @@ void additem(HWND hwnd2Settings,HCONTACT hContact, char* module, char* setting,
mir_free(data);
}
-void PopulateSettings(HWND hwnd2Settings, HCONTACT hContact, char* module)
+void PopulateSettings(HWND hwnd2Settings, MCONTACT hContact, char* module)
{
SettingListInfo* info = (SettingListInfo*)mir_calloc(sizeof(SettingListInfo));
LVITEM lvItem;
@@ -270,7 +270,7 @@ void SelectSetting(char *setting)
}
}
-void settingChanged(HWND hwnd2Settings, HCONTACT hContact, char* module, char* setting)
+void settingChanged(HWND hwnd2Settings, MCONTACT hContact, char* module, char* setting)
{
LVITEM lvItem;
LVFINDINFO lvfi;
@@ -296,7 +296,7 @@ static WNDPROC SettingLabelEditSubClass;
struct EditLabelInfoStruct
{
- HCONTACT hContact;
+ MCONTACT hContact;
char module[256];
char setting[256];
int item;
@@ -762,7 +762,7 @@ void SettingsListRightClick(HWND hwnd, WPARAM wParam, LPARAM lParam) // hwnd her
return;
char setting[256], *module;
- HCONTACT hContact;
+ MCONTACT hContact;
LVHITTESTINFO hti;
POINT pt;
HMENU hMenu, hSubMenu;
diff --git a/plugins/DbEditorPP/src/watchedvars.cpp b/plugins/DbEditorPP/src/watchedvars.cpp
index f4dc64f79e..df5468c285 100644
--- a/plugins/DbEditorPP/src/watchedvars.cpp
+++ b/plugins/DbEditorPP/src/watchedvars.cpp
@@ -1,6 +1,6 @@
#include "headers.h"
-int addSettingToWatchList(HCONTACT hContact, char* module, char* setting)
+int addSettingToWatchList(MCONTACT hContact, char* module, char* setting)
{
if (WatchListArray.count == WatchListArray.size)
{
@@ -36,7 +36,7 @@ void addwatchtolist(HWND hwnd2list, struct DBsetting *lParam)
int index;
char data[32], tmp[32];
DBVARIANT *dbv = &(lParam->dbv);
- HCONTACT hContact = lParam->hContact;
+ MCONTACT hContact = lParam->hContact;
char *module = lParam->module;
char *setting = lParam->setting;
if (!module) return;
@@ -263,7 +263,7 @@ INT_PTR CALLBACK WatchDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
if (ListView_GetItem(GetDlgItem(hwnd,IDC_VARS),&lvi))
{
ItemInfo ii;
- ii.hContact = (HCONTACT)lvi.lParam;
+ ii.hContact = (MCONTACT)lvi.lParam;
ListView_GetItemText(GetDlgItem(hwnd,IDC_VARS),hti.iItem,1,ii.module,128);
ListView_GetItemText(GetDlgItem(hwnd,IDC_VARS),hti.iItem,2,ii.setting,128);
ii.type = FW_SETTINGNAME;
@@ -282,7 +282,7 @@ INT_PTR CALLBACK WatchDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
}
-void popupWatchedVar(HCONTACT hContact,const char* module,const char* setting)
+void popupWatchedVar(MCONTACT hContact,const char* module,const char* setting)
{
HICON hIcon = LoadIcon(hInst, MAKEINTRESOURCE(ICO_REGEDIT));
char lpzContactName[MAX_CONTACTNAME];
@@ -329,7 +329,7 @@ void popupWatchedVar(HCONTACT hContact,const char* module,const char* setting)
db_free(&dbv);
POPUPDATA ppd = { 0 };
- ppd.lchContact = (HCONTACT)hContact;
+ ppd.lchContact = (MCONTACT)hContact;
ppd.lchIcon = hIcon;
lstrcpyn(ppd.lpzContactName, lpzContactName,MAX_CONTACTNAME);
lstrcpyn(ppd.lpzText, lpzText,MAX_SECONDLINE);