summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGluzskiy Alexandr <sss123next@list.ru>2010-07-18 18:05:52 +0300
committerGluzskiy Alexandr <sss123next@list.ru>2010-07-18 18:05:52 +0300
commit5017949ed6a24c623c895b02673d2ff5272fc7bf (patch)
tree883ddf8095bec612ae566aa72cf591511d96dced
parent8ef72578611917675179230aec4a6956463ef39a (diff)
modified: globals.h
modified: init.cpp modified: ui.cpp
-rw-r--r--globals.h1
-rw-r--r--init.cpp4
-rw-r--r--ui.cpp14
3 files changed, 15 insertions, 4 deletions
diff --git a/globals.h b/globals.h
index fc724e2..869f740 100644
--- a/globals.h
+++ b/globals.h
@@ -16,4 +16,5 @@
#ifndef GLOBALS_H
#define GLOBALS_H
+#define TEST_BUTTONID 0x00000013
#endif
diff --git a/init.cpp b/init.cpp
index 4016b8a..1cfdc3c 100644
--- a/init.cpp
+++ b/init.cpp
@@ -18,7 +18,7 @@
HINSTANCE hInst;
-static HANDLE hAccountsChanges, hDbContactAdded;
+static HANDLE hAccountsChanges, hDbContactAdded, hTabsrmmButtonPressed;
PLUGINLINK *pluginLink;
static int OnModulesLoaded(WPARAM wParam,LPARAM lParam);
extern char *date();
@@ -92,6 +92,7 @@ extern int JuickOptInit(WPARAM wParam,LPARAM lParam);
extern int GetJabberInterface(WPARAM, LPARAM);
extern int HandleDbNewContact(WPARAM w, LPARAM l);
extern int HandleDbContactDeleted(WPARAM w, LPARAM l);
+extern int HandleTabsrmmButtonPressed(WPARAM l, LPARAM w);
extern void FindJuickAccounts();
extern int CreateButtons();
static int OnModulesLoaded(WPARAM wParam,LPARAM lParam)
@@ -101,6 +102,7 @@ static int OnModulesLoaded(WPARAM wParam,LPARAM lParam)
hAccountsChanges = HookEvent(ME_PROTO_ACCLISTCHANGED, GetJabberInterface);
hDbContactAdded = HookEvent(ME_DB_CONTACT_ADDED, HandleDbNewContact);
hDbContactAdded = HookEvent(ME_DB_CONTACT_DELETED, HandleDbContactDeleted);
+ hTabsrmmButtonPressed = HookEvent(ME_MSG_BUTTONPRESSED, HandleTabsrmmButtonPressed);
FindJuickAccounts();
CreateButtons();
return 0;
diff --git a/ui.cpp b/ui.cpp
index bca98ef..59fdab7 100644
--- a/ui.cpp
+++ b/ui.cpp
@@ -28,14 +28,22 @@ int CreateButtons()
button.ptszTooltip = _T("Test button");
button.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISLSIDEBUTTON | BBBF_ISCHATBUTTON | BBBF_HIDDEN;
button.dwDefPos = 500;
- button.dwButtonID = 0x000001;
- CallService(MS_BB_ADDBUTTON, 0, (WPARAM)&button);
+ button.dwButtonID = TEST_BUTTONID;
+ CallService(MS_BB_ADDBUTTON, 0, (LPARAM)&button);
button.bbbFlags -= BBBF_HIDDEN;
for(list <JabberAccount*>::iterator p = Accounts.begin(); p != Accounts.end(); p++)
{
if((*p)->getJuickContact() != INVALID_HANDLE_VALUE)
- CallService(MS_BB_SETBUTTONSTATE, LPARAM((*p)->getJuickContact()), (WPARAM)&button);
+ CallService(MS_BB_SETBUTTONSTATE, (WPARAM)(*p)->getJuickContact(), (LPARAM)&button); //add button for each juick contact in every jabber account
}
}
return 0;
+}
+
+int HandleTabsrmmButtonPressed(WPARAM w, LPARAM l)
+{
+ CustomButtonClickData *data = (CustomButtonClickData*)l;
+ if(data->dwButtonId != TEST_BUTTONID)
+ return 0;
+ return 0;
} \ No newline at end of file