From 8ef72578611917675179230aec4a6956463ef39a Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Sun, 18 Jul 2010 15:33:29 +0300 Subject: started ui implementation, some rework --- ui.cpp | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) (limited to 'ui.cpp') 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 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 ::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 -- cgit v1.2.3