diff options
author | Tobias Weimer <wishmaster51@googlemail.com> | 2012-07-31 18:12:58 +0000 |
---|---|---|
committer | Tobias Weimer <wishmaster51@googlemail.com> | 2012-07-31 18:12:58 +0000 |
commit | eadd77936fd5405d23ab71722183e6f3f2de8208 (patch) | |
tree | fda0e2beb3eb92d6503a4fb6b87c179bcc79b7b8 /plugins/AddContactPlus/src/main.cpp | |
parent | bb6e97f6ccc6676d6cdb8e60a46856c84a169a44 (diff) |
AddContactPlus: Open only one window at a time
git-svn-id: http://svn.miranda-ng.org/main/trunk@1287 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/AddContactPlus/src/main.cpp')
-rw-r--r-- | plugins/AddContactPlus/src/main.cpp | 24 |
1 files changed, 16 insertions, 8 deletions
diff --git a/plugins/AddContactPlus/src/main.cpp b/plugins/AddContactPlus/src/main.cpp index c81962fb5e..d4bc5304ad 100644 --- a/plugins/AddContactPlus/src/main.cpp +++ b/plugins/AddContactPlus/src/main.cpp @@ -25,6 +25,7 @@ int hLangpack; static HANDLE hModulesLoaded = 0, hChangedIcons = 0, hAccListChanged = 0,
hMainMenuItem = 0, hToolBarItem = 0, hService = 0;
HANDLE hIconLibItem;
+HWND hAddDlg;
PLUGININFOEX pluginInfo = {
sizeof(PLUGININFOEX),
@@ -55,7 +56,15 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = {MIID_ADDCONT INT_PTR AddContactPlusDialog(WPARAM, LPARAM)
{
- CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_ADDCONTACT), (HWND)NULL, AddContactDlgProc, 0);
+ if(hAddDlg)
+ {
+ SetForegroundWindow(hAddDlg);
+ SetFocus(hAddDlg);
+ }
+ else
+ {
+ hAddDlg = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_ADDCONTACT), NULL, AddContactDlgProc, 0);
+ }
return 0;
}
@@ -78,13 +87,12 @@ static int OnAccListChanged(WPARAM, LPARAM) {
PROTOACCOUNT** pAccounts;
int iRealAccCount, iAccCount = 0;
- DWORD dwCaps;
ProtoEnumAccounts(&iRealAccCount, &pAccounts);
for (int i = 0; i < iRealAccCount; i++)
{
if (!IsAccountEnabled(pAccounts[i])) continue;
- dwCaps = (DWORD)CallProtoService(pAccounts[i]->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0);
+ DWORD dwCaps = (DWORD)CallProtoService(pAccounts[i]->szModuleName, PS_GETCAPS, PFLAGNUM_1, 0);
if (dwCaps & PF1_BASICSEARCH || dwCaps & PF1_EXTSEARCH || dwCaps & PF1_SEARCHBYEMAIL || dwCaps & PF1_SEARCHBYNAME)
iAccCount++;
}
@@ -133,12 +141,12 @@ static int CreateButton(WPARAM, LPARAM) static int OnModulesLoaded(WPARAM, LPARAM)
{
SKINICONDESC sid = {0};
- char szFile[MAX_PATH];
- GetModuleFileNameA(hInst, szFile, MAX_PATH);
+ TCHAR szFile[MAX_PATH];
+ GetModuleFileName(hInst, szFile, MAX_PATH);
sid.cbSize = sizeof(SKINICONDESC);
- sid.flags = SIDF_TCHAR;
- sid.pszDefaultFile = szFile;
- sid.ptszSection = _T("AddContact+");
+ sid.flags = SIDF_ALL_TCHAR;
+ sid.ptszDefaultFile = szFile;
+ sid.ptszSection = LPGENT("AddContact+");
sid.iDefaultIndex = -IDI_ADDCONTACT;
sid.ptszDescription = LPGENT("Add Contact");
sid.pszName = ICON_ADD;
|