diff options
author | George Hazan <george.hazan@gmail.com> | 2014-02-10 08:04:30 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-02-10 08:04:30 +0000 |
commit | ddba4ede6b451d0cfcd0d32b5180fbd0689966bf (patch) | |
tree | 5d74f37a7013d13b92c182628d6b68a58e148ae4 /plugins/DbEditorPP | |
parent | c39340bf493a1745a41317bbf937fc7eb6cbb26a (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 'plugins/DbEditorPP')
-rw-r--r-- | plugins/DbEditorPP/src/addeditsettingsdlg.cpp | 6 | ||||
-rw-r--r-- | plugins/DbEditorPP/src/copymodule.cpp | 10 | ||||
-rw-r--r-- | plugins/DbEditorPP/src/deletemodule.cpp | 6 | ||||
-rw-r--r-- | plugins/DbEditorPP/src/exportimport.cpp | 24 | ||||
-rw-r--r-- | plugins/DbEditorPP/src/findwindow.cpp | 10 | ||||
-rw-r--r-- | plugins/DbEditorPP/src/headers.h | 58 | ||||
-rw-r--r-- | plugins/DbEditorPP/src/main.cpp | 26 | ||||
-rw-r--r-- | plugins/DbEditorPP/src/main_window.cpp | 10 | ||||
-rw-r--r-- | plugins/DbEditorPP/src/modsettingenum.cpp | 4 | ||||
-rw-r--r-- | plugins/DbEditorPP/src/modsettingenum.h | 4 | ||||
-rw-r--r-- | plugins/DbEditorPP/src/modules.cpp | 10 | ||||
-rw-r--r-- | plugins/DbEditorPP/src/moduletree.cpp | 33 | ||||
-rw-r--r-- | plugins/DbEditorPP/src/settinglist.cpp | 12 | ||||
-rw-r--r-- | plugins/DbEditorPP/src/watchedvars.cpp | 10 |
14 files changed, 111 insertions, 112 deletions
diff --git a/plugins/DbEditorPP/src/addeditsettingsdlg.cpp b/plugins/DbEditorPP/src/addeditsettingsdlg.cpp index cf8587611e..0a28996127 100644 --- a/plugins/DbEditorPP/src/addeditsettingsdlg.cpp +++ b/plugins/DbEditorPP/src/addeditsettingsdlg.cpp @@ -1,6 +1,6 @@ #include "headers.h"
-static BOOL Convert(HANDLE hContact, char* module, char* setting, int value, int toType) // 0 = byte, 1 = word, 2 = dword, 3 = string
+static BOOL Convert(HCONTACT 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(HANDLE hContact, char* module, char* setting, int value, int }
-BOOL convertSetting(HANDLE hContact, char* module, char* setting, int toType) // 0 = byte, 1 = word, 2 = dword, 3 = string, 4 = unicode
+BOOL convertSetting(HCONTACT 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(HANDLE hContact, char* module, char* setting)
+void editSetting(HCONTACT 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 e3884fb123..db23d4ab21 100644 --- a/plugins/DbEditorPP/src/copymodule.cpp +++ b/plugins/DbEditorPP/src/copymodule.cpp @@ -1,6 +1,6 @@ #include "headers.h"
-void copyModule(char* module, HANDLE hContactFrom, HANDLE hContactTo)
+void copyModule(char* module, HCONTACT hContactFrom, HCONTACT 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 (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
+ for (HCONTACT 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)) {
- HANDLE hContact = (HANDLE)SendMessage(GetDlgItem(hwnd, IDC_CONTACTS), CB_GETITEMDATA, SendMessage(GetDlgItem(hwnd, IDC_CONTACTS), CB_GETCURSEL, 0, 0), 0);
+ HCONTACT hContact = (HCONTACT)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 (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
+ for (HCONTACT 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, HANDLE hContact)
+void copyModuleMenuItem(char* module, HCONTACT 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 188f96460d..73d277e100 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, HANDLE hContact, int fromMenu)
+int deleteModule(char* module, HCONTACT hContact, int fromMenu)
{
char msg[1024];
ModuleSettingLL settinglist;
@@ -47,7 +47,7 @@ void __cdecl PopulateModuleDropListThreadFunc(LPVOID di) module = module->next;
continue;
}
- for (HANDLE hContact = db_find_first();moduleEmpty && hContact;hContact = db_find_next(hContact)) {
+ for (HCONTACT 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 (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
+ for (HCONTACT 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 4a438546d2..aaae21dcd1 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(HANDLE hContact, char* module, FILE* file)
+void exportModule(HCONTACT hContact, char* module, FILE* file)
{
char tmp[32];
ModuleSettingLL settinglist;
@@ -152,7 +152,7 @@ void exportModule(HANDLE hContact, char* module, FILE* file) FreeModuleSettingLL(&settinglist);
}
-char *NickFromHContact(HANDLE hContact)
+char *NickFromHContact(HCONTACT hContact)
{
static char nick[512] = "";
@@ -193,7 +193,7 @@ char *NickFromHContact(HANDLE hContact) return nick;
}
-void exportDB(HANDLE hContact, char* module) // hContact == -1 export entire db. module == NULL export entire contact.
+void exportDB(HCONTACT 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];
@@ -326,20 +326,20 @@ void exportDB(HANDLE hContact, char* module) // hContact == -1 export entire db. FreeModuleSettingLL(&modlist);
}
-HANDLE CheckNewContact(char *myProto, char *uid, char *myName)
+HCONTACT CheckNewContact(char *myProto, char *uid, char *myName)
{
char szProto[256], szName[256];
- for (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
+ for (HCONTACT 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 INVALID_HANDLE_VALUE;
+ return (HCONTACT)INVALID_HANDLE_VALUE;
}
-void importSettings(HANDLE hContact, char *importstring )
+void importSettings(HCONTACT hContact, char *importstring )
{
char module[256] = "", setting[256] = "", *end;
int i=0, value, type;
@@ -364,7 +364,7 @@ void importSettings(HANDLE hContact, char *importstring ) else if (!strncmp(&importstring[i],"CONTACT:", strlen("CONTACT:")))
{
int len, add = 1;
- hContact = INVALID_HANDLE_VALUE;
+ hContact = (HCONTACT)INVALID_HANDLE_VALUE;
i = i + (int)strlen("CONTACT:");
len = (int)strlen(&importstring[i]);
@@ -405,7 +405,7 @@ void importSettings(HANDLE hContact, char *importstring ) if (hContact == INVALID_HANDLE_VALUE)
{
- HANDLE temp = (HANDLE)CallService(MS_DB_CONTACT_ADD,0,0);
+ HCONTACT temp = (HCONTACT)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:
{
- HANDLE hContact = (HANDLE)GetWindowLongPtr(hwnd,GWLP_USERDATA);
+ HCONTACT hContact = (HCONTACT)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(HANDLE hContact)
+void ImportSettingsMenuItem(HCONTACT hContact)
{
if (hwnd2importWindow)
DestroyWindow(hwnd2importWindow);
@@ -625,7 +625,7 @@ BOOL Exists(LPCTSTR strName) return GetFileAttributes(strName) != INVALID_FILE_ATTRIBUTES;
}
-void ImportSettingsFromFileMenuItem(HANDLE hContact, char* FilePath)
+void ImportSettingsFromFileMenuItem(HCONTACT 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 6ac376233d..2f0f27e33a 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, HANDLE hContact,const char *module,const char *setting,const char* value,int type)
+void ItemFound(HWND hwnd, HCONTACT 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, HANDLE hContact, const char *module, const char *setting, DBVARIANT *dbv, const char *find, const char *replace, int mode)
+int replaceValue(HWND hwnd, HCONTACT 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, HANDLE hContact, const char *module, const char *set return count;
}
-int replaceSetting(HWND hwnd, HANDLE hContact, const char *module, const char *setting, DBVARIANT *dbv, const char *find, const char *replace, int mode)
+int replaceSetting(HWND hwnd, HCONTACT 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, HANDLE hContact, const char *module, const char *s }
-int replaceModule(HWND hwnd, HANDLE hContact, const char *module, const char *find, const char *replace, int mode)
+int replaceModule(HWND hwnd, HCONTACT 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;
- HANDLE hContact;
+ HCONTACT 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 d5bf500565..4e3a2f8b9f 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 HANDLE hRestore;
+extern HCONTACT hRestore;
extern HGENMENU hUserMenu;
/////////////////////
@@ -109,11 +109,11 @@ extern HGENMENU hUserMenu; typedef struct {
int type; // from above types
- HANDLE hContact;
+ HCONTACT hContact;
} ModuleTreeInfoStruct;
typedef struct {
- HANDLE hContact;
+ HCONTACT hContact;
char* module;
HWND hwnd2Edit;
int selectedItem; // item that is currently selected
@@ -125,7 +125,7 @@ typedef struct { struct DBsetting {
DBVARIANT dbv;
- HANDLE hContact;
+ HCONTACT hContact;
char *module;
char *setting;
int WatchModule; // above defines
@@ -133,7 +133,7 @@ struct DBsetting { typedef struct {
char module[256];
- HANDLE hContact;
+ HCONTACT hContact;
} ModuleAndContact;
// find window
@@ -143,7 +143,7 @@ typedef struct { typedef struct {
int type; // above types
- HANDLE hContact;
+ HCONTACT hContact;
char module[256];
char setting[256];
} ItemInfo;
@@ -182,67 +182,67 @@ extern BOOL usePopups; #define HEX_DWORD 4
//main.c
-int DBGetContactSettingStringStatic(HANDLE hContact, char* szModule, char* szSetting, char* value, int maxLength);
-int WriteBlobFromString(HANDLE hContact,const char *szModule,const char *szSetting, const char *Value, int len);
-int GetSetting(HANDLE hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv);
-int GetValue(HANDLE hContact, const char* szModule, const char* szSetting, char* Value, int length);
-int GetValueW(HANDLE hContact, const char* szModule, const char* szSetting, WCHAR* Value, int length);
+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);
char* u2a( wchar_t* src );
wchar_t *a2u( char* src , wchar_t *buffer, int len );
-WCHAR *GetContactName(HANDLE hContact, const char *szProto, int unicode);
+WCHAR *GetContactName(HCONTACT 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, HANDLE hContact, int fromMenu);
+int deleteModule(char* module, HCONTACT hContact, int fromMenu);
void deleteModuleGui();
-void renameModule(char* oldName, char* newName, HANDLE hContact);
+void renameModule(char* oldName, char* newName, HCONTACT hContact);
INT_PTR CALLBACK AddModDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
-int CloneContact(HANDLE hContact);
+int CloneContact(HCONTACT hContact);
// moduletree.c
-void replaceTreeItem(HWND hwnd, HANDLE hContact, const char *module, const char *newModule);
+void replaceTreeItem(HWND hwnd, HCONTACT hContact, const char *module, const char *newModule);
void refreshTree(BOOL restore);
void __cdecl PopulateModuleTreeThreadFunc(LPVOID di);
-void freeTree(HWND hwnd2Tree, HANDLE hContact);
-int findItemInTree(HWND hwnd2Tree, HANDLE hContact, char* module);
+void freeTree(HWND hwnd2Tree, HCONTACT hContact);
+int findItemInTree(HWND hwnd2Tree, HCONTACT hContact, char* module);
// settinglist.c
void setupSettingsList(HWND hwnd2List);
void saveListSettings(HWND hwnd2List);
void ClearListview(HWND hwnd2Settings);
-void DeleteSettingsFromList(HWND hSettings, HANDLE hContact, char *module, char *setting);
-void PopulateSettings(HWND hwnd2Settings, HANDLE hContact, char* module);
+void DeleteSettingsFromList(HWND hSettings, HCONTACT hContact, char *module, char *setting);
+void PopulateSettings(HWND hwnd2Settings, HCONTACT hContact, char* module);
void SelectSetting(char* setting);
// addeditsettingsdlg.c
INT_PTR CALLBACK EditSettingDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
-void editSetting(HANDLE hContact, char* module, char* setting);
-BOOL convertSetting(HANDLE hContact, char* module, char* setting, int toType); // 0 = byte, 1 = word, 2 = dword, 3 = string
+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
// exportimport.c
-void exportDB(HANDLE hContact, char* module); // hContact == -1 export entire db. module == NULL export entire contact
-void ImportSettingsMenuItem(HANDLE hContact);
-void ImportSettingsFromFileMenuItem(HANDLE hContact, char* FilePath);
+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);
// find window.c
INT_PTR CALLBACK FindWindowDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
// copymodule.c
-void copyModuleMenuItem(char* module, HANDLE hContact);
-void copyModule(char* module, HANDLE hContactFrom, HANDLE hContactTo);
+void copyModuleMenuItem(char* module, HCONTACT hContact);
+void copyModule(char* module, HCONTACT hContactFrom, HCONTACT hContactTo);
// options.c
int OptInit(WPARAM wParam,LPARAM lParam);
// watchlist
-int addSettingToWatchList(HANDLE hContact, char* module, char* setting);
+int addSettingToWatchList(HCONTACT 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(HANDLE hContact,const char* module,const char* setting);
+void popupWatchedVar(HCONTACT 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 642f73bb4d..0c621f7169 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;
-HANDLE hRestore;
+HCONTACT 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, HANDLE hContact, char* module, char* setting);
+void settingChanged(HWND hwnd2Settings, HCONTACT hContact, char* module, char* setting);
int DBSettingChanged(WPARAM wParam,LPARAM lParam)
{
DBCONTACTWRITESETTING *cws=(DBCONTACTWRITESETTING*)lParam;
- HANDLE hContact = (HANDLE)wParam;
+ HCONTACT hContact = (HCONTACT)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 = (HANDLE)wParam;
+ hRestore = (HCONTACT)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 = (HANDLE)wParam;
+ hRestore = (HCONTACT)wParam;
refreshTree(4);
}
}
@@ -225,7 +225,7 @@ INT_PTR ServiceMode(WPARAM wParam, LPARAM lParam) INT_PTR ImportFromFile(WPARAM wParam, LPARAM lParam)
{
- ImportSettingsFromFileMenuItem((HANDLE)wParam, (char*)lParam);
+ ImportSettingsFromFileMenuItem((HCONTACT)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(HANDLE hContact, char* szModule, char* szSetting, char* value, int maxLength)
+int DBGetContactSettingStringStatic(HCONTACT hContact, char* szModule, char* szSetting, char* value, int maxLength)
{
DBVARIANT dbv;
if (!db_get(hContact, szModule, szSetting, &dbv)) {
@@ -283,7 +283,7 @@ int DBGetContactSettingStringStatic(HANDLE hContact, char* szModule, char* szSet return 0;
}
-int WriteBlobFromString(HANDLE hContact,const char *szModule,const char *szSetting, const char *szValue, int len)
+int WriteBlobFromString(HCONTACT 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(HANDLE hContact,const char *szModule,const char *szSetti return 0;
}
-int GetSetting(HANDLE hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv)
+int GetSetting(HCONTACT hContact, const char *szModule, const char *szSetting, DBVARIANT *dbv)
{
return db_get_s(hContact, szModule, szSetting, dbv, 0);
}
-int GetValue(HANDLE hContact, const char* szModule, const char* szSetting, char* Value, int length)
+int GetValue(HCONTACT hContact, const char* szModule, const char* szSetting, char* Value, int length)
{
DBVARIANT dbv = {0};
@@ -361,7 +361,7 @@ int GetValue(HANDLE hContact, const char* szModule, const char* szSetting, char* return 0;
}
-int GetValueW(HANDLE hContact, const char* szModule, const char* szSetting, WCHAR* Value, int length)
+int GetValueW(HCONTACT 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(HANDLE hContact, const char *szModule, const char* szSetting, WCHAR *Value, int length, BOOL unicode)
+int GetDatabaseString(HCONTACT 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(HANDLE hContact, const char *szModule, const char* szSetti return GetValue(hContact, szModule, szSetting, (char*)Value, length);
}
-WCHAR* GetContactName(HANDLE hContact, const char *szProto, int unicode)
+WCHAR* GetContactName(HCONTACT 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 087fd2405b..714a5cfed2 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;
- HANDLE hContact = mtis->hContact;
+ HCONTACT 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];
- HANDLE hContact;
+ HCONTACT 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};
- HANDLE hContact = NULL;
+ HCONTACT 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(INVALID_HANDLE_VALUE,0);
+ exportDB((HCONTACT)INVALID_HANDLE_VALUE, 0);
break;
case MENU_EXPORTCONTACT: // all contacts
- exportDB(INVALID_HANDLE_VALUE, "");
+ exportDB((HCONTACT)INVALID_HANDLE_VALUE, "");
break;
case MENU_EXPORTMODULE: // all settings
exportDB(NULL, 0);
diff --git a/plugins/DbEditorPP/src/modsettingenum.cpp b/plugins/DbEditorPP/src/modsettingenum.cpp index 96d198b682..dfc4c82a51 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(HANDLE hContact, char* module, ModuleSettingLL *msll)
+int EnumSettings(HCONTACT 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(HANDLE hContact, char* szModule)
+int IsModuleEmpty(HCONTACT hContact, char* szModule)
{
DBCONTACTENUMSETTINGS dbces;
dbces.pfnEnumProc = CheckIfModuleIsEmptyProc;
diff --git a/plugins/DbEditorPP/src/modsettingenum.h b/plugins/DbEditorPP/src/modsettingenum.h index 633d2d1470..145202575f 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(HANDLE hContact, char *module, ModuleSettingLL *msll);
+int EnumSettings(HCONTACT hContact, char *module, ModuleSettingLL *msll);
void FreeModuleSettingLL(ModuleSettingLL *msll);
-int IsModuleEmpty(HANDLE hContact, char *szModule);
+int IsModuleEmpty(HCONTACT hContact, char *szModule);
diff --git a/plugins/DbEditorPP/src/modules.cpp b/plugins/DbEditorPP/src/modules.cpp index 603b601307..b0765bd9b0 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, HANDLE hContact)
+void renameModule(char* oldName, char* newName, HCONTACT 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 (HANDLE hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
+ for (HCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact))
db_set_b(hContact, modulename, "(Default)", 0);
}
- else db_set_b((HANDLE)GetWindowLongPtr(hwnd, GWLP_USERDATA), modulename, "(Default)", 0);
+ else db_set_b((HCONTACT)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(HANDLE hContact)
+int CloneContact(HCONTACT hContact)
{
- HANDLE newContact = (HANDLE)CallService(MS_DB_CONTACT_ADD, 0, 0);
+ HCONTACT newContact = (HCONTACT)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 bcbc1ac109..2f3c1d13f4 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, HANDLE hSelectedContact, char *SelectedModule, char *SelectedSetting)
+int doContacts(HWND hwnd2Tree, HTREEITEM contactsRoot, ModuleSettingLL *modlist, HCONTACT hSelectedContact, char *SelectedModule, char *SelectedSetting)
{
TVINSERTSTRUCT tvi;
HTREEITEM contact;
@@ -23,7 +23,7 @@ int doContacts(HWND hwnd2Tree,HTREEITEM contactsRoot,ModuleSettingLL *modlist, H tvi.hInsertAfter = TVI_SORT;
tvi.item.cChildren = 1;
- for (HANDLE hContact = db_find_first(); hContact && hwnd2mainWindow; hContact = db_find_next(hContact)) {
+ for (HCONTACT 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);
@@ -61,8 +61,7 @@ int doContacts(HWND hwnd2Tree,HTREEITEM contactsRoot,ModuleSettingLL *modlist, H else
protoW[0] = 0;
- if (!szProto || !loaded)
- {
+ if (!szProto || !loaded) {
tvi.item.iSelectedImage = (tvi.item.iImage = 4);
if (protoW) {
@@ -125,7 +124,7 @@ void doItems(HWND hwnd2Tree,ModuleSettingLL *modlist, int count) {
TVINSERTSTRUCT tvi;
TVITEM item ={0};
- HANDLE hContact;
+ HCONTACT hContact;
ModuleTreeInfoStruct *lParam;
ModSetLinkLinkItem *module;
char percent[96], title[64];
@@ -184,7 +183,7 @@ void doItems(HWND hwnd2Tree,ModuleSettingLL *modlist, int count) SetWindowText(hwnd, TranslateT("Database Editor++"));
}
-int findItemInTree(HWND hwnd2Tree, HANDLE hContact, char* module)
+int findItemInTree(HWND hwnd2Tree, HCONTACT 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 */
{
@@ -219,7 +218,7 @@ int findItemInTree(HWND hwnd2Tree, HANDLE hContact, char* module) return -1;
}
-void freeTree(HWND hwnd2Tree, HANDLE hContact)
+void freeTree(HWND hwnd2Tree, HCONTACT 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 */
{
@@ -257,7 +256,7 @@ void freeTree(HWND hwnd2Tree, HANDLE hContact) while (item.hItem);
}
-BOOL findAndRemoveDuplicates(HWND hwnd2Tree, HANDLE hContact, char* module)
+BOOL findAndRemoveDuplicates(HWND hwnd2Tree, HCONTACT 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 */
{
@@ -307,7 +306,7 @@ BOOL findAndRemoveDuplicates(HWND hwnd2Tree, HANDLE hContact, char* module) }
-void replaceTreeItem(HWND hwnd, HANDLE hContact, const char *module, const char *newModule)
+void replaceTreeItem(HWND hwnd, HCONTACT hContact, const char *module, const char *newModule)
{
int hItem = findItemInTree(hwnd, hContact, (char*)module);
HTREEITEM hParent;
@@ -361,8 +360,8 @@ void __cdecl PopulateModuleTreeThreadFunc(LPVOID di) HWND hwnd2Tree = GetDlgItem(hwnd2mainWindow,IDC_MODULES);
char SelectedModule[256] = {0};
char SelectedSetting[256] = {0};
- HANDLE hSelectedContact = hRestore;
- HANDLE hContact;
+ HCONTACT hSelectedContact = hRestore;
+ HCONTACT hContact;
HTREEITEM contact, contactsRoot;
int count;
@@ -403,7 +402,7 @@ void __cdecl PopulateModuleTreeThreadFunc(LPVOID di) }
case 2: // restore saved
if (GetValue(NULL,modname,"LastModule",SelectedModule,SIZEOF(SelectedModule))) {
- hSelectedContact = (HANDLE)db_get_dw(NULL,modname,"LastContact",(DWORD)INVALID_HANDLE_VALUE);
+ hSelectedContact = (HCONTACT)db_get_dw(NULL, modname, "LastContact", (DWORD)INVALID_HANDLE_VALUE);
if (hSelectedContact != INVALID_HANDLE_VALUE)
Select = 1;
GetValue(NULL,modname,"LastSetting",SelectedSetting,SIZEOF(SelectedSetting));
@@ -558,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;
- HANDLE hContact = mtis->hContact;
+ HCONTACT hContact = mtis->hContact;
mtis->type = CONTACT;
@@ -599,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];
- HANDLE hContact;
+ HCONTACT hContact;
HWND hwnd2Settings = GetDlgItem(hwnd, IDC_SETTINGS);
tvi.mask = TVIF_HANDLE|TVIF_PARAM|TVIF_TEXT;
tvi.hItem = pnmtv->itemNew.hItem;
@@ -768,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;
- HANDLE hContact = mtis->hContact;
+ HCONTACT hContact = mtis->hContact;
GetCursorPos(&(hti.pt));
hMenu = LoadMenu(hInst, MAKEINTRESOURCE(IDR_CONTEXTMENU));
TranslateMenu(hMenu);
@@ -830,7 +829,7 @@ void moduleListRightClick(HWND hwnd, WPARAM wParam,LPARAM lParam) // hwnd here i break;
case MENU_EXPORTDB:
- exportDB(INVALID_HANDLE_VALUE, module);
+ exportDB((HCONTACT)INVALID_HANDLE_VALUE, module);
break;
}
}
@@ -908,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(INVALID_HANDLE_VALUE, "");
+ exportDB((HCONTACT)INVALID_HANDLE_VALUE, "");
break;
case MENU_IMPORTFROMTEXT:
ImportSettingsMenuItem(NULL);
diff --git a/plugins/DbEditorPP/src/settinglist.cpp b/plugins/DbEditorPP/src/settinglist.cpp index fee9442032..d98f8a0144 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, HANDLE hContact, char *module, char *setting)
+void DeleteSettingsFromList(HWND hSettings, HCONTACT hContact, char *module, char *setting)
{
int count = ListView_GetSelectedCount(hSettings);
@@ -93,7 +93,7 @@ void DeleteSettingsFromList(HWND hSettings, HANDLE hContact, char *module, char }
}
-void additem(HWND hwnd2Settings,HANDLE hContact, char* module, char* setting, int index)
+void additem(HWND hwnd2Settings,HCONTACT hContact, char* module, char* setting, int index)
{
char *data = NULL;
LVITEM lvi;
@@ -213,7 +213,7 @@ void additem(HWND hwnd2Settings,HANDLE hContact, char* module, char* setting, in mir_free(data);
}
-void PopulateSettings(HWND hwnd2Settings, HANDLE hContact, char* module)
+void PopulateSettings(HWND hwnd2Settings, HCONTACT hContact, char* module)
{
SettingListInfo* info = (SettingListInfo*)mir_calloc(sizeof(SettingListInfo));
LVITEM lvItem;
@@ -270,7 +270,7 @@ void SelectSetting(char *setting) }
}
-void settingChanged(HWND hwnd2Settings, HANDLE hContact, char* module, char* setting)
+void settingChanged(HWND hwnd2Settings, HCONTACT hContact, char* module, char* setting)
{
LVITEM lvItem;
LVFINDINFO lvfi;
@@ -296,7 +296,7 @@ static WNDPROC SettingLabelEditSubClass; struct EditLabelInfoStruct
{
- HANDLE hContact;
+ HCONTACT 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;
- HANDLE hContact;
+ HCONTACT hContact;
LVHITTESTINFO hti;
POINT pt;
HMENU hMenu, hSubMenu;
diff --git a/plugins/DbEditorPP/src/watchedvars.cpp b/plugins/DbEditorPP/src/watchedvars.cpp index 40d5404229..f4dc64f79e 100644 --- a/plugins/DbEditorPP/src/watchedvars.cpp +++ b/plugins/DbEditorPP/src/watchedvars.cpp @@ -1,6 +1,6 @@ #include "headers.h"
-int addSettingToWatchList(HANDLE hContact, char* module, char* setting)
+int addSettingToWatchList(HCONTACT 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);
- HANDLE hContact = lParam->hContact;
+ HCONTACT 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 = (HANDLE)lvi.lParam;
+ ii.hContact = (HCONTACT)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(HANDLE hContact,const char* module,const char* setting)
+void popupWatchedVar(HCONTACT hContact,const char* module,const char* setting)
{
HICON hIcon = LoadIcon(hInst, MAKEINTRESOURCE(ICO_REGEDIT));
char lpzContactName[MAX_CONTACTNAME];
@@ -329,7 +329,7 @@ void popupWatchedVar(HANDLE hContact,const char* module,const char* setting) db_free(&dbv);
POPUPDATA ppd = { 0 };
- ppd.lchContact = (HANDLE)hContact;
+ ppd.lchContact = (HCONTACT)hContact;
ppd.lchIcon = hIcon;
lstrcpyn(ppd.lpzContactName, lpzContactName,MAX_CONTACTNAME);
lstrcpyn(ppd.lpzText, lpzText,MAX_SECONDLINE);
|