diff options
author | George Hazan <george.hazan@gmail.com> | 2012-11-04 18:51:53 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2012-11-04 18:51:53 +0000 |
commit | ecb177cadbcff850a16c4b9e306beb15f61ac6f9 (patch) | |
tree | da36e3107747a5f37dbd078197d584054057609f /plugins/Clist_mw | |
parent | 808f3b5e0fefeb560ce5393bf8311927d0927411 (diff) |
kernel extraicons, part II
git-svn-id: http://svn.miranda-ng.org/main/trunk@2188 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Clist_mw')
-rw-r--r-- | plugins/Clist_mw/res/resource.rc | 16 | ||||
-rw-r--r-- | plugins/Clist_mw/src/CLUIFrames/extraimage.cpp | 374 | ||||
-rw-r--r-- | plugins/Clist_mw/src/clc.cpp | 3 | ||||
-rw-r--r-- | plugins/Clist_mw/src/clui.cpp | 109 | ||||
-rw-r--r-- | plugins/Clist_mw/src/cluiopts.cpp | 644 | ||||
-rw-r--r-- | plugins/Clist_mw/src/resource.h | 7 |
6 files changed, 318 insertions, 835 deletions
diff --git a/plugins/Clist_mw/res/resource.rc b/plugins/Clist_mw/res/resource.rc index 8b160f597c..4c2646ad27 100644 --- a/plugins/Clist_mw/res/resource.rc +++ b/plugins/Clist_mw/res/resource.rc @@ -317,22 +317,6 @@ BEGIN EDITTEXT IDC_TITLETEXT,63,104,72,12,ES_AUTOHSCROLL
CONTROL "Enable drop shadow (restart required)",IDC_DROPSHADOW,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,194,138,10
- GROUPBOX "Contact List Extra Icons",IDC_EXTRA_FRAME,200,130,110,
- 91
- CONTROL "Protocol Type",IDC_EXTRA_PROTO,"Button",BS_AUTOCHECKBOX |
- WS_TABSTOP,210,143,70,10
- CONTROL "E-mail",IDC_EXTRA_EMAIL,"Button",BS_AUTOCHECKBOX |
- WS_TABSTOP,210,166,75,10
- CONTROL "Cellular",IDC_EXTRA_CELLULAR,"Button",BS_AUTOCHECKBOX |
- WS_TABSTOP,210,178,92,10
- CONTROL "Advanced #2",IDC_EXTRA_ADV2,"Button",BS_AUTOCHECKBOX |
- WS_TABSTOP,210,191,92,10
- CONTROL "Advanced #1",IDC_EXTRA_ADV1,"Button",BS_AUTOCHECKBOX |
- WS_TABSTOP,210,204,92,10
- LTEXT "!!! Note: all client icons are made by Angeli-ka, and I have her permission to use them in clist_mw plugin.",
- IDC_STATIC,5,210,190,20
- CONTROL "Homepage",IDC_EXTRA_WEB,"Button",BS_AUTOCHECKBOX |
- WS_TABSTOP,210,154,75,10
END
IDD_OPT_CLC DIALOGEX 0, 0, 314, 251
diff --git a/plugins/Clist_mw/src/CLUIFrames/extraimage.cpp b/plugins/Clist_mw/src/CLUIFrames/extraimage.cpp index 70f4560856..c435e744f9 100644 --- a/plugins/Clist_mw/src/CLUIFrames/extraimage.cpp +++ b/plugins/Clist_mw/src/CLUIFrames/extraimage.cpp @@ -2,11 +2,6 @@ extern int DefaultImageListColorDepth;
-int EnabledColumnCount = 0;
-boolean visar[EXTRACOLUMNCOUNT];
-#define ExtraImageIconsIndexCount 3
-int ExtraImageIconsIndex[ExtraImageIconsIndexCount];
-
static HANDLE hExtraImageListRebuilding,hExtraImageApplying;
HANDLE hExtraImageClick;
@@ -16,374 +11,15 @@ extern HIMAGELIST hCListImages; extern int ClcIconsChanged(WPARAM,LPARAM);
-void SetAllExtraIcons(HWND hwndList,HANDLE hContact);
-void LoadExtraImageFunc();
-HICON LoadIconFromExternalFile(char*, int, boolean, boolean, char*, char*, char*, int, HICON = NULL);
-boolean ImageCreated = FALSE;
-void ReloadExtraIcons();
-BYTE ExtraOrder[] =
-{
- 0, // EXTRA_ICON_EMAIL
- 1, // EXTRA_ICON_PROTO
- 2, // EXTRA_ICON_SMS
- 3, // EXTRA_ICON_ADV1
- 4, // EXTRA_ICON_ADV2
- 5, // EXTRA_ICON_WEB
- 6, // EXTRA_ICON_CLIENT
- 7, // EXTRA_ICON_ADV3
- 8, // EXTRA_ICON_ADV4
-};
-
-BOOL HasExtraIconsService()
-{
- return ServiceExists("ExtraIcon/Register");
-}
-
-boolean isColumnVisible(int extra)
+void SetAllExtraIcons(HWND hwndList,HANDLE hContact)
{
- int i = 0;
-
- if (HasExtraIconsService())
- return TRUE;
-
- for (i = 0; i<sizeof(ExtraOrder)/sizeof(ExtraOrder[0]); i++)
- if (ExtraOrder[i] == extra)
- {
- switch(i+1)
- {
- case EXTRA_ICON_EMAIL: return(DBGetContactSettingByte(NULL,CLUIFrameModule,"EXTRA_ICON_EMAIL",1));
- case EXTRA_ICON_PROTO: return(DBGetContactSettingByte(NULL,CLUIFrameModule,"EXTRA_ICON_PROTO",1));
- case EXTRA_ICON_SMS: return(DBGetContactSettingByte(NULL,CLUIFrameModule,"EXTRA_ICON_SMS",1));
- case EXTRA_ICON_ADV1: return(DBGetContactSettingByte(NULL,CLUIFrameModule,"EXTRA_ICON_ADV1",1));
- case EXTRA_ICON_ADV2: return(DBGetContactSettingByte(NULL,CLUIFrameModule,"EXTRA_ICON_ADV2",1));
- case EXTRA_ICON_WEB: return(DBGetContactSettingByte(NULL,CLUIFrameModule,"EXTRA_ICON_WEB",1));
- case EXTRA_ICON_CLIENT: return(DBGetContactSettingByte(NULL,CLUIFrameModule,"EXTRA_ICON_CLIENT",1));
- case EXTRA_ICON_ADV3: return(DBGetContactSettingByte(NULL,CLUIFrameModule,"EXTRA_ICON_ADV3",0));
- case EXTRA_ICON_ADV4: return(DBGetContactSettingByte(NULL,CLUIFrameModule,"EXTRA_ICON_ADV4",0));
- }
- break;
- }
- return(FALSE);
+ /// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
}
-void GetVisColumns()
-{
- visar[0] = isColumnVisible(0);
- visar[1] = isColumnVisible(1);
- visar[2] = isColumnVisible(2);
- visar[3] = isColumnVisible(3);
- visar[4] = isColumnVisible(4);
- visar[5] = isColumnVisible(5);
- visar[6] = isColumnVisible(6);
- visar[7] = isColumnVisible(7);
- visar[8] = isColumnVisible(8);
-};
-
-__inline int bti(boolean b)
-{
- return(b?1:0);
-};
-int colsum(int from,int to)
-{
- int i,sum;
- if (from<0||from>=EXTRACOLUMNCOUNT){return(-1);};
- if (to<0||to>=EXTRACOLUMNCOUNT){return(-1);};
- if (to<from){return(-1);};
-
- sum = 0;
- for (i = from;i<=to;i++)
- {
- sum += bti(visar[i]);
- };
- return(sum);
-};
-
-int ExtraToColumnNum(int extra)
-{
- if (HasExtraIconsService())
- {
- if (extra < 1 || extra > EXTRACOLUMNCOUNT)
- return -1;
- else
- return extra-1;
- }
- else
- {
- int cnt = EnabledColumnCount;
- int extracnt = EXTRACOLUMNCOUNT-1;
- int ord = ExtraOrder[extra-1];
- if (!visar[ord]) return -1;
- return (colsum(0,ord)-1);
- }
-};
+boolean ImageCreated = FALSE;
+void ReloadExtraIcons();
int ColumnNumToExtra(int column)
{
- int i;
-
- if (HasExtraIconsService())
- return column+1;
-
- for (i = 0; i<sizeof(ExtraOrder)/sizeof(ExtraOrder[0]); i++)
- if (ExtraOrder[i] == column)
- return i+1;
-
- return -1;
-}
-
-INT_PTR SetIconForExtraColumn(WPARAM wParam,LPARAM lParam)
-{
- pIconExtraColumn piec;
- int icol;
- HANDLE hItem;
-
- if (pcli->hwndContactTree == 0){return(-1);};
- if (wParam == 0||lParam == 0){return(-1);};
- piec = (pIconExtraColumn)lParam;
-
- if (piec->cbSize != sizeof(IconExtraColumn)){return(-1);};
- icol = ExtraToColumnNum(piec->ColumnType);
- if (icol == -1){return(-1);};
- hItem = (HANDLE)SendMessage(pcli->hwndContactTree,CLM_FINDCONTACT,(WPARAM)wParam,0);
- if (hItem == 0){return(-1);};
-
- SendMessage(pcli->hwndContactTree,CLM_SETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(icol,piec->hImage));
- return 0;
-};
-
-//wparam = hIcon
-//return hImage on success,-1 on failure
-INT_PTR AddIconToExtraImageList(WPARAM wParam,LPARAM lParam)
-{
- if (hExtraImageList == 0||wParam == 0){return(-1);};
- return((int)ImageList_AddIcon(hExtraImageList,(HICON)wParam));
-}
-
-int OnIconLibIconChanged(WPARAM wParam,LPARAM lParam)
-{
- HICON hicon;
- hicon = LoadIconFromExternalFile("clisticons.dll",0,TRUE,FALSE,"Email","Contact List","Email Icon",-IDI_EMAIL);
- ExtraImageIconsIndex[0] = ImageList_ReplaceIcon(hExtraImageList,ExtraImageIconsIndex[0],hicon );
-
- hicon = LoadIconFromExternalFile("clisticons.dll",1,TRUE,FALSE,"Sms","Contact List","Sms Icon",-IDI_SMS);
- ExtraImageIconsIndex[1] = ImageList_ReplaceIcon(hExtraImageList,ExtraImageIconsIndex[1],hicon );
-
- hicon = LoadIconFromExternalFile("clisticons.dll",4,TRUE,FALSE,"Web","Contact List","Web Icon",-IDI_GLOBUS);
- ExtraImageIconsIndex[2] = ImageList_ReplaceIcon(hExtraImageList,ExtraImageIconsIndex[2],hicon );
-
- pcli->pfnClcBroadcast( INTM_INVALIDATE,0,0);
- return 0;
-}
-
-void ReloadExtraIcons()
-{
- int count,i;
- PROTOACCOUNT **accs;
- HICON hicon;
-
- SendMessage(pcli->hwndContactTree,CLM_SETEXTRACOLUMNSSPACE,DBGetContactSettingByte(NULL,"CLUI","ExtraColumnSpace",18),0);
- SendMessage(pcli->hwndContactTree,CLM_SETEXTRAIMAGELIST,0,0);
- if (hExtraImageList){ImageList_Destroy(hExtraImageList);};
- hExtraImageList = ImageList_Create(GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),ILC_COLOR32|ILC_MASK,1,256);
-
- if (!HasExtraIconsService())
- {
- //loading icons
- hicon = LoadIconFromExternalFile("clisticons.dll",0,TRUE,TRUE,"Email","Contact List","Email Icon",-IDI_EMAIL);
- if (!hicon) hicon = LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_EMAIL));
- ExtraImageIconsIndex[0] = ImageList_AddIcon(hExtraImageList,hicon );
-
-
- hicon = LoadIconFromExternalFile("clisticons.dll",1,TRUE,TRUE,"Sms","Contact List","Sms Icon",-IDI_SMS);
- if (!hicon) hicon = LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_SMS));
- ExtraImageIconsIndex[1] = ImageList_AddIcon(hExtraImageList,hicon );
-
- hicon = LoadIconFromExternalFile("clisticons.dll",4,TRUE,TRUE,"Web","Contact List","Web Icon",-IDI_GLOBUS);
- if (!hicon) hicon = LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_GLOBUS));
- ExtraImageIconsIndex[2] = ImageList_AddIcon(hExtraImageList,hicon );
-
- //calc only needed protocols
- ProtoEnumAccounts( &count, &accs );
- for ( i = 0; i < count; i++ )
- if ( IsAccountEnabled( accs[i] ) && CallProtoService( accs[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0 ))
- ImageList_AddIcon( hExtraImageList, LoadSkinnedProtoIcon( accs[i]->szModuleName, ID_STATUS_ONLINE ));
- }
-
- SendMessage(pcli->hwndContactTree,CLM_SETEXTRAIMAGELIST,0,(LPARAM)hExtraImageList);
- SendMessage(pcli->hwndContactTree,CLM_SETEXTRACOLUMNS,EnabledColumnCount,0);
- NotifyEventHooks(hExtraImageListRebuilding,0,0);
- ImageCreated = TRUE;
-}
-
-void ClearExtraIcons();
-
-void ReAssignExtraIcons()
-{
- ClearExtraIcons();
- SendMessage(pcli->hwndContactTree,CLM_SETEXTRACOLUMNS, EXTRACOLUMNCOUNT, 0);
- SetAllExtraIcons(pcli->hwndContactTree,0);
- SendMessage(pcli->hwndContactTree,CLM_AUTOREBUILD,0,0);
-}
-
-void ClearExtraIcons()
-{
- int i;
- HANDLE hContact,hItem;
-
- SendMessage(pcli->hwndContactTree,CLM_SETEXTRACOLUMNS, EXTRACOLUMNCOUNT, 0);
-
- hContact = db_find_first();
- do {
-
- hItem = (HANDLE)SendMessage(pcli->hwndContactTree,CLM_FINDCONTACT,(WPARAM)hContact,0);
- if (hItem == 0){continue;};
- for (i = 0;i<EnabledColumnCount;i++)
- {
- SendMessage(pcli->hwndContactTree,CLM_SETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(i,0xFF));
- };
-
- } while(hContact = db_find_next(hContact));
-};
-
-void SetAllExtraIcons(HWND hwndList,HANDLE hContact)
-{
- HANDLE hItem;
- boolean hcontgiven = FALSE;
- char *szProto;
- char *ImgIndex[64];
- int maxpr,count,i;
- PROTOACCOUNT **accs;
- pClcCacheEntry pdnce;
- int em,pr,sms,a1,a2,w1,c1;
- int tick = 0;
- BOOL hasExtraIconsService;
- hcontgiven = (hContact != 0);
-
- if (pcli->hwndContactTree == 0){return;};
- tick = GetTickCount();
- if (ImageCreated == FALSE) ReloadExtraIcons();
-
- SendMessage(pcli->hwndContactTree,CLM_SETEXTRACOLUMNS, EXTRACOLUMNCOUNT, 0);
-
- hasExtraIconsService = HasExtraIconsService();
- if (!hasExtraIconsService) {
- em = ExtraToColumnNum(EXTRA_ICON_EMAIL);
- pr = ExtraToColumnNum(EXTRA_ICON_PROTO);
- sms = ExtraToColumnNum(EXTRA_ICON_SMS);
- a1 = ExtraToColumnNum(EXTRA_ICON_ADV1);
- a2 = ExtraToColumnNum(EXTRA_ICON_ADV2);
- w1 = ExtraToColumnNum(EXTRA_ICON_WEB);
- c1 = ExtraToColumnNum(EXTRA_ICON_CLIENT);
-
- memset(ImgIndex,0,sizeof(ImgIndex));
- ProtoEnumAccounts( &count, &accs );
-
- maxpr = 0;
- //calc only needed protocols
- for ( i = 0; i < count; i++ ) {
- if ( !IsAccountEnabled( accs[i] ) || CallProtoService( accs[i]->szModuleName, PS_GETCAPS, PFLAGNUM_2, 0 ) == 0 )
- continue;
- ImgIndex[maxpr] = accs[i]->szModuleName;
- maxpr++;
- }
- }
-
- if ( hContact == NULL )
- hContact = db_find_first();
-
- do {
- szProto = NULL;
- hItem = hContact;
- if (hItem == 0){continue;};
- pdnce = (pClcCacheEntry)pcli->pfnGetCacheEntry(hItem);
- if (pdnce == NULL) {continue;};
-
- // szProto = (char*)CallService(MS_PROTO_GETCONTACTBASEPROTO,(WPARAM)hContact,0);
- szProto = pdnce->szProto;
-
- if (!hasExtraIconsService)
- {
- if (ExtraToColumnNum(EXTRA_ICON_WEB) != -1)
- {
- boolean showweb = FALSE;
-
- if (szProto != NULL)
- {
- char *homepage;
- homepage = DBGetStringA(pdnce->hContact,"UserInfo", "Homepage");
- if (!homepage)
- homepage = DBGetStringA(pdnce->hContact,pdnce->szProto, "Homepage");
- if (homepage != NULL)
- {
- showweb = TRUE;
- mir_free(homepage);
- }
- }
-
- SendMessage(hwndList,CLM_SETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(ExtraToColumnNum(EXTRA_ICON_WEB),(showweb)?2:0xFF));
- }
-
- if (ExtraToColumnNum(EXTRA_ICON_EMAIL) != -1)
- {
- DBVARIANT dbv = {0};
- boolean showemail = TRUE;
-
- if (szProto == NULL || DBGetContactSettingString(hContact, szProto, "e-mail",&dbv))
- {
- DBFreeVariant(&dbv);
- if (DBGetContactSettingString(hContact, "UserInfo", "Mye-mail0", &dbv))
- showemail = FALSE;
- }
- DBFreeVariant(&dbv);
-
- SendMessage(hwndList,CLM_SETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(ExtraToColumnNum(EXTRA_ICON_EMAIL),(showemail)?0:0xFF));
- }
-
- if (ExtraToColumnNum(EXTRA_ICON_SMS) != -1)
- {
- DBVARIANT dbv = {0};
- boolean showsms = TRUE;
-
- if (szProto == NULL || DBGetContactSettingString(hContact, szProto, "Cellular",&dbv)) {
- DBFreeVariant(&dbv);
- if (DBGetContactSettingString(hContact, "UserInfo", "MyPhone0", &dbv))
- showsms = FALSE;
- }
- SendMessage(hwndList,CLM_SETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(ExtraToColumnNum(EXTRA_ICON_SMS),(showsms)?1:0xFF));
- DBFreeVariant(&dbv);
- }
-
- if (ExtraToColumnNum(EXTRA_ICON_PROTO) != -1)
- {
- for (i = 0;i<maxpr;i++)
- {
- if (!MyStrCmp(ImgIndex[i],szProto))
- {
- SendMessage(hwndList,CLM_SETEXTRAIMAGE,(WPARAM)hItem,MAKELPARAM(ExtraToColumnNum(EXTRA_ICON_PROTO),i+3));
- break;
- }
- }
- }
- }
-
- NotifyEventHooks(hExtraImageApplying,(WPARAM)hContact,0);
- if (hcontgiven) break;
- Sleep(0);
- }
- while(hContact = db_find_next(hContact));
-
- tick = GetTickCount()-tick;
- InvalidateRect(hwndList,NULL,FALSE);
- Sleep(0);
-}
-
-void LoadExtraImageFunc()
-{
- CreateServiceFunction(MS_CLIST_EXTRA_SET_ICON,SetIconForExtraColumn);
- CreateServiceFunction(MS_CLIST_EXTRA_ADD_ICON,AddIconToExtraImageList);
-
- hExtraImageListRebuilding = CreateHookableEvent(ME_CLIST_EXTRA_LIST_REBUILD);
- hExtraImageApplying = CreateHookableEvent(ME_CLIST_EXTRA_IMAGE_APPLY);
- hExtraImageClick = CreateHookableEvent(ME_CLIST_EXTRA_CLICK);
- HookEvent(ME_SKIN2_ICONSCHANGED,OnIconLibIconChanged);
+ return column+1;
}
diff --git a/plugins/Clist_mw/src/clc.cpp b/plugins/Clist_mw/src/clc.cpp index 8852594d7e..b9ee5105a1 100644 --- a/plugins/Clist_mw/src/clc.cpp +++ b/plugins/Clist_mw/src/clc.cpp @@ -35,9 +35,7 @@ int OnFrameTitleBarBackgroundChange(WPARAM wParam,LPARAM lParam); void InitDisplayNameCache(SortedList *list);
void FreeDisplayNameCache(SortedList *list);
-void LoadExtraImageFunc( void );
-void LoadExtraImageFunc( void );
void UnloadCLUIModule( void );
extern int sortByStatus;
@@ -282,7 +280,6 @@ LBL_Exit: int LoadCLCModule(void)
{
LoadCLUIFramesModule();
- LoadExtraImageFunc();
himlCListClc = (HIMAGELIST)CallService(MS_CLIST_GETICONSIMAGELIST,0,0);
diff --git a/plugins/Clist_mw/src/clui.cpp b/plugins/Clist_mw/src/clui.cpp index 89a1d9dfd5..0f80d347a4 100644 --- a/plugins/Clist_mw/src/clui.cpp +++ b/plugins/Clist_mw/src/clui.cpp @@ -36,8 +36,6 @@ UINT hMsgGetProfile = 0; extern boolean canloadstatusbar;
boolean OnModulesLoadedCalled = FALSE;
-HANDLE hSettingChangedHook = 0;
-
static int transparentFocus = 1;
static byte oldhideoffline;
static int lastreqh = 0,requr = 0,disableautoupd = 1;
@@ -68,12 +66,9 @@ void CluiProtocolStatusChanged(int parStatus, const char* szProto); extern void SetAllExtraIcons(HWND hwndList,HANDLE hContact);
extern void ReloadExtraIcons();
-extern void LoadExtraImageFunc();
extern HWND CreateStatusBarhWnd(HWND parent);
extern HANDLE CreateStatusBarFrame();
extern int CLUIFramesUpdateFrame(WPARAM wParam,LPARAM lParam);
-extern int ExtraToColumnNum(int extra);
-extern int ColumnNumToExtra(int column);
extern void DrawDataForStatusBar(LPDRAWITEMSTRUCT dis);
extern void InitGroupMenus();
extern int UseOwnerDrawStatusBar;
@@ -371,39 +366,6 @@ int OnSettingChanging(WPARAM wParam,LPARAM lParam) }
}
}
- else {
- if (dbcws == NULL)
- return 0;
-
- if ( !ServiceExists("ExtraIcon/Register")) {
- if (dbcws->value.type == DBVT_ASCIIZ&&!strcmp(dbcws->szSetting,"e-mail")) {
- SetAllExtraIcons(pcli->hwndContactTree,(HANDLE)wParam);
- return 0;
- }
- if (dbcws->value.type == DBVT_ASCIIZ&&!strcmp(dbcws->szSetting,"Cellular")) {
- SetAllExtraIcons(pcli->hwndContactTree,(HANDLE)wParam);
- return 0;
- }
-
- if (dbcws->value.type == DBVT_ASCIIZ&&strstr(dbcws->szModule,"ICQ")) {
- if ( !strcmp(dbcws->szSetting, "MirVer")) {
- SetAllExtraIcons(pcli->hwndContactTree,(HANDLE)wParam);
- return 0;
- }
- }
-
- if (dbcws->value.type == DBVT_ASCIIZ&&!strcmp(dbcws->szModule,"UserInfo")) {
- if ( !strcmp(dbcws->szSetting, "MyPhone0")) {
- SetAllExtraIcons(pcli->hwndContactTree,(HANDLE)wParam);
- return 0;
- }
- if (!strcmp(dbcws->szSetting, "Mye-mail0")) {
- SetAllExtraIcons(pcli->hwndContactTree,(HANDLE)wParam);
- return 0;
- }
- }
- }
- }
return 0;
}
@@ -443,23 +405,17 @@ int CreateCLC(HWND parent) CallService(MS_CLIST_FRAMES_SETFRAMEOPTIONS,MAKEWPARAM(FO_TBTIPNAME,hFrameContactTree),(LPARAM)TranslateT("My Contacts"));
}
- ReloadExtraIcons();
- {
- lastreqh = 0;
- {
- CallService(MS_CLIST_SETHIDEOFFLINE,(WPARAM)oldhideoffline,0);
- }
+ lastreqh = 0;
+ CallService(MS_CLIST_SETHIDEOFFLINE,(WPARAM)oldhideoffline,0);
- { int state = DBGetContactSettingByte(NULL,"CList","State",SETTING_STATE_NORMAL);
- if (state == SETTING_STATE_NORMAL) ShowWindow(pcli->hwndContactList, SW_SHOW);
- else if (state == SETTING_STATE_MINIMIZED) ShowWindow(pcli->hwndContactList, SW_SHOWMINIMIZED);
- }
+ int state = DBGetContactSettingByte(NULL,"CList","State",SETTING_STATE_NORMAL);
+ if (state == SETTING_STATE_NORMAL) ShowWindow(pcli->hwndContactList, SW_SHOW);
+ else if (state == SETTING_STATE_MINIMIZED) ShowWindow(pcli->hwndContactList, SW_SHOWMINIMIZED);
- lastreqh = 0;
- disableautoupd = 0;
+ lastreqh = 0;
+ disableautoupd = 0;
- }
- hSettingChangedHook = HookEvent(ME_DB_CONTACT_SETTINGCHANGED,OnSettingChanging);
+ HookEvent(ME_DB_CONTACT_SETTINGCHANGED,OnSettingChanging);
return 0;
}
@@ -650,7 +606,8 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l case CLN_NEWCONTACT:
{
NMCLISTCONTROL *nm = (NMCLISTCONTROL *)lParam;
- if (nm != NULL) SetAllExtraIcons(pcli->hwndContactTree,nm->hItem );
+ if (nm != NULL)
+ SetAllExtraIcons(pcli->hwndContactTree,nm->hItem );
return TRUE;
}
case CLN_LISTREBUILT:
@@ -700,43 +657,12 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l DWORD hitFlags;
HANDLE hItem = (HANDLE)SendMessage(pcli->hwndContactTree,CLM_HITTEST,(WPARAM)&hitFlags,MAKELPARAM(nm->pt.x,nm->pt.y));
- if (hitFlags&CLCHT_ONITEMEXTRA) {
- if (!IsHContactGroup(hItem)&&!IsHContactInfo(hItem))
- {
- int extra;
- pClcCacheEntry pdnce;
-
- pdnce = (pClcCacheEntry)pcli->pfnGetCacheEntry(nm->hItem);
- if (pdnce == NULL) return 0;
-
- extra = ColumnNumToExtra(nm->iColumn);
- NotifyEventHooks(hExtraImageClick, (WPARAM)nm->hItem, extra);
-
- if (!ServiceExists("ExtraIcon/Register"))
- {
- int v,e,w;
- v = ExtraToColumnNum(EXTRA_ICON_PROTO);
- e = ExtraToColumnNum(EXTRA_ICON_EMAIL);
- w = ExtraToColumnNum(EXTRA_ICON_ADV1);
-
- if (nm->iColumn == v)
- CallService(MS_USERINFO_SHOWDIALOG,(WPARAM)nm->hItem,0);
-
- if (nm->iColumn == e) {
- //CallService(MS_USERINFO_SHOWDIALOG,(WPARAM)nm->hItem,0);
- char *email,buf[4096];
- email = DBGetStringA(nm->hItem,"UserInfo", "Mye-mail0");
- if (email) {
- sprintf(buf,"mailto:%s",email);
- ShellExecuteA(hwnd,"open",buf,NULL,NULL,SW_SHOW);
- }
- }
- if (nm->iColumn == w) {
- char *homepage;
- homepage = DBGetStringA(pdnce->hContact,pdnce->szProto, "Homepage");
- if (homepage != NULL)
- ShellExecuteA(hwnd,"open",homepage,NULL,NULL,SW_SHOW);
- } } } }
+ if (hitFlags & CLCHT_ONITEMEXTRA)
+ if (!IsHContactGroup(hItem) && !IsHContactInfo(hItem)) {
+ pClcCacheEntry pdnce = (pClcCacheEntry)pcli->pfnGetCacheEntry(nm->hItem);
+ if (pdnce)
+ NotifyEventHooks(hExtraImageClick, (WPARAM)nm->hItem, nm->iColumn+1);
+ }
if (hItem) break;
if ((hitFlags&(CLCHT_NOWHERE|CLCHT_INLEFTMARGIN|CLCHT_BELOWITEMS)) == 0) break;
@@ -841,9 +767,6 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l int state = DBGetContactSettingByte(NULL,"CList","State",SETTING_STATE_NORMAL);
FreeProtocolData();
- if ( hSettingChangedHook != 0 )
- UnhookEvent(hSettingChangedHook);
-
if ( state == SETTING_STATE_NORMAL )
ShowWindow(hwnd,SW_HIDE);
diff --git a/plugins/Clist_mw/src/cluiopts.cpp b/plugins/Clist_mw/src/cluiopts.cpp index 37433ce481..07b12743f7 100644 --- a/plugins/Clist_mw/src/cluiopts.cpp +++ b/plugins/Clist_mw/src/cluiopts.cpp @@ -29,7 +29,6 @@ static INT_PTR CALLBACK DlgProcSBarOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L extern HANDLE hFrameHelperStatusBar;
extern int UseOwnerDrawStatusBar;
-void ReAssignExtraIcons();
void CluiProtocolStatusChanged(int parStatus, const char* szProto);
int OnStatusBarBackgroundChange();
@@ -55,374 +54,325 @@ int CluiOptInit(WPARAM wParam,LPARAM lParam) static INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- switch (msg)
- {
- case WM_INITDIALOG:
- TranslateDialogDefault(hwndDlg);
- CheckDlgButton(hwndDlg, IDC_BRINGTOFRONT, DBGetContactSettingByte(NULL,"CList","BringToFront",SETTING_BRINGTOFRONT_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_ONTOP, DBGetContactSettingByte(NULL,"CList","OnTop",SETTING_ONTOP_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_TOOLWND, DBGetContactSettingByte(NULL,"CList","ToolWindow",SETTING_TOOLWINDOW_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_MIN2TRAY, DBGetContactSettingByte(NULL,"CList","Min2Tray",SETTING_MIN2TRAY_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- if (IsDlgButtonChecked(hwndDlg,IDC_TOOLWND)) EnableWindow(GetDlgItem(hwndDlg,IDC_MIN2TRAY),FALSE);
- CheckDlgButton(hwndDlg, IDC_SHOWCAPTION, DBGetContactSettingByte(NULL,"CLUI","ShowCaption",SETTING_SHOWCAPTION_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SHOWMAINMENU, DBGetContactSettingByte(NULL,"CLUI","ShowMainMenu",SETTING_SHOWMAINMENU_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_CLIENTDRAG, DBGetContactSettingByte(NULL,"CLUI","ClientAreaDrag",SETTING_CLIENTDRAG_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- if (!IsDlgButtonChecked(hwndDlg,IDC_SHOWCAPTION)) {
- EnableWindow(GetDlgItem(hwndDlg,IDC_MIN2TRAY),FALSE);
- EnableWindow(GetDlgItem(hwndDlg,IDC_TOOLWND),FALSE);
- EnableWindow(GetDlgItem(hwndDlg,IDC_TITLETEXT),FALSE);
- }
- CheckDlgButton(hwndDlg, IDC_FADEINOUT, DBGetContactSettingByte(NULL,"CLUI","FadeInOut",0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_AUTOSIZE, DBGetContactSettingByte(NULL,"CLUI","AutoSize",0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_DROPSHADOW, DBGetContactSettingByte(NULL,"CList","WindowShadow",0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_ONDESKTOP, DBGetContactSettingByte(NULL,"CList","OnDesktop", 0) ? BST_CHECKED : BST_UNCHECKED);
- SendDlgItemMessage(hwndDlg,IDC_MAXSIZESPIN,UDM_SETRANGE,0,MAKELONG(100,0));
- SendDlgItemMessage(hwndDlg,IDC_MAXSIZESPIN,UDM_SETPOS,0,DBGetContactSettingByte(NULL,"CLUI","MaxSizeHeight",75));
- CheckDlgButton(hwndDlg, IDC_AUTOSIZEUPWARD, DBGetContactSettingByte(NULL,"CLUI","AutoSizeUpward",0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_AUTOHIDE, DBGetContactSettingByte(NULL,"CList","AutoHide",SETTING_AUTOHIDE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- SendDlgItemMessage(hwndDlg,IDC_HIDETIMESPIN,UDM_SETRANGE,0,MAKELONG(900,1));
- SendDlgItemMessage(hwndDlg,IDC_HIDETIMESPIN,UDM_SETPOS,0,MAKELONG(DBGetContactSettingWord(NULL,"CList","HideTime",SETTING_HIDETIME_DEFAULT),0));
+ switch (msg) {
+ case WM_INITDIALOG:
+ TranslateDialogDefault(hwndDlg);
+ CheckDlgButton(hwndDlg, IDC_BRINGTOFRONT, DBGetContactSettingByte(NULL,"CList","BringToFront",SETTING_BRINGTOFRONT_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_ONTOP, DBGetContactSettingByte(NULL,"CList","OnTop",SETTING_ONTOP_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_TOOLWND, DBGetContactSettingByte(NULL,"CList","ToolWindow",SETTING_TOOLWINDOW_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_MIN2TRAY, DBGetContactSettingByte(NULL,"CList","Min2Tray",SETTING_MIN2TRAY_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ if (IsDlgButtonChecked(hwndDlg,IDC_TOOLWND)) EnableWindow(GetDlgItem(hwndDlg,IDC_MIN2TRAY),FALSE);
+ CheckDlgButton(hwndDlg, IDC_SHOWCAPTION, DBGetContactSettingByte(NULL,"CLUI","ShowCaption",SETTING_SHOWCAPTION_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SHOWMAINMENU, DBGetContactSettingByte(NULL,"CLUI","ShowMainMenu",SETTING_SHOWMAINMENU_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CLIENTDRAG, DBGetContactSettingByte(NULL,"CLUI","ClientAreaDrag",SETTING_CLIENTDRAG_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ if (!IsDlgButtonChecked(hwndDlg,IDC_SHOWCAPTION)) {
+ EnableWindow(GetDlgItem(hwndDlg,IDC_MIN2TRAY),FALSE);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_TOOLWND),FALSE);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_TITLETEXT),FALSE);
+ }
+ CheckDlgButton(hwndDlg, IDC_FADEINOUT, DBGetContactSettingByte(NULL,"CLUI","FadeInOut",0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_AUTOSIZE, DBGetContactSettingByte(NULL,"CLUI","AutoSize",0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_DROPSHADOW, DBGetContactSettingByte(NULL,"CList","WindowShadow",0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_ONDESKTOP, DBGetContactSettingByte(NULL,"CList","OnDesktop", 0) ? BST_CHECKED : BST_UNCHECKED);
+ SendDlgItemMessage(hwndDlg,IDC_MAXSIZESPIN,UDM_SETRANGE,0,MAKELONG(100,0));
+ SendDlgItemMessage(hwndDlg,IDC_MAXSIZESPIN,UDM_SETPOS,0,DBGetContactSettingByte(NULL,"CLUI","MaxSizeHeight",75));
+ CheckDlgButton(hwndDlg, IDC_AUTOSIZEUPWARD, DBGetContactSettingByte(NULL,"CLUI","AutoSizeUpward",0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_AUTOHIDE, DBGetContactSettingByte(NULL,"CList","AutoHide",SETTING_AUTOHIDE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ SendDlgItemMessage(hwndDlg,IDC_HIDETIMESPIN,UDM_SETRANGE,0,MAKELONG(900,1));
+ SendDlgItemMessage(hwndDlg,IDC_HIDETIMESPIN,UDM_SETPOS,0,MAKELONG(DBGetContactSettingWord(NULL,"CList","HideTime",SETTING_HIDETIME_DEFAULT),0));
+ EnableWindow(GetDlgItem(hwndDlg,IDC_HIDETIME),IsDlgButtonChecked(hwndDlg,IDC_AUTOHIDE));
+ EnableWindow(GetDlgItem(hwndDlg,IDC_HIDETIMESPIN),IsDlgButtonChecked(hwndDlg,IDC_AUTOHIDE));
+ EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC01),IsDlgButtonChecked(hwndDlg,IDC_AUTOHIDE));
+ if (!IsDlgButtonChecked(hwndDlg,IDC_AUTOSIZE)) {
+ EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC21),FALSE);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC22),FALSE);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_MAXSIZEHEIGHT),FALSE);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_MAXSIZESPIN),FALSE);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_AUTOSIZEUPWARD),FALSE);
+ }
+
+ { DBVARIANT dbv;
+ char *s;
+ char szUin[20];
+
+ if (DBGetContactSettingString(NULL,"CList","TitleText",&dbv) == 0&&(dbv.pszVal))
+ {
+ s = mir_strdup(dbv.pszVal);
+ mir_free(dbv.pszVal);
+ }
+ else
+ {
+ s = mir_strdup(MIRANDANAME);
+ }
+
+ if (s)
+ {
+ SetDlgItemTextA(hwndDlg,IDC_TITLETEXT,s);
+ mir_free(s);
+ }
+
+ SendDlgItemMessage(hwndDlg,IDC_TITLETEXT,CB_ADDSTRING,0,(LPARAM)MIRANDANAME);
+ wsprintfA(szUin,"%u",DBGetContactSettingDword(NULL,"ICQ","UIN",0));
+ SendDlgItemMessage(hwndDlg,IDC_TITLETEXT,CB_ADDSTRING,0,(LPARAM)szUin);
+
+ if (!DBGetContactSettingString(NULL,"ICQ","Nick",&dbv)) {
+ SendDlgItemMessage(hwndDlg,IDC_TITLETEXT,CB_ADDSTRING,0,(LPARAM)dbv.pszVal);
+ mir_free(dbv.pszVal);
+ dbv.pszVal = NULL;
+ }
+ if (!DBGetContactSettingString(NULL,"ICQ","FirstName",&dbv)) {
+ SendDlgItemMessage(hwndDlg,IDC_TITLETEXT,CB_ADDSTRING,0,(LPARAM)dbv.pszVal);
+ mir_free(dbv.pszVal);
+ dbv.pszVal = NULL;
+ }
+ if (!DBGetContactSettingString(NULL,"ICQ","e-mail",&dbv)) {
+ SendDlgItemMessage(hwndDlg,IDC_TITLETEXT,CB_ADDSTRING,0,(LPARAM)dbv.pszVal);
+ mir_free(dbv.pszVal);
+ dbv.pszVal = NULL;
+ }
+ }
+ if (!IsWinVer2000Plus()) {
+ EnableWindow(GetDlgItem(hwndDlg,IDC_FADEINOUT),FALSE);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_TRANSPARENT),FALSE);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_DROPSHADOW),FALSE);
+ }
+ else CheckDlgButton(hwndDlg,IDC_TRANSPARENT,DBGetContactSettingByte(NULL,"CList","Transparent",SETTING_TRANSPARENT_DEFAULT)?BST_CHECKED:BST_UNCHECKED);
+ if (!IsDlgButtonChecked(hwndDlg,IDC_TRANSPARENT)) {
+ EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC11),FALSE);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC12),FALSE);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_TRANSACTIVE),FALSE);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_TRANSINACTIVE),FALSE);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_ACTIVEPERC),FALSE);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_INACTIVEPERC),FALSE);
+ }
+ SendDlgItemMessage(hwndDlg,IDC_TRANSACTIVE,TBM_SETRANGE,FALSE,MAKELONG(1,255));
+ SendDlgItemMessage(hwndDlg,IDC_TRANSINACTIVE,TBM_SETRANGE,FALSE,MAKELONG(1,255));
+ SendDlgItemMessage(hwndDlg,IDC_TRANSACTIVE,TBM_SETPOS,TRUE,DBGetContactSettingByte(NULL,"CList","Alpha",SETTING_ALPHA_DEFAULT));
+ SendDlgItemMessage(hwndDlg,IDC_TRANSINACTIVE,TBM_SETPOS,TRUE,DBGetContactSettingByte(NULL,"CList","AutoAlpha",SETTING_AUTOALPHA_DEFAULT));
+ SendMessage(hwndDlg,WM_HSCROLL,0x12345678,0);
+ return TRUE;
+
+ case WM_COMMAND:
+ if (LOWORD(wParam) == IDC_AUTOHIDE) {
EnableWindow(GetDlgItem(hwndDlg,IDC_HIDETIME),IsDlgButtonChecked(hwndDlg,IDC_AUTOHIDE));
EnableWindow(GetDlgItem(hwndDlg,IDC_HIDETIMESPIN),IsDlgButtonChecked(hwndDlg,IDC_AUTOHIDE));
EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC01),IsDlgButtonChecked(hwndDlg,IDC_AUTOHIDE));
- if (!IsDlgButtonChecked(hwndDlg,IDC_AUTOSIZE)) {
- EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC21),FALSE);
- EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC22),FALSE);
- EnableWindow(GetDlgItem(hwndDlg,IDC_MAXSIZEHEIGHT),FALSE);
- EnableWindow(GetDlgItem(hwndDlg,IDC_MAXSIZESPIN),FALSE);
- EnableWindow(GetDlgItem(hwndDlg,IDC_AUTOSIZEUPWARD),FALSE);
+ }
+ else if (LOWORD(wParam) == IDC_TRANSPARENT) {
+ EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC11),IsDlgButtonChecked(hwndDlg,IDC_TRANSPARENT));
+ EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC12),IsDlgButtonChecked(hwndDlg,IDC_TRANSPARENT));
+ EnableWindow(GetDlgItem(hwndDlg,IDC_TRANSACTIVE),IsDlgButtonChecked(hwndDlg,IDC_TRANSPARENT));
+ EnableWindow(GetDlgItem(hwndDlg,IDC_TRANSINACTIVE),IsDlgButtonChecked(hwndDlg,IDC_TRANSPARENT));
+ EnableWindow(GetDlgItem(hwndDlg,IDC_ACTIVEPERC),IsDlgButtonChecked(hwndDlg,IDC_TRANSPARENT));
+ EnableWindow(GetDlgItem(hwndDlg,IDC_INACTIVEPERC),IsDlgButtonChecked(hwndDlg,IDC_TRANSPARENT));
+ }
+ else if (LOWORD(wParam) == IDC_AUTOSIZE) {
+ EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC21),IsDlgButtonChecked(hwndDlg,IDC_AUTOSIZE));
+ EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC22),IsDlgButtonChecked(hwndDlg,IDC_AUTOSIZE));
+ EnableWindow(GetDlgItem(hwndDlg,IDC_MAXSIZEHEIGHT),IsDlgButtonChecked(hwndDlg,IDC_AUTOSIZE));
+ EnableWindow(GetDlgItem(hwndDlg,IDC_MAXSIZESPIN),IsDlgButtonChecked(hwndDlg,IDC_AUTOSIZE));
+ EnableWindow(GetDlgItem(hwndDlg,IDC_AUTOSIZEUPWARD),IsDlgButtonChecked(hwndDlg,IDC_AUTOSIZE));
+ }
+ else if (LOWORD(wParam) == IDC_TOOLWND) {
+ EnableWindow(GetDlgItem(hwndDlg,IDC_MIN2TRAY),!IsDlgButtonChecked(hwndDlg,IDC_TOOLWND));
+ }
+ else if (LOWORD(wParam) == IDC_SHOWCAPTION) {
+ EnableWindow(GetDlgItem(hwndDlg,IDC_TOOLWND),IsDlgButtonChecked(hwndDlg,IDC_SHOWCAPTION));
+ EnableWindow(GetDlgItem(hwndDlg,IDC_MIN2TRAY),!IsDlgButtonChecked(hwndDlg,IDC_TOOLWND) && IsDlgButtonChecked(hwndDlg,IDC_SHOWCAPTION));
+ EnableWindow(GetDlgItem(hwndDlg,IDC_TITLETEXT),IsDlgButtonChecked(hwndDlg,IDC_SHOWCAPTION));
+ }
+
+ if ((LOWORD(wParam) == IDC_HIDETIME || LOWORD(wParam) == IDC_TITLETEXT || LOWORD(wParam) == IDC_MAXSIZEHEIGHT) &&
+ (HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus()))
+ return 0;
+
+ // Enable apply button
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
+
+ case WM_HSCROLL:
+ { char str[10];
+ wsprintfA(str,"%d%%",100*SendDlgItemMessage(hwndDlg,IDC_TRANSINACTIVE,TBM_GETPOS,0,0)/255);
+ SetDlgItemTextA(hwndDlg,IDC_INACTIVEPERC,str);
+ wsprintfA(str,"%d%%",100*SendDlgItemMessage(hwndDlg,IDC_TRANSACTIVE,TBM_GETPOS,0,0)/255);
+ SetDlgItemTextA(hwndDlg,IDC_ACTIVEPERC,str);
+ }
+ if (wParam != 0x12345678) SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
+ case WM_NOTIFY:
+ switch (((LPNMHDR)lParam)->code)
+ {
+ case PSN_APPLY:
+ DBWriteContactSettingByte(NULL,"CList","OnTop",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_ONTOP));
+ SetWindowPos(pcli->hwndContactList, IsDlgButtonChecked(hwndDlg,IDC_ONTOP)?HWND_TOPMOST:HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
+
+ DBWriteContactSettingByte(NULL,"CList","ToolWindow",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_TOOLWND));
+ DBWriteContactSettingByte(NULL,"CList","BringToFront",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_BRINGTOFRONT));
+ if (IsDlgButtonChecked(hwndDlg,IDC_TOOLWND)) {
+ // Window must be hidden to dynamically remove the taskbar button.
+ // See http://msdn.microsoft.com/library/en-us/shellcc/platform/shell/programmersguide/shell_int/shell_int_programming/taskbar.asp
+ WINDOWPLACEMENT p;
+ p.length = sizeof(p);
+ GetWindowPlacement(pcli->hwndContactList,&p);
+ ShowWindow(pcli->hwndContactList,SW_HIDE);
+ SetWindowLongPtr(pcli->hwndContactList,GWL_EXSTYLE,GetWindowLongPtr(pcli->hwndContactList,GWL_EXSTYLE)|WS_EX_TOOLWINDOW|WS_EX_WINDOWEDGE);
+ SetWindowPlacement(pcli->hwndContactList,&p);
}
+ else
+ SetWindowLongPtr(pcli->hwndContactList,GWL_EXSTYLE,GetWindowLongPtr(pcli->hwndContactList,GWL_EXSTYLE)&~WS_EX_TOOLWINDOW);
- { DBVARIANT dbv;
- char *s;
- char szUin[20];
-
- if (DBGetContactSettingString(NULL,"CList","TitleText",&dbv) == 0&&(dbv.pszVal))
- {
- s = mir_strdup(dbv.pszVal);
- mir_free(dbv.pszVal);
- }
- else
- {
- s = mir_strdup(MIRANDANAME);
- }
+ if (IsDlgButtonChecked(hwndDlg,IDC_ONDESKTOP)) {
+ HWND hProgMan = FindWindowA("Progman",NULL);
+ if (IsWindow(hProgMan)) SetParent(pcli->hwndContactList,hProgMan);
+ } else {
+ SetParent(pcli->hwndContactList,NULL);
+ }
- if (s)
- {
- SetDlgItemTextA(hwndDlg,IDC_TITLETEXT,s);
- mir_free(s);
- }
+ DBWriteContactSettingByte(NULL,"CLUI","ShowCaption",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_SHOWCAPTION));
+ DBWriteContactSettingByte(NULL,"CLUI","ShowMainMenu",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_SHOWMAINMENU));
+ DBWriteContactSettingByte(NULL,"CLUI","ClientAreaDrag",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_CLIENTDRAG));
- SendDlgItemMessage(hwndDlg,IDC_TITLETEXT,CB_ADDSTRING,0,(LPARAM)MIRANDANAME);
- wsprintfA(szUin,"%u",DBGetContactSettingDword(NULL,"ICQ","UIN",0));
- SendDlgItemMessage(hwndDlg,IDC_TITLETEXT,CB_ADDSTRING,0,(LPARAM)szUin);
-
- if (!DBGetContactSettingString(NULL,"ICQ","Nick",&dbv)) {
- SendDlgItemMessage(hwndDlg,IDC_TITLETEXT,CB_ADDSTRING,0,(LPARAM)dbv.pszVal);
- mir_free(dbv.pszVal);
- dbv.pszVal = NULL;
- }
- if (!DBGetContactSettingString(NULL,"ICQ","FirstName",&dbv)) {
- SendDlgItemMessage(hwndDlg,IDC_TITLETEXT,CB_ADDSTRING,0,(LPARAM)dbv.pszVal);
- mir_free(dbv.pszVal);
- dbv.pszVal = NULL;
- }
- if (!DBGetContactSettingString(NULL,"ICQ","e-mail",&dbv)) {
- SendDlgItemMessage(hwndDlg,IDC_TITLETEXT,CB_ADDSTRING,0,(LPARAM)dbv.pszVal);
- mir_free(dbv.pszVal);
- dbv.pszVal = NULL;
- }
- }
- if (!IsWinVer2000Plus()) {
- EnableWindow(GetDlgItem(hwndDlg,IDC_FADEINOUT),FALSE);
- EnableWindow(GetDlgItem(hwndDlg,IDC_TRANSPARENT),FALSE);
- EnableWindow(GetDlgItem(hwndDlg,IDC_DROPSHADOW),FALSE);
- }
- else CheckDlgButton(hwndDlg,IDC_TRANSPARENT,DBGetContactSettingByte(NULL,"CList","Transparent",SETTING_TRANSPARENT_DEFAULT)?BST_CHECKED:BST_UNCHECKED);
- if (!IsDlgButtonChecked(hwndDlg,IDC_TRANSPARENT)) {
- EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC11),FALSE);
- EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC12),FALSE);
- EnableWindow(GetDlgItem(hwndDlg,IDC_TRANSACTIVE),FALSE);
- EnableWindow(GetDlgItem(hwndDlg,IDC_TRANSINACTIVE),FALSE);
- EnableWindow(GetDlgItem(hwndDlg,IDC_ACTIVEPERC),FALSE);
- EnableWindow(GetDlgItem(hwndDlg,IDC_INACTIVEPERC),FALSE);
- }
- SendDlgItemMessage(hwndDlg,IDC_TRANSACTIVE,TBM_SETRANGE,FALSE,MAKELONG(1,255));
- SendDlgItemMessage(hwndDlg,IDC_TRANSINACTIVE,TBM_SETRANGE,FALSE,MAKELONG(1,255));
- SendDlgItemMessage(hwndDlg,IDC_TRANSACTIVE,TBM_SETPOS,TRUE,DBGetContactSettingByte(NULL,"CList","Alpha",SETTING_ALPHA_DEFAULT));
- SendDlgItemMessage(hwndDlg,IDC_TRANSINACTIVE,TBM_SETPOS,TRUE,DBGetContactSettingByte(NULL,"CList","AutoAlpha",SETTING_AUTOALPHA_DEFAULT));
- SendMessage(hwndDlg,WM_HSCROLL,0x12345678,0);
-
- // EXTRA Icons
- if (ServiceExists("ExtraIcon/Register"))
- {
- ShowWindow(GetDlgItem(hwndDlg,IDC_EXTRA_FRAME), SW_HIDE);
- ShowWindow(GetDlgItem(hwndDlg,IDC_EXTRA_PROTO), SW_HIDE);
- ShowWindow(GetDlgItem(hwndDlg,IDC_EXTRA_WEB), SW_HIDE);
- ShowWindow(GetDlgItem(hwndDlg,IDC_EXTRA_EMAIL), SW_HIDE);
- ShowWindow(GetDlgItem(hwndDlg,IDC_EXTRA_CELLULAR), SW_HIDE);
- ShowWindow(GetDlgItem(hwndDlg,IDC_EXTRA_ADV1), SW_HIDE);
- ShowWindow(GetDlgItem(hwndDlg,IDC_EXTRA_ADV2), SW_HIDE);
- }
+ if (IsDlgButtonChecked(hwndDlg,IDC_SHOWCAPTION))
+ SetWindowLongPtr(pcli->hwndContactList,GWL_STYLE,GetWindowLongPtr(pcli->hwndContactList,GWL_STYLE)|WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX);
else
- {
- CheckDlgButton(hwndDlg, IDC_EXTRA_PROTO, DBGetContactSettingByte(NULL,CLUIFrameModule,"EXTRA_ICON_PROTO",1) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_EXTRA_WEB, DBGetContactSettingByte(NULL,CLUIFrameModule,"EXTRA_ICON_WEB",1) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_EXTRA_EMAIL, DBGetContactSettingByte(NULL,CLUIFrameModule,"EXTRA_ICON_EMAIL",1) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_EXTRA_CELLULAR, DBGetContactSettingByte(NULL,CLUIFrameModule,"EXTRA_ICON_SMS",1) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_EXTRA_ADV1, DBGetContactSettingByte(NULL,CLUIFrameModule,"EXTRA_ICON_ADV1",1) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_EXTRA_ADV2, DBGetContactSettingByte(NULL,CLUIFrameModule,"EXTRA_ICON_ADV2",1) ? BST_CHECKED : BST_UNCHECKED);
- }
+ SetWindowLongPtr(pcli->hwndContactList,GWL_STYLE,GetWindowLongPtr(pcli->hwndContactList,GWL_STYLE)&~(WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX));
- return TRUE;
-
- case WM_COMMAND:
- if (LOWORD(wParam) == IDC_AUTOHIDE) {
- EnableWindow(GetDlgItem(hwndDlg,IDC_HIDETIME),IsDlgButtonChecked(hwndDlg,IDC_AUTOHIDE));
- EnableWindow(GetDlgItem(hwndDlg,IDC_HIDETIMESPIN),IsDlgButtonChecked(hwndDlg,IDC_AUTOHIDE));
- EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC01),IsDlgButtonChecked(hwndDlg,IDC_AUTOHIDE));
- }
- else if (LOWORD(wParam) == IDC_TRANSPARENT) {
- EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC11),IsDlgButtonChecked(hwndDlg,IDC_TRANSPARENT));
- EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC12),IsDlgButtonChecked(hwndDlg,IDC_TRANSPARENT));
- EnableWindow(GetDlgItem(hwndDlg,IDC_TRANSACTIVE),IsDlgButtonChecked(hwndDlg,IDC_TRANSPARENT));
- EnableWindow(GetDlgItem(hwndDlg,IDC_TRANSINACTIVE),IsDlgButtonChecked(hwndDlg,IDC_TRANSPARENT));
- EnableWindow(GetDlgItem(hwndDlg,IDC_ACTIVEPERC),IsDlgButtonChecked(hwndDlg,IDC_TRANSPARENT));
- EnableWindow(GetDlgItem(hwndDlg,IDC_INACTIVEPERC),IsDlgButtonChecked(hwndDlg,IDC_TRANSPARENT));
- }
- else if (LOWORD(wParam) == IDC_AUTOSIZE) {
- EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC21),IsDlgButtonChecked(hwndDlg,IDC_AUTOSIZE));
- EnableWindow(GetDlgItem(hwndDlg,IDC_STATIC22),IsDlgButtonChecked(hwndDlg,IDC_AUTOSIZE));
- EnableWindow(GetDlgItem(hwndDlg,IDC_MAXSIZEHEIGHT),IsDlgButtonChecked(hwndDlg,IDC_AUTOSIZE));
- EnableWindow(GetDlgItem(hwndDlg,IDC_MAXSIZESPIN),IsDlgButtonChecked(hwndDlg,IDC_AUTOSIZE));
- EnableWindow(GetDlgItem(hwndDlg,IDC_AUTOSIZEUPWARD),IsDlgButtonChecked(hwndDlg,IDC_AUTOSIZE));
- }
- else if (LOWORD(wParam) == IDC_TOOLWND) {
- EnableWindow(GetDlgItem(hwndDlg,IDC_MIN2TRAY),!IsDlgButtonChecked(hwndDlg,IDC_TOOLWND));
- }
- else if (LOWORD(wParam) == IDC_SHOWCAPTION) {
- EnableWindow(GetDlgItem(hwndDlg,IDC_TOOLWND),IsDlgButtonChecked(hwndDlg,IDC_SHOWCAPTION));
- EnableWindow(GetDlgItem(hwndDlg,IDC_MIN2TRAY),!IsDlgButtonChecked(hwndDlg,IDC_TOOLWND) && IsDlgButtonChecked(hwndDlg,IDC_SHOWCAPTION));
- EnableWindow(GetDlgItem(hwndDlg,IDC_TITLETEXT),IsDlgButtonChecked(hwndDlg,IDC_SHOWCAPTION));
- }
+ if (!IsDlgButtonChecked(hwndDlg,IDC_SHOWMAINMENU)) SetMenu(pcli->hwndContactList,NULL);
+ else SetMenu(pcli->hwndContactList,hMenuMain);
+
+ SetWindowPos(pcli->hwndContactList,0,0,0,0,0,SWP_NOZORDER|SWP_NOMOVE|SWP_NOSIZE|SWP_FRAMECHANGED);
+ RedrawWindow(pcli->hwndContactList,NULL,NULL,RDW_FRAME|RDW_INVALIDATE);
+
+ DBWriteContactSettingByte(NULL,"CList","Min2Tray",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_MIN2TRAY));
+ if (IsIconic(pcli->hwndContactList) && !IsDlgButtonChecked(hwndDlg,IDC_TOOLWND))
+ ShowWindow(pcli->hwndContactList,IsDlgButtonChecked(hwndDlg,IDC_MIN2TRAY)?SW_HIDE:SW_SHOW);
- if ((LOWORD(wParam) == IDC_HIDETIME || LOWORD(wParam) == IDC_TITLETEXT || LOWORD(wParam) == IDC_MAXSIZEHEIGHT) &&
- (HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus()))
- return 0;
-
- // Enable apply button
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- break;
-
- case WM_HSCROLL:
- { char str[10];
- wsprintfA(str,"%d%%",100*SendDlgItemMessage(hwndDlg,IDC_TRANSINACTIVE,TBM_GETPOS,0,0)/255);
- SetDlgItemTextA(hwndDlg,IDC_INACTIVEPERC,str);
- wsprintfA(str,"%d%%",100*SendDlgItemMessage(hwndDlg,IDC_TRANSACTIVE,TBM_GETPOS,0,0)/255);
- SetDlgItemTextA(hwndDlg,IDC_ACTIVEPERC,str);
+ { TCHAR title[256];
+ GetDlgItemText(hwndDlg,IDC_TITLETEXT,title,SIZEOF(title));
+ DBWriteContactSettingTString(NULL,"CList","TitleText",title);
+ SetWindowText(pcli->hwndContactList,title);
}
- if (wParam != 0x12345678) SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- break;
- case WM_NOTIFY:
- switch (((LPNMHDR)lParam)->code)
- {
- case PSN_APPLY:
- DBWriteContactSettingByte(NULL,"CList","OnTop",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_ONTOP));
- SetWindowPos(pcli->hwndContactList, IsDlgButtonChecked(hwndDlg,IDC_ONTOP)?HWND_TOPMOST:HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
-
- DBWriteContactSettingByte(NULL,"CList","ToolWindow",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_TOOLWND));
- DBWriteContactSettingByte(NULL,"CList","BringToFront",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_BRINGTOFRONT));
- if (IsDlgButtonChecked(hwndDlg,IDC_TOOLWND)) {
- // Window must be hidden to dynamically remove the taskbar button.
- // See http://msdn.microsoft.com/library/en-us/shellcc/platform/shell/programmersguide/shell_int/shell_int_programming/taskbar.asp
- WINDOWPLACEMENT p;
- p.length = sizeof(p);
- GetWindowPlacement(pcli->hwndContactList,&p);
- ShowWindow(pcli->hwndContactList,SW_HIDE);
- SetWindowLongPtr(pcli->hwndContactList,GWL_EXSTYLE,GetWindowLongPtr(pcli->hwndContactList,GWL_EXSTYLE)|WS_EX_TOOLWINDOW|WS_EX_WINDOWEDGE);
- SetWindowPlacement(pcli->hwndContactList,&p);
- }
- else
- SetWindowLongPtr(pcli->hwndContactList,GWL_EXSTYLE,GetWindowLongPtr(pcli->hwndContactList,GWL_EXSTYLE)&~WS_EX_TOOLWINDOW);
-
- if (IsDlgButtonChecked(hwndDlg,IDC_ONDESKTOP)) {
- HWND hProgMan = FindWindowA("Progman",NULL);
- if (IsWindow(hProgMan)) SetParent(pcli->hwndContactList,hProgMan);
- } else {
- SetParent(pcli->hwndContactList,NULL);
- }
-
- DBWriteContactSettingByte(NULL,"CLUI","ShowCaption",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_SHOWCAPTION));
- DBWriteContactSettingByte(NULL,"CLUI","ShowMainMenu",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_SHOWMAINMENU));
- DBWriteContactSettingByte(NULL,"CLUI","ClientAreaDrag",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_CLIENTDRAG));
-
- if (IsDlgButtonChecked(hwndDlg,IDC_SHOWCAPTION))
- SetWindowLongPtr(pcli->hwndContactList,GWL_STYLE,GetWindowLongPtr(pcli->hwndContactList,GWL_STYLE)|WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX);
- else
- SetWindowLongPtr(pcli->hwndContactList,GWL_STYLE,GetWindowLongPtr(pcli->hwndContactList,GWL_STYLE)&~(WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX));
-
- if (!IsDlgButtonChecked(hwndDlg,IDC_SHOWMAINMENU)) SetMenu(pcli->hwndContactList,NULL);
- else SetMenu(pcli->hwndContactList,hMenuMain);
-
- SetWindowPos(pcli->hwndContactList,0,0,0,0,0,SWP_NOZORDER|SWP_NOMOVE|SWP_NOSIZE|SWP_FRAMECHANGED);
- RedrawWindow(pcli->hwndContactList,NULL,NULL,RDW_FRAME|RDW_INVALIDATE);
-
- DBWriteContactSettingByte(NULL,"CList","Min2Tray",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_MIN2TRAY));
- if (IsIconic(pcli->hwndContactList) && !IsDlgButtonChecked(hwndDlg,IDC_TOOLWND))
- ShowWindow(pcli->hwndContactList,IsDlgButtonChecked(hwndDlg,IDC_MIN2TRAY)?SW_HIDE:SW_SHOW);
-
- { TCHAR title[256];
- GetDlgItemText(hwndDlg,IDC_TITLETEXT,title,SIZEOF(title));
- DBWriteContactSettingTString(NULL,"CList","TitleText",title);
- SetWindowText(pcli->hwndContactList,title);
- }
- DBWriteContactSettingByte(NULL,"CLUI","FadeInOut",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_FADEINOUT));
- DBWriteContactSettingByte(NULL,"CLUI","AutoSize",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_AUTOSIZE));
- DBWriteContactSettingByte(NULL,"CLUI","MaxSizeHeight",(BYTE)GetDlgItemInt(hwndDlg,IDC_MAXSIZEHEIGHT,NULL,FALSE));
- DBWriteContactSettingByte(NULL,"CLUI","AutoSizeUpward",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_AUTOSIZEUPWARD));
- DBWriteContactSettingByte(NULL,"CList","AutoHide",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_AUTOHIDE));
- DBWriteContactSettingWord(NULL,"CList","HideTime",(WORD)SendDlgItemMessage(hwndDlg,IDC_HIDETIMESPIN,UDM_GETPOS,0,0));
-
- DBWriteContactSettingByte(NULL,"CList","Transparent",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_TRANSPARENT));
- DBWriteContactSettingByte(NULL,"CList","Alpha",(BYTE)SendDlgItemMessage(hwndDlg,IDC_TRANSACTIVE,TBM_GETPOS,0,0));
- DBWriteContactSettingByte(NULL,"CList","AutoAlpha",(BYTE)SendDlgItemMessage(hwndDlg,IDC_TRANSINACTIVE,TBM_GETPOS,0,0));
- DBWriteContactSettingByte(NULL,"CList","WindowShadow",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_DROPSHADOW));
- DBWriteContactSettingByte(NULL,"CList","OnDesktop",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_ONDESKTOP));
- if (IsDlgButtonChecked(hwndDlg,IDC_TRANSPARENT)) {
- SetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE) | WS_EX_LAYERED);
- if (MySetLayeredWindowAttributes) MySetLayeredWindowAttributes(pcli->hwndContactList, RGB(0,0,0), (BYTE)DBGetContactSettingByte(NULL,"CList","AutoAlpha",SETTING_AUTOALPHA_DEFAULT), LWA_ALPHA);
- }
- else {
- SetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE) & ~WS_EX_LAYERED);
- }
- SendMessage(pcli->hwndContactTree,WM_SIZE,0,0); //forces it to send a cln_listsizechanged
-
- if (!ServiceExists("ExtraIcon/Register"))
- {
- DBWriteContactSettingByte(NULL,CLUIFrameModule,"EXTRA_ICON_PROTO",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_EXTRA_PROTO));
- DBWriteContactSettingByte(NULL,CLUIFrameModule,"EXTRA_ICON_WEB",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_EXTRA_WEB));
- DBWriteContactSettingByte(NULL,CLUIFrameModule,"EXTRA_ICON_EMAIL",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_EXTRA_EMAIL));
- DBWriteContactSettingByte(NULL,CLUIFrameModule,"EXTRA_ICON_SMS",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_EXTRA_CELLULAR));
- DBWriteContactSettingByte(NULL,CLUIFrameModule,"EXTRA_ICON_ADV1",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_EXTRA_ADV1));
- DBWriteContactSettingByte(NULL,CLUIFrameModule,"EXTRA_ICON_ADV2",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_EXTRA_ADV2));
- //SetAllExtraIcons()
- ReAssignExtraIcons();
- }
-
- return TRUE;
+ DBWriteContactSettingByte(NULL,"CLUI","FadeInOut",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_FADEINOUT));
+ DBWriteContactSettingByte(NULL,"CLUI","AutoSize",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_AUTOSIZE));
+ DBWriteContactSettingByte(NULL,"CLUI","MaxSizeHeight",(BYTE)GetDlgItemInt(hwndDlg,IDC_MAXSIZEHEIGHT,NULL,FALSE));
+ DBWriteContactSettingByte(NULL,"CLUI","AutoSizeUpward",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_AUTOSIZEUPWARD));
+ DBWriteContactSettingByte(NULL,"CList","AutoHide",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_AUTOHIDE));
+ DBWriteContactSettingWord(NULL,"CList","HideTime",(WORD)SendDlgItemMessage(hwndDlg,IDC_HIDETIMESPIN,UDM_GETPOS,0,0));
+
+ DBWriteContactSettingByte(NULL,"CList","Transparent",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_TRANSPARENT));
+ DBWriteContactSettingByte(NULL,"CList","Alpha",(BYTE)SendDlgItemMessage(hwndDlg,IDC_TRANSACTIVE,TBM_GETPOS,0,0));
+ DBWriteContactSettingByte(NULL,"CList","AutoAlpha",(BYTE)SendDlgItemMessage(hwndDlg,IDC_TRANSINACTIVE,TBM_GETPOS,0,0));
+ DBWriteContactSettingByte(NULL,"CList","WindowShadow",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_DROPSHADOW));
+ DBWriteContactSettingByte(NULL,"CList","OnDesktop",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_ONDESKTOP));
+ if (IsDlgButtonChecked(hwndDlg,IDC_TRANSPARENT)) {
+ SetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE) | WS_EX_LAYERED);
+ if (MySetLayeredWindowAttributes) MySetLayeredWindowAttributes(pcli->hwndContactList, RGB(0,0,0), (BYTE)DBGetContactSettingByte(NULL,"CList","AutoAlpha",SETTING_AUTOALPHA_DEFAULT), LWA_ALPHA);
}
- break;
+ else SetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE) & ~WS_EX_LAYERED);
+
+ SendMessage(pcli->hwndContactTree,WM_SIZE,0,0); //forces it to send a cln_listsizechanged
+ return TRUE;
+ }
+ break;
}
return FALSE;
}
static INT_PTR CALLBACK DlgProcSBarOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- switch (msg)
- {
- case WM_INITDIALOG:
- TranslateDialogDefault(hwndDlg);
- CheckDlgButton(hwndDlg, IDC_SHOWSBAR, DBGetContactSettingByte(NULL,"CLUI","ShowSBar",1) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_USECONNECTINGICON, DBGetContactSettingByte(NULL,"CLUI","UseConnectingIcon",1) ? BST_CHECKED : BST_UNCHECKED);
- { BYTE showOpts = DBGetContactSettingByte(NULL,"CLUI","SBarShow",1);
- CheckDlgButton(hwndDlg, IDC_SHOWICON, showOpts&1 ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SHOWPROTO, showOpts&2 ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SHOWSTATUS, showOpts&4 ? BST_CHECKED : BST_UNCHECKED);
- }
- CheckDlgButton(hwndDlg, IDC_RIGHTSTATUS, DBGetContactSettingByte(NULL,"CLUI","SBarRightClk",0) ? BST_UNCHECKED : BST_CHECKED);
- CheckDlgButton(hwndDlg, IDC_RIGHTMIRANDA, !IsDlgButtonChecked(hwndDlg,IDC_RIGHTSTATUS) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_EQUALSECTIONS, DBGetContactSettingByte(NULL,"CLUI","EqualSections",0) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SBPANELBEVEL, DBGetContactSettingByte(NULL,"CLUI","SBarBevel",1) ? BST_CHECKED : BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_SHOWSIZEGRIP, DBGetContactSettingByte(NULL,"CLUI","SBarUseSizeGrip",1) ? BST_CHECKED : BST_UNCHECKED);
-
- CheckDlgButton(hwndDlg, IDC_USEOWNERDRAW, DBGetContactSettingByte(NULL,"CLUI","UseOwnerDrawStatusBar",1) ? BST_CHECKED : BST_UNCHECKED);
-
- SendDlgItemMessage(hwndDlg,IDC_BKGCOLOUR,CPM_SETCOLOUR,0,DBGetContactSettingDword(NULL,"CLUI","SBarBKColor",CLR_DEFAULT));
-
- if (!IsDlgButtonChecked(hwndDlg,IDC_SHOWSBAR)) {
- EnableWindow(GetDlgItem(hwndDlg,IDC_SHOWICON),FALSE);
- EnableWindow(GetDlgItem(hwndDlg,IDC_SHOWPROTO),FALSE);
- EnableWindow(GetDlgItem(hwndDlg,IDC_SHOWSTATUS),FALSE);
- EnableWindow(GetDlgItem(hwndDlg,IDC_RIGHTSTATUS),FALSE);
- EnableWindow(GetDlgItem(hwndDlg,IDC_RIGHTMIRANDA),FALSE);
- EnableWindow(GetDlgItem(hwndDlg,IDC_EQUALSECTIONS),FALSE);
- EnableWindow(GetDlgItem(hwndDlg,IDC_SBPANELBEVEL),FALSE);
- EnableWindow(GetDlgItem(hwndDlg,IDC_SHOWSIZEGRIP),FALSE);
- EnableWindow(GetDlgItem(hwndDlg,IDC_USECONNECTINGICON),FALSE);
- EnableWindow(GetDlgItem(hwndDlg,IDC_USEOWNERDRAW),FALSE);
+ switch (msg) {
+ case WM_INITDIALOG:
+ TranslateDialogDefault(hwndDlg);
+ CheckDlgButton(hwndDlg, IDC_SHOWSBAR, DBGetContactSettingByte(NULL,"CLUI","ShowSBar",1) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_USECONNECTINGICON, DBGetContactSettingByte(NULL,"CLUI","UseConnectingIcon",1) ? BST_CHECKED : BST_UNCHECKED);
+ { BYTE showOpts = DBGetContactSettingByte(NULL,"CLUI","SBarShow",1);
+ CheckDlgButton(hwndDlg, IDC_SHOWICON, showOpts&1 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SHOWPROTO, showOpts&2 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SHOWSTATUS, showOpts&4 ? BST_CHECKED : BST_UNCHECKED);
+ }
+ CheckDlgButton(hwndDlg, IDC_RIGHTSTATUS, DBGetContactSettingByte(NULL,"CLUI","SBarRightClk",0) ? BST_UNCHECKED : BST_CHECKED);
+ CheckDlgButton(hwndDlg, IDC_RIGHTMIRANDA, !IsDlgButtonChecked(hwndDlg,IDC_RIGHTSTATUS) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_EQUALSECTIONS, DBGetContactSettingByte(NULL,"CLUI","EqualSections",0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SBPANELBEVEL, DBGetContactSettingByte(NULL,"CLUI","SBarBevel",1) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SHOWSIZEGRIP, DBGetContactSettingByte(NULL,"CLUI","SBarUseSizeGrip",1) ? BST_CHECKED : BST_UNCHECKED);
+
+ CheckDlgButton(hwndDlg, IDC_USEOWNERDRAW, DBGetContactSettingByte(NULL,"CLUI","UseOwnerDrawStatusBar",1) ? BST_CHECKED : BST_UNCHECKED);
+
+ SendDlgItemMessage(hwndDlg,IDC_BKGCOLOUR,CPM_SETCOLOUR,0,DBGetContactSettingDword(NULL,"CLUI","SBarBKColor",CLR_DEFAULT));
+
+ if (!IsDlgButtonChecked(hwndDlg,IDC_SHOWSBAR)) {
+ EnableWindow(GetDlgItem(hwndDlg,IDC_SHOWICON),FALSE);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_SHOWPROTO),FALSE);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_SHOWSTATUS),FALSE);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_RIGHTSTATUS),FALSE);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_RIGHTMIRANDA),FALSE);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_EQUALSECTIONS),FALSE);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_SBPANELBEVEL),FALSE);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_SHOWSIZEGRIP),FALSE);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_USECONNECTINGICON),FALSE);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_USEOWNERDRAW),FALSE);
+
+ }
+ return TRUE;
+ case WM_COMMAND:
+ if (LOWORD(wParam) == IDC_SHOWSBAR) {
+ EnableWindow(GetDlgItem(hwndDlg,IDC_SHOWICON),IsDlgButtonChecked(hwndDlg,IDC_SHOWSBAR));
+ EnableWindow(GetDlgItem(hwndDlg,IDC_SHOWPROTO),IsDlgButtonChecked(hwndDlg,IDC_SHOWSBAR));
+ EnableWindow(GetDlgItem(hwndDlg,IDC_SHOWSTATUS),IsDlgButtonChecked(hwndDlg,IDC_SHOWSBAR));
+ EnableWindow(GetDlgItem(hwndDlg,IDC_RIGHTSTATUS),IsDlgButtonChecked(hwndDlg,IDC_SHOWSBAR));
+ EnableWindow(GetDlgItem(hwndDlg,IDC_RIGHTMIRANDA),IsDlgButtonChecked(hwndDlg,IDC_SHOWSBAR));
+ EnableWindow(GetDlgItem(hwndDlg,IDC_EQUALSECTIONS),IsDlgButtonChecked(hwndDlg,IDC_SHOWSBAR));
+ EnableWindow(GetDlgItem(hwndDlg,IDC_SBPANELBEVEL),IsDlgButtonChecked(hwndDlg,IDC_SHOWSBAR));
+ EnableWindow(GetDlgItem(hwndDlg,IDC_SHOWSIZEGRIP),IsDlgButtonChecked(hwndDlg,IDC_SHOWSBAR));
+ EnableWindow(GetDlgItem(hwndDlg,IDC_USECONNECTINGICON),IsDlgButtonChecked(hwndDlg,IDC_SHOWSBAR));
+ EnableWindow(GetDlgItem(hwndDlg,IDC_USEOWNERDRAW),IsDlgButtonChecked(hwndDlg,IDC_SHOWSBAR));
+
+ }
+ if (LOWORD(wParam) == IDC_DEFBKCOLOR)
+ {
+ SendDlgItemMessage(hwndDlg,IDC_BKGCOLOUR,CPM_SETCOLOUR,0,CLR_DEFAULT);
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ }
+
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
+ case WM_NOTIFY:
+ switch (((LPNMHDR)lParam)->code) {
+ case PSN_APPLY:
+ {
+ COLORREF col = SendDlgItemMessage(hwndDlg,IDC_BKGCOLOUR,CPM_GETCOLOUR,0,0);
+ DBWriteContactSettingDword(NULL,"CLUI","SBarBKColor",col);
+
+ DBWriteContactSettingByte(NULL,"CLUI","ShowSBar",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_SHOWSBAR));
+ DBWriteContactSettingByte(NULL,"CLUI","SBarShow",(BYTE)((IsDlgButtonChecked(hwndDlg,IDC_SHOWICON)?1:0)|(IsDlgButtonChecked(hwndDlg,IDC_SHOWPROTO)?2:0)|(IsDlgButtonChecked(hwndDlg,IDC_SHOWSTATUS)?4:0)));
+ DBWriteContactSettingByte(NULL,"CLUI","SBarRightClk",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_RIGHTMIRANDA));
+ DBWriteContactSettingByte(NULL,"CLUI","EqualSections",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_EQUALSECTIONS));
+ DBWriteContactSettingByte(NULL,"CLUI","SBarBevel",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_SBPANELBEVEL));
+ DBWriteContactSettingByte(NULL,"CLUI","SBarUseSizeGrip",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_SHOWSIZEGRIP));
+
+ DBWriteContactSettingByte(NULL,"CLUI","UseConnectingIcon",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_USECONNECTINGICON));
+ DBWriteContactSettingByte(NULL,"CLUI","UseOwnerDrawStatusBar",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_USEOWNERDRAW));
+ UseOwnerDrawStatusBar = DBGetContactSettingByte(NULL,"CLUI","UseOwnerDrawStatusBar",0);
+
+ int frameopt = CallService(MS_CLIST_FRAMES_GETFRAMEOPTIONS,MAKEWPARAM(FO_FLAGS,hFrameHelperStatusBar),0);
+ frameopt &= ~F_VISIBLE;
+
+ if (IsDlgButtonChecked(hwndDlg,IDC_SHOWSBAR)) {
+ ShowWindow(pcli->hwndStatus,SW_SHOW);
+ frameopt |= F_VISIBLE;
+ }
+ else ShowWindow(pcli->hwndStatus,SW_HIDE);
- }
- return TRUE;
- case WM_COMMAND:
- if (LOWORD(wParam) == IDC_SHOWSBAR) {
- EnableWindow(GetDlgItem(hwndDlg,IDC_SHOWICON),IsDlgButtonChecked(hwndDlg,IDC_SHOWSBAR));
- EnableWindow(GetDlgItem(hwndDlg,IDC_SHOWPROTO),IsDlgButtonChecked(hwndDlg,IDC_SHOWSBAR));
- EnableWindow(GetDlgItem(hwndDlg,IDC_SHOWSTATUS),IsDlgButtonChecked(hwndDlg,IDC_SHOWSBAR));
- EnableWindow(GetDlgItem(hwndDlg,IDC_RIGHTSTATUS),IsDlgButtonChecked(hwndDlg,IDC_SHOWSBAR));
- EnableWindow(GetDlgItem(hwndDlg,IDC_RIGHTMIRANDA),IsDlgButtonChecked(hwndDlg,IDC_SHOWSBAR));
- EnableWindow(GetDlgItem(hwndDlg,IDC_EQUALSECTIONS),IsDlgButtonChecked(hwndDlg,IDC_SHOWSBAR));
- EnableWindow(GetDlgItem(hwndDlg,IDC_SBPANELBEVEL),IsDlgButtonChecked(hwndDlg,IDC_SHOWSBAR));
- EnableWindow(GetDlgItem(hwndDlg,IDC_SHOWSIZEGRIP),IsDlgButtonChecked(hwndDlg,IDC_SHOWSBAR));
- EnableWindow(GetDlgItem(hwndDlg,IDC_USECONNECTINGICON),IsDlgButtonChecked(hwndDlg,IDC_SHOWSBAR));
- EnableWindow(GetDlgItem(hwndDlg,IDC_USEOWNERDRAW),IsDlgButtonChecked(hwndDlg,IDC_SHOWSBAR));
+ CallService(MS_CLIST_FRAMES_SETFRAMEOPTIONS,MAKEWPARAM(FO_FLAGS,hFrameHelperStatusBar),frameopt);
- }
- if (LOWORD(wParam) == IDC_DEFBKCOLOR)
- {
- SendDlgItemMessage(hwndDlg,IDC_BKGCOLOUR,CPM_SETCOLOUR,0,CLR_DEFAULT);
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- }
+ SendMessage(pcli->hwndContactList,WM_SIZE,0,0);
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- break;
- case WM_NOTIFY:
- switch (((LPNMHDR)lParam)->code)
- {
- case PSN_APPLY:
- {
- int frameopt;
-
- COLORREF col;
- col = SendDlgItemMessage(hwndDlg,IDC_BKGCOLOUR,CPM_GETCOLOUR,0,0);
- DBWriteContactSettingDword(NULL,"CLUI","SBarBKColor",col);
-
-
-
- DBWriteContactSettingByte(NULL,"CLUI","ShowSBar",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_SHOWSBAR));
- DBWriteContactSettingByte(NULL,"CLUI","SBarShow",(BYTE)((IsDlgButtonChecked(hwndDlg,IDC_SHOWICON)?1:0)|(IsDlgButtonChecked(hwndDlg,IDC_SHOWPROTO)?2:0)|(IsDlgButtonChecked(hwndDlg,IDC_SHOWSTATUS)?4:0)));
- DBWriteContactSettingByte(NULL,"CLUI","SBarRightClk",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_RIGHTMIRANDA));
- DBWriteContactSettingByte(NULL,"CLUI","EqualSections",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_EQUALSECTIONS));
- DBWriteContactSettingByte(NULL,"CLUI","SBarBevel",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_SBPANELBEVEL));
- DBWriteContactSettingByte(NULL,"CLUI","SBarUseSizeGrip",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_SHOWSIZEGRIP));
-
- DBWriteContactSettingByte(NULL,"CLUI","UseConnectingIcon",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_USECONNECTINGICON));
- DBWriteContactSettingByte(NULL,"CLUI","UseOwnerDrawStatusBar",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_USEOWNERDRAW));
- UseOwnerDrawStatusBar = DBGetContactSettingByte(NULL,"CLUI","UseOwnerDrawStatusBar",0);
-/*
- if (IsDlgButtonChecked(hwndDlg,IDC_SHOWSBAR)) ShowWindow(pcli->hwndStatus,SW_SHOW);
- else ShowWindow(pcli->hwndStatus,SW_HIDE);
-*/
-
- frameopt = CallService(MS_CLIST_FRAMES_GETFRAMEOPTIONS,MAKEWPARAM(FO_FLAGS,hFrameHelperStatusBar),0);
-
- frameopt = frameopt & (~F_VISIBLE);
-
- if (IsDlgButtonChecked(hwndDlg,IDC_SHOWSBAR)) {
- ShowWindow(pcli->hwndStatus,SW_SHOW);
- frameopt |= F_VISIBLE;
- }
- else ShowWindow(pcli->hwndStatus,SW_HIDE);
-
- CallService(MS_CLIST_FRAMES_SETFRAMEOPTIONS,MAKEWPARAM(FO_FLAGS,hFrameHelperStatusBar),frameopt);
-
- SendMessage(pcli->hwndContactList,WM_SIZE,0,0);
-
- OnStatusBarBackgroundChange();
- CluiProtocolStatusChanged(0,0);
- return TRUE;
- }
+ OnStatusBarBackgroundChange();
+ CluiProtocolStatusChanged(0,0);
+ return TRUE;
}
- break;
+ }
+ break;
}
return FALSE;
}
diff --git a/plugins/Clist_mw/src/resource.h b/plugins/Clist_mw/src/resource.h index 06c9b4c9df..5f7d9332d3 100644 --- a/plugins/Clist_mw/src/resource.h +++ b/plugins/Clist_mw/src/resource.h @@ -240,16 +240,10 @@ #define IDC_ALWAYSSTATUS 1103
#define IDC_NETSEARCH 1104
#define IDC_CONFIRMDELETE 1104
-#define IDC_EXTRA_PROTO 1104
#define IDC_SORTBYPROTO 1105
#define IDC_SHOWOPTIONS 1105
-#define IDC_EXTRA_EMAIL 1105
#define IDC_SEARCHURL 1106
-#define IDC_EXTRA_CELLULAR 1106
-#define IDC_EXTRA_ADV2 1107
#define IDC_BUILDTIME 1108
-#define IDC_EXTRA_ADV1 1108
-#define IDC_EXTRA_WEB 1109
#define IDC_NUMBER 1113
#define IDC_UIN 1123
#define IDC_TRANSPARENT 1124
@@ -599,7 +593,6 @@ #define IDC_CHECK1 1761
#define IDC_USECONNECTINGICON 1761
#define IDC_BKGRLIST 1762
-#define IDC_EXTRA_FRAME 1762
#define IDC_BC_STATIC 1763
#define IDC_SC_STATIC 1764
#define IDD_OPT_GENMENU 11267
|