diff options
-rw-r--r-- | globals.h | 1 | ||||
-rw-r--r-- | init.cpp | 4 | ||||
-rw-r--r-- | ui.cpp | 14 |
3 files changed, 15 insertions, 4 deletions
@@ -16,4 +16,5 @@ #ifndef GLOBALS_H #define GLOBALS_H +#define TEST_BUTTONID 0x00000013 #endif @@ -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; @@ -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 |