summaryrefslogtreecommitdiff
path: root/ui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ui.cpp')
-rw-r--r--ui.cpp26
1 files changed, 19 insertions, 7 deletions
diff --git a/ui.cpp b/ui.cpp
index 8ea8424..bca98ef 100644
--- a/ui.cpp
+++ b/ui.cpp
@@ -16,14 +16,26 @@
#include "commonheaders.h"
+extern list <JabberAccount*> Accounts;
+
int CreateButtons()
{
- BBButton button = {0};
- button.cbSize = sizeof(button);
- button.pszModuleName = szModuleName;
- button.pszTooltip = "Test button";
- button.bbbFlags = BBBF_ISPUSHBUTTON |BBBF_ISIMBUTTON;
- button.dwDefPos = 100;
- CallService(MS_BB_ADDBUTTON, 0, (WPARAM)&button);
+ if(ServiceExists(MS_BB_ADDBUTTON))
+ {
+ BBButton button = {0};
+ button.cbSize = sizeof(button);
+ button.pszModuleName = szModuleName;
+ 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.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);
+ }
+ }
return 0;
} \ No newline at end of file