diff options
Diffstat (limited to 'plugins/Clist_modern')
-rw-r--r-- | plugins/Clist_modern/src/hdr/modern_clist.h | 9 | ||||
-rw-r--r-- | plugins/Clist_modern/src/hdr/modern_clui.h | 1 | ||||
-rw-r--r-- | plugins/Clist_modern/src/hdr/modern_commonheaders.h | 13 | ||||
-rw-r--r-- | plugins/Clist_modern/src/hdr/modern_commonprototypes.h | 5 | ||||
-rw-r--r-- | plugins/Clist_modern/src/init.cpp | 15 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_aniavatars.cpp | 30 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_clcopts.cpp | 19 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_clistmod.cpp | 21 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_clisttray.cpp | 3 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_clui.cpp | 52 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_cluiframes.cpp | 35 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_docking.cpp | 17 | ||||
-rw-r--r-- | plugins/Clist_modern/src/modern_skinengine.cpp | 14 |
13 files changed, 57 insertions, 177 deletions
diff --git a/plugins/Clist_modern/src/hdr/modern_clist.h b/plugins/Clist_modern/src/hdr/modern_clist.h index 9e44332162..7a6d6c8489 100644 --- a/plugins/Clist_modern/src/hdr/modern_clist.h +++ b/plugins/Clist_modern/src/hdr/modern_clist.h @@ -30,15 +30,6 @@ HTREEITEM GetTreeItemByHContact(HANDLE hContact); void cli_ChangeContactIcon(HANDLE hContact,int iIcon,int add);
int GetContactInfosForSort(HANDLE hContact,char **Proto,TCHAR **Name,int *Status);
-typedef HMONITOR ( WINAPI *pfnMyMonitorFromPoint )(POINT,DWORD);
-extern pfnMyMonitorFromPoint MyMonitorFromPoint;
-
-typedef HMONITOR( WINAPI *pfnMyMonitorFromWindow) (HWND, DWORD);
-extern pfnMyMonitorFromWindow MyMonitorFromWindow;
-
-typedef BOOL(WINAPI *pfnMyGetMonitorInfo) (HMONITOR, LPMONITORINFO);
-extern pfnMyGetMonitorInfo MyGetMonitorInfo;
-
///////////////////////////////////////////////////////////////////////////////
class CSmileyString
diff --git a/plugins/Clist_modern/src/hdr/modern_clui.h b/plugins/Clist_modern/src/hdr/modern_clui.h index 0b978fb7c1..4360d183b7 100644 --- a/plugins/Clist_modern/src/hdr/modern_clui.h +++ b/plugins/Clist_modern/src/hdr/modern_clui.h @@ -180,7 +180,6 @@ private: protected:
HMODULE m_hDwmapiDll;
- HMODULE m_hUserDll;
enum { SNAPTOEDGESENSIVITY = 30 };
};
diff --git a/plugins/Clist_modern/src/hdr/modern_commonheaders.h b/plugins/Clist_modern/src/hdr/modern_commonheaders.h index ec22ca3692..ec2016e1c2 100644 --- a/plugins/Clist_modern/src/hdr/modern_commonheaders.h +++ b/plugins/Clist_modern/src/hdr/modern_commonheaders.h @@ -199,19 +199,6 @@ extern BOOL ske_ResetTextEffect(HDC hdc); extern BOOL ske_SelectTextEffect(HDC hdc, BYTE EffectID, DWORD FirstColor, DWORD SecondColor);
extern void IvalidateDisplayNameCache(DWORD mode);
-typedef BOOL (WINAPI *pfnTryEnterCriticalSection)( LPCRITICAL_SECTION );
-extern pfnTryEnterCriticalSection fnTryEnterCriticalSection;
-
-typedef BOOL (WINAPI *pfnGetScrollBarInfo)( HWND, LONG, PSCROLLBARINFO );
-extern pfnGetScrollBarInfo fnGetScrollBarInfo;
-
-typedef HWND (WINAPI *pfnGetAncestor)( HWND, UINT );
-extern pfnGetAncestor fnGetAncestor;
-HWND WINAPI MyGetAncestor( HWND, UINT );
-
-typedef BOOL (WINAPI *pfnGetMenuBarInfo)( HWND, LONG, LONG, PMENUBARINFO );
-extern pfnGetMenuBarInfo fnGetMenuBarInfo;
-
extern SortedList *clistCache;
HICON LoadSmallIcon(HINSTANCE hInstance, int idx);
diff --git a/plugins/Clist_modern/src/hdr/modern_commonprototypes.h b/plugins/Clist_modern/src/hdr/modern_commonprototypes.h index 26ef062251..66d0e6e2b3 100644 --- a/plugins/Clist_modern/src/hdr/modern_commonprototypes.h +++ b/plugins/Clist_modern/src/hdr/modern_commonprototypes.h @@ -315,10 +315,6 @@ ClcContact* cliCreateClcContact( void ); ClcCacheEntry* cliCreateCacheItem(HANDLE hContact);
ClcCacheEntry* cliGetCacheEntry(HANDLE hContact);
-// FUNCTION POINTERS
-extern BOOL (WINAPI *g_proc_UpdateLayeredWindow)(HWND,HDC,POINT*,SIZE*,HDC,POINT*,COLORREF,BLENDFUNCTION*,DWORD);
-extern BOOL (WINAPI *g_proc_SetLayeredWindowAttributesNew)(HWND,COLORREF,BYTE,DWORD);
-
#define WM_DWMCOMPOSITIONCHANGED 0x031E
#define DWM_BB_ENABLE 0x00000001
@@ -334,7 +330,6 @@ struct DWM_BLURBEHIND extern HRESULT (WINAPI *g_proc_DWMEnableBlurBehindWindow)(HWND hWnd, DWM_BLURBEHIND *pBlurBehind);
extern tPaintCallbackProc CLCPaint_PaintCallbackProc(HWND hWnd, HDC hDC, RECT *rcPaint, HRGN rgn, DWORD dFlags, void * CallBackData);
-extern BOOL (WINAPI *MySetProcessWorkingSetSize)(HANDLE,SIZE_T,SIZE_T);
/* SkinEngine.c */
diff --git a/plugins/Clist_modern/src/init.cpp b/plugins/Clist_modern/src/init.cpp index 876a3b3464..ba005f236a 100644 --- a/plugins/Clist_modern/src/init.cpp +++ b/plugins/Clist_modern/src/init.cpp @@ -41,12 +41,6 @@ int hLangpack; TIME_API tmi;
-pfnTryEnterCriticalSection fnTryEnterCriticalSection;
-
-pfnGetAncestor fnGetAncestor;
-pfnGetMenuBarInfo fnGetMenuBarInfo;
-pfnGetScrollBarInfo fnGetScrollBarInfo;
-
static HRESULT SubclassClistInterface();
static HRESULT CreateHookableEvents();
int EventArea_UnloadModule();
@@ -84,15 +78,6 @@ extern "C" __declspec(dllexport) int CListInitialise() mir_getLP( &pluginInfo );
mir_getTMI(&tmi);
- HMODULE hKernel = GetModuleHandleA("kernel32.dll");
- fnTryEnterCriticalSection = ( pfnTryEnterCriticalSection )GetProcAddress( hKernel, "TryEnterCriticalSection");
-
- HMODULE hUser = GetModuleHandleA("user32.dll");
- fnGetMenuBarInfo = ( pfnGetMenuBarInfo )GetProcAddress( hUser, "GetMenuBarInfo");
- fnGetScrollBarInfo = ( pfnGetScrollBarInfo )GetProcAddress( hUser, "GetScrollBarInfo");
- if (( fnGetAncestor = ( pfnGetAncestor )GetProcAddress( hUser, "GetAncestor")) == NULL )
- fnGetAncestor = MyGetAncestor;
-
g_dwMainThreadID = GetCurrentThreadId();
CHECKRES ( PreLoadContactListModule ( ) );
diff --git a/plugins/Clist_modern/src/modern_aniavatars.cpp b/plugins/Clist_modern/src/modern_aniavatars.cpp index a37aedb829..b54eed3821 100644 --- a/plugins/Clist_modern/src/modern_aniavatars.cpp +++ b/plugins/Clist_modern/src/modern_aniavatars.cpp @@ -349,7 +349,7 @@ void AniAva_UpdateParent() {
aacheck;
mir_cslock lck(s_CS);
- HWND parent = fnGetAncestor(pcli->hwndContactList, GA_PARENT);
+ HWND parent = GetAncestor(pcli->hwndContactList, GA_PARENT);
for (int i=0; i < s_Objects.getCount(); i++) {
ANIAVA_OBJECT * pai = (ANIAVA_OBJECT *)s_Objects[i];
SendMessage(pai->hWindow, AAM_SETPARENT, (WPARAM)parent,0);
@@ -399,7 +399,7 @@ int AniAva_SetAvatarPos(HANDLE hContact, RECT *rc, int overlayIdx, BYTE bAlpha) tszName = mir_a2t( szName );
hwnd = _AniAva_CreateAvatarWindowSync(tszName);
mir_free( tszName );
- parent = fnGetAncestor(pcli->hwndContactList,GA_PARENT);
+ parent = GetAncestor(pcli->hwndContactList, GA_PARENT);
pai->hWindow = hwnd;
SendMessage(hwnd,AAM_SETPARENT,(WPARAM)parent,0);
if (_AniAva_GetAvatarImageInfo(pai->dwAvatarUniqId,&avii))
@@ -814,14 +814,14 @@ static void _AniAva_RenderAvatar(ANIAVA_WINDOWINFO * dat, HDC hdcParent /*= NULL ske_AlphaBlend( hdcParent, rcInParent->left, rcInParent->top, szWnd.cx, szWnd.cy, copyFromDC, pt_from.x, pt_from.y, szWnd.cx, szWnd.cy, abf);
}
}
- else if ( !g_proc_UpdateLayeredWindow(dat->hWindow, hDC_animation, &ptWnd, &szWnd, copyFromDC, &pt_from, RGB(0, 0, 0), &bf, ULW_ALPHA )) {
+ else if ( !UpdateLayeredWindow(dat->hWindow, hDC_animation, &ptWnd, &szWnd, copyFromDC, &pt_from, RGB(0, 0, 0), &bf, ULW_ALPHA )) {
LONG exStyle;
exStyle = GetWindowLongPtr(dat->hWindow,GWL_EXSTYLE);
exStyle |= WS_EX_LAYERED;
SetWindowLongPtr(dat->hWindow,GWL_EXSTYLE,exStyle);
if ( !IMMEDIATE_DRAW )
SetWindowPos( pcli->hwndContactTree, dat->hWindow, 0, 0, 0, 0, SWP_ASYNCWINDOWPOS | SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOSENDCHANGING );
- g_proc_UpdateLayeredWindow(dat->hWindow, hDC_animation, &ptWnd, &szWnd, copyFromDC, &pt_from, RGB(0, 0, 0), &bf, ULW_ALPHA );
+ UpdateLayeredWindow(dat->hWindow, hDC_animation, &ptWnd, &szWnd, copyFromDC, &pt_from, RGB(0, 0, 0), &bf, ULW_ALPHA );
}
g_CluiData.fAeroGlass = false;
@@ -1081,25 +1081,3 @@ static LRESULT CALLBACK _AniAva_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR #undef aacheck
#undef aalock
#undef aaunlock
-
-/////////////////////////////////////////////////////////////////
-// some stub
-
-HWND WINAPI MyGetAncestor( HWND hWnd, UINT option )
-{
- if (option == GA_PARENT)
- return GetParent(hWnd);
-
- if (option == GA_ROOTOWNER) {
- HWND result = hWnd;
- while(true) {
- HWND hParent = GetParent(result);
- if (!hParent)
- return result;
-
- result = hParent;
- }
- }
-
- return NULL;
-}
diff --git a/plugins/Clist_modern/src/modern_clcopts.cpp b/plugins/Clist_modern/src/modern_clcopts.cpp index 451594269f..c37020b629 100644 --- a/plugins/Clist_modern/src/modern_clcopts.cpp +++ b/plugins/Clist_modern/src/modern_clcopts.cpp @@ -612,10 +612,7 @@ static INT_PTR CALLBACK DlgProcStatusBarBkgOpts(HWND hwndDlg, UINT msg, WPARAM w CheckDlgButton(hwndDlg,IDC_PROPORTIONAL,bmpUse&CLBF_PROPORTIONAL?BST_CHECKED:BST_UNCHECKED);
CheckDlgButton(hwndDlg,IDC_TILEVROWH,bmpUse&CLBF_TILEVTOROWHEIGHT?BST_CHECKED:BST_UNCHECKED);
- HRESULT (STDAPICALLTYPE *MySHAutoComplete)(HWND,DWORD);
- MySHAutoComplete = (HRESULT (STDAPICALLTYPE*)(HWND,DWORD))GetProcAddress(GetModuleHandle(_T("shlwapi")),"SHAutoComplete");
- if (MySHAutoComplete)
- MySHAutoComplete(GetDlgItem(hwndDlg,IDC_FILENAME),1);
+ SHAutoComplete(GetDlgItem(hwndDlg, IDC_FILENAME), 1);
}
return TRUE;
@@ -1204,8 +1201,8 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP CheckDlgButton(hwndDlg, IDC_DISABLEENGINE, db_get_b(NULL,"ModernData","DisableEngine", SETTING_DISABLESKIN_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
CheckDlgButton(hwndDlg, IDC_AEROGLASS, db_get_b(NULL,"ModernData","AeroGlass",SETTING_AEROGLASS_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
- EnableWindow(GetDlgItem(hwndDlg,IDC_LAYERENGINE),(g_proc_UpdateLayeredWindow != NULL && !db_get_b(NULL,"ModernData","DisableEngine", SETTING_DISABLESKIN_DEFAULT))?TRUE:FALSE);
- CheckDlgButton(hwndDlg, IDC_LAYERENGINE, (( db_get_b(NULL,"ModernData","EnableLayering",SETTING_ENABLELAYERING_DEFAULT) && g_proc_UpdateLayeredWindow != NULL) && !db_get_b(NULL,"ModernData","DisableEngine", SETTING_DISABLESKIN_DEFAULT)) ? BST_UNCHECKED:BST_CHECKED);
+ EnableWindow(GetDlgItem(hwndDlg,IDC_LAYERENGINE), !db_get_b(NULL,"ModernData","DisableEngine", SETTING_DISABLESKIN_DEFAULT) ? TRUE : FALSE);
+ CheckDlgButton(hwndDlg, IDC_LAYERENGINE, (db_get_b(NULL,"ModernData","EnableLayering",SETTING_ENABLELAYERING_DEFAULT) && !db_get_b(NULL,"ModernData","DisableEngine", SETTING_DISABLESKIN_DEFAULT)) ? BST_UNCHECKED:BST_CHECKED);
{
DBVARIANT dbv = {0};
@@ -1281,7 +1278,7 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP EnableWindow(GetDlgItem(hwndDlg,IDC_ROUNDCORNERS),fEnabled);
if (LOWORD(wParam) == IDC_DISABLEENGINE)
{
- EnableWindow(GetDlgItem(hwndDlg,IDC_LAYERENGINE),!IsDlgButtonChecked(hwndDlg,IDC_DISABLEENGINE) && g_proc_UpdateLayeredWindow != NULL);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_LAYERENGINE), !IsDlgButtonChecked(hwndDlg, IDC_DISABLEENGINE));
if (IsDlgButtonChecked(hwndDlg,IDC_DISABLEENGINE))
CheckDlgButton(hwndDlg,IDC_LAYERENGINE,BST_CHECKED);
}
@@ -1340,7 +1337,7 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP db_set_b(NULL,"ModernData","AeroGlass",IsDlgButtonChecked(hwndDlg,IDC_AEROGLASS));
if ( !IsDlgButtonChecked(hwndDlg,IDC_DISABLEENGINE))
{
- if (g_proc_UpdateLayeredWindow != NULL && IsDlgButtonChecked(hwndDlg,IDC_LAYERENGINE))
+ if (IsDlgButtonChecked(hwndDlg,IDC_LAYERENGINE))
db_set_b(NULL,"ModernData","EnableLayering",0);
else
db_unset(NULL,"ModernData","EnableLayering");
@@ -1504,11 +1501,7 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, }
SendMessage(hList, CB_SETCURSEL, 0, 0);
PostMessage(hwndDlg, WM_COMMAND, MAKEWPARAM(IDC_BKGRLIST, CBN_SELCHANGE), 0);
- {
- HRESULT (STDAPICALLTYPE *MySHAutoComplete)(HWND,DWORD);
- MySHAutoComplete = (HRESULT (STDAPICALLTYPE*)(HWND,DWORD))GetProcAddress(GetModuleHandleA("shlwapi"),"SHAutoComplete");
- if (MySHAutoComplete) MySHAutoComplete(GetDlgItem(hwndDlg,IDC_FILENAME),1);
- }
+ SHAutoComplete(GetDlgItem(hwndDlg, IDC_FILENAME), 1);
return TRUE;
}
case WM_DESTROY:
diff --git a/plugins/Clist_modern/src/modern_clistmod.cpp b/plugins/Clist_modern/src/modern_clistmod.cpp index 7e776c9ecf..1dbb54c006 100644 --- a/plugins/Clist_modern/src/modern_clistmod.cpp +++ b/plugins/Clist_modern/src/modern_clistmod.cpp @@ -27,10 +27,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "hdr/modern_clui.h"
#include <m_modernopt.h>
-pfnMyMonitorFromPoint MyMonitorFromPoint = NULL;
-pfnMyMonitorFromWindow MyMonitorFromWindow = NULL;
-pfnMyGetMonitorInfo MyGetMonitorInfo = NULL;
-
int OnLoadLangpack(WPARAM, LPARAM);
int CListMod_HideWindow(HWND hwndContactList, int mode);
@@ -53,8 +49,6 @@ void UninitTrayMenu(); HIMAGELIST hCListImages = NULL;
-BOOL (WINAPI *MySetProcessWorkingSetSize)(HANDLE,SIZE_T,SIZE_T);
-
//returns normal icon or combined with status overlay. Needs to be destroyed.
HICON cliGetIconFromStatusMode(HANDLE hContact, const char *szProto,int status)
{
@@ -186,16 +180,6 @@ HRESULT CluiLoadModule() CreateServiceFunction(MS_CLIST_TOGGLESOUNDS,ToggleSounds);
CreateServiceFunction(MS_CLIST_SETUSEGROUPS,SetUseGroups);
- MySetProcessWorkingSetSize = (BOOL (WINAPI*)(HANDLE,SIZE_T,SIZE_T))GetProcAddress(GetModuleHandle(_T("kernel32")),"SetProcessWorkingSetSize");
- hCListImages = ImageList_Create(16, 16, ILC_MASK|ILC_COLOR32, 32, 0);
- InitCustomMenus();
- InitTray();
-
- HINSTANCE hUser = GetModuleHandleA("USER32");
- MyMonitorFromPoint = ( pfnMyMonitorFromPoint )GetProcAddress( hUser,"MonitorFromPoint");
- MyMonitorFromWindow = ( pfnMyMonitorFromWindow )GetProcAddress( hUser, "MonitorFromWindow");
- MyGetMonitorInfo = ( pfnMyGetMonitorInfo )GetProcAddress( hUser, "GetMonitorInfoW");
-
CLUI::InitClui();
return S_OK;
}
@@ -318,7 +302,7 @@ int GetWindowVisibleState(HWND hWnd, int iStepX, int iStepY) }
//hAux = GetParent(hAux);
hAuxOld = hAux;
- hAux = fnGetAncestor(hAux,GA_ROOTOWNER);
+ hAux = GetAncestor(hAux, GA_ROOTOWNER);
if (hAuxOld == hAux)
{
TCHAR buf[255];
@@ -431,8 +415,7 @@ int cliShowHide(WPARAM wParam,LPARAM lParam) }
}
- if (MySetProcessWorkingSetSize != NULL)
- MySetProcessWorkingSetSize(GetCurrentProcess(),-1,-1);
+ SetProcessWorkingSetSize(GetCurrentProcess(),-1,-1);
}
return 0;
}
diff --git a/plugins/Clist_modern/src/modern_clisttray.cpp b/plugins/Clist_modern/src/modern_clisttray.cpp index 9a6fc3ad05..35bdc19ac3 100644 --- a/plugins/Clist_modern/src/modern_clisttray.cpp +++ b/plugins/Clist_modern/src/modern_clisttray.cpp @@ -303,8 +303,7 @@ static VOID CALLBACK TrayIconAutoHideTimer(HWND hwnd,UINT message,UINT_PTR idEve if (CLUI_CheckOwnedByClui(ActiveWindow)) return;
CListMod_HideWindow(hwndClui, SW_HIDE);
- if (MySetProcessWorkingSetSize != NULL)
- MySetProcessWorkingSetSize(GetCurrentProcess(),-1,-1);
+ SetProcessWorkingSetSize(GetCurrentProcess(),-1,-1);
}
int cliTrayIconPauseAutoHide(WPARAM wParam,LPARAM lParam)
diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp index 8b3084e3aa..c86934b64c 100644 --- a/plugins/Clist_modern/src/modern_clui.cpp +++ b/plugins/Clist_modern/src/modern_clui.cpp @@ -57,8 +57,6 @@ BOOL g_flag_bOnModulesLoadedCalled = FALSE; RECT g_rcEdgeSizingRect={0};
-BOOL (WINAPI *g_proc_SetLayeredWindowAttributesNew)(HWND,COLORREF,BYTE,DWORD);
-
/* Module global variables */
static BYTE bAlphaEnd;
@@ -290,7 +288,6 @@ HRESULT CLUI::CreateCluiFrames() }
CLUI::CLUI() :
- m_hUserDll( NULL ),
m_hDwmapiDll( NULL )
{
m_pCLUI = this;
@@ -323,22 +320,15 @@ CLUI::CLUI() : CLUI::~CLUI()
{
- FreeLibrary(m_hUserDll);
FreeLibrary(m_hDwmapiDll);
m_pCLUI = NULL;
}
HRESULT CLUI::LoadDllsRuntime()
{
- m_hUserDll = LoadLibrary(_T("user32.dll"));
- if (m_hUserDll) {
- g_proc_UpdateLayeredWindow = (BOOL (WINAPI *)(HWND,HDC,POINT*,SIZE*,HDC,POINT*,COLORREF,BLENDFUNCTION*,DWORD))GetProcAddress(m_hUserDll, "UpdateLayeredWindow");
- g_proc_SetLayeredWindowAttributesNew = (BOOL (WINAPI *)(HWND,COLORREF,BYTE,DWORD))GetProcAddress(m_hUserDll, "SetLayeredWindowAttributes");
-
- g_CluiData.fLayered = (g_proc_UpdateLayeredWindow != NULL) && !db_get_b(NULL,"ModernData","DisableEngine", SETTING_DISABLESKIN_DEFAULT);
- g_CluiData.fSmoothAnimation = db_get_b(NULL, "CLUI", "FadeInOut", SETTING_FADEIN_DEFAULT);
- g_CluiData.fLayered = (g_CluiData.fLayered*db_get_b(NULL, "ModernData", "EnableLayering", g_CluiData.fLayered)) && !db_get_b(NULL,"ModernData","DisableEngine", SETTING_DISABLESKIN_DEFAULT);
- }
+ g_CluiData.fLayered = !db_get_b(NULL,"ModernData","DisableEngine", SETTING_DISABLESKIN_DEFAULT);
+ g_CluiData.fSmoothAnimation = db_get_b(NULL, "CLUI", "FadeInOut", SETTING_FADEIN_DEFAULT);
+ g_CluiData.fLayered = (g_CluiData.fLayered*db_get_b(NULL, "ModernData", "EnableLayering", g_CluiData.fLayered)) && !db_get_b(NULL,"ModernData","DisableEngine", SETTING_DISABLESKIN_DEFAULT);
if ( IsWinVerVistaPlus()) {
m_hDwmapiDll = LoadLibrary(_T("dwmapi.dll"));
@@ -470,15 +460,11 @@ HRESULT CLUI::CreateCLC() HRESULT CLUI::SnappingToEdge( WINDOWPOS *lpWindowPos )
{
- //by ZORG
- if ( MyMonitorFromWindow == NULL || MyGetMonitorInfo == NULL )
- return S_FALSE;
-
if ( db_get_b(NULL, "CLUI", "SnapToEdges", SETTING_SNAPTOEDGES_DEFAULT)) {
- HMONITOR curMonitor = MyMonitorFromWindow(m_hWnd, MONITOR_DEFAULTTONEAREST);
+ HMONITOR curMonitor = MonitorFromWindow(m_hWnd, MONITOR_DEFAULTTONEAREST);
MONITORINFO monInfo;
monInfo.cbSize = sizeof(monInfo);
- MyGetMonitorInfo(curMonitor, &monInfo);
+ GetMonitorInfo(curMonitor, &monInfo);
RECT* dr = &(monInfo.rcWork);
@@ -524,7 +510,7 @@ BOOL CLUI_CheckOwnedByClui(HWND hWnd) return FALSE;
HWND hWndClui = pcli->hwndContactList;
- HWND hWndMid = fnGetAncestor(hWnd,GA_ROOTOWNER);
+ HWND hWndMid = GetAncestor(hWnd, GA_ROOTOWNER);
if (hWndMid == hWndClui)
return TRUE;
@@ -1153,9 +1139,6 @@ static int CLUI_DrawMenuBackGround(HWND hwnd, HDC hdc, int item, int state) RECT ra,r1;
HRGN treg,treg2;
- if ( !fnGetMenuBarInfo )
- return 1;
-
ClcData *dat = (ClcData*)GetWindowLongPtr(pcli->hwndContactTree,0);
if ( !dat)
return 1;
@@ -1163,7 +1146,7 @@ static int CLUI_DrawMenuBackGround(HWND hwnd, HDC hdc, int item, int state) GetWindowRect(hwnd, &ra);
MENUBARINFO mbi = { sizeof(MENUBARINFO) };
- fnGetMenuBarInfo(hwnd,OBJID_MENU, 0, &mbi);
+ GetMenuBarInfo(hwnd, OBJID_MENU, 0, &mbi);
if ( !(mbi.rcBar.right-mbi.rcBar.left > 0 && mbi.rcBar.bottom-mbi.rcBar.top > 0))
return 1;
@@ -1173,7 +1156,7 @@ static int CLUI_DrawMenuBackGround(HWND hwnd, HDC hdc, int item, int state) treg = CreateRectRgn(mbi.rcBar.left,mbi.rcBar.top,mbi.rcBar.right,r1.bottom);
if (item == 0) { //should remove item clips
for (int t = 1; t <= 2; t++) {
- fnGetMenuBarInfo(hwnd,OBJID_MENU, t, &mbi);
+ GetMenuBarInfo(hwnd, OBJID_MENU, t, &mbi);
treg2 = CreateRectRgn(mbi.rcBar.left,mbi.rcBar.top,mbi.rcBar.right,mbi.rcBar.bottom);
CombineRgn(treg,treg,treg2,RGN_DIFF);
DeleteObject(treg2);
@@ -1181,7 +1164,7 @@ static int CLUI_DrawMenuBackGround(HWND hwnd, HDC hdc, int item, int state) }
}
else {
- fnGetMenuBarInfo(hwnd,OBJID_MENU, item, &mbi);
+ GetMenuBarInfo(hwnd, OBJID_MENU, item, &mbi);
treg = CreateRectRgn(mbi.rcBar.left,mbi.rcBar.top,mbi.rcBar.right,mbi.rcBar.bottom+!db_get_b(NULL,"CLUI","LineUnderMenu",SETTING_LINEUNDERMENU_DEFAULT));
}
OffsetRgn(treg,-ra.left,-ra.top);
@@ -1524,8 +1507,8 @@ static int CLUI_SmoothAlphaThreadTransition(HWND hwnd) int CLUI_SmoothAlphaTransition(HWND hwnd, BYTE GoalAlpha, BOOL wParam)
{
- if ((!g_CluiData.fLayered
- && (!g_CluiData.fSmoothAnimation && !g_bTransparentFlag)) || !g_proc_SetLayeredWindowAttributesNew)
+ if (!g_CluiData.fLayered
+ && (!g_CluiData.fSmoothAnimation && !g_bTransparentFlag))
{
if (GoalAlpha>0 && wParam != 2)
{
@@ -1919,8 +1902,7 @@ LRESULT CLUI::OnSizingMoving(UINT msg, WPARAM wParam, LPARAM lParam) db_set_b(NULL,"CList","State",SETTING_STATE_HIDDEN);
}
else db_set_b(NULL,"CList","State",SETTING_STATE_MINIMIZED);
- if (MySetProcessWorkingSetSize != NULL)
- MySetProcessWorkingSetSize(GetCurrentProcess(),-1,-1);
+ SetProcessWorkingSetSize(GetCurrentProcess(),-1,-1);
}
return TRUE;
@@ -2487,12 +2469,10 @@ LRESULT CLUI::OnListSizeChangeNotify( NMCLISTCONTROL * pnmc ) winstyle = GetWindowLongPtr(pcli->hwndContactTree,GWL_STYLE);
SystemParametersInfo(SPI_GETWORKAREA, 0, &rcWorkArea,FALSE);
- if (MyMonitorFromWindow) {
- HMONITOR hMon = MyMonitorFromWindow(pcli->hwndContactTree, MONITOR_DEFAULTTONEAREST);
- MONITORINFO mi = { sizeof(mi) };
- if (MyGetMonitorInfo(hMon, &mi))
- rcWorkArea = mi.rcWork;
- }
+ HMONITOR hMon = MonitorFromWindow(pcli->hwndContactTree, MONITOR_DEFAULTTONEAREST);
+ MONITORINFO mi = { sizeof(mi) };
+ if (GetMonitorInfo(hMon, &mi))
+ rcWorkArea = mi.rcWork;
if (pnmc->pt.y>(rcWorkArea.bottom-rcWorkArea.top))
pnmc->pt.y = (rcWorkArea.bottom-rcWorkArea.top);
diff --git a/plugins/Clist_modern/src/modern_cluiframes.cpp b/plugins/Clist_modern/src/modern_cluiframes.cpp index eda033938d..bce3cc73a3 100644 --- a/plugins/Clist_modern/src/modern_cluiframes.cpp +++ b/plugins/Clist_modern/src/modern_cluiframes.cpp @@ -145,28 +145,25 @@ int SetAlpha(BYTE Alpha) if ( !g_pfwFrames[i].floating && g_pfwFrames[i].OwnerWindow != NULL && g_pfwFrames[i].OwnerWindow != (HWND)-2 && g_pfwFrames[i].visible && !g_pfwFrames[i].needhide )
{
HWND hwnd = g_pfwFrames[i].OwnerWindow;
- if (g_proc_SetLayeredWindowAttributesNew)
+ long l;
+ l = GetWindowLongPtr(hwnd,GWL_EXSTYLE);
+ if ( !(l&WS_EX_LAYERED))
{
- long l;
- l = GetWindowLongPtr(hwnd,GWL_EXSTYLE);
- if ( !(l&WS_EX_LAYERED))
+ HWND parent = NULL;
+ if (g_CluiData.fOnDesktop)
{
- HWND parent = NULL;
- if (g_CluiData.fOnDesktop)
- {
- HWND hProgMan = FindWindow(_T("Progman"),NULL);
- if (IsWindow(hProgMan))
- parent = hProgMan;
- }
-
- CLUI_ShowWindowMod(hwnd,SW_HIDE);
- SetParent(hwnd,NULL);
- SetWindowLongPtr(hwnd,GWL_EXSTYLE,l|WS_EX_LAYERED);
- SetParent(hwnd,parent);
- if (l&WS_VISIBLE) CLUI_ShowWindowMod(hwnd,SW_SHOW);
+ HWND hProgMan = FindWindow(_T("Progman"),NULL);
+ if (IsWindow(hProgMan))
+ parent = hProgMan;
}
- g_proc_SetLayeredWindowAttributesNew(hwnd, g_CluiData.dwKeyColor,Alpha, LWA_ALPHA|LWA_COLORKEY);
+
+ CLUI_ShowWindowMod(hwnd,SW_HIDE);
+ SetParent(hwnd,NULL);
+ SetWindowLongPtr(hwnd,GWL_EXSTYLE,l|WS_EX_LAYERED);
+ SetParent(hwnd,parent);
+ if (l&WS_VISIBLE) CLUI_ShowWindowMod(hwnd,SW_SHOW);
}
+ SetLayeredWindowAttributes(hwnd, g_CluiData.dwKeyColor,Alpha, LWA_ALPHA|LWA_COLORKEY);
}
}
AniAva_RedrawAllAvatars(FALSE);
@@ -3520,7 +3517,7 @@ static LRESULT CALLBACK CLUIFrameSubContainerProc(HWND hwnd, UINT msg, WPARAM wP static HWND CreateSubContainerWindow(HWND parent,int x,int y,int width,int height)
{
HWND hwnd;
- hwnd = CreateWindowEx(g_proc_SetLayeredWindowAttributesNew ? WS_EX_LAYERED:0, CLUIFrameSubContainerClassName,_T("SubContainerWindow"),WS_POPUP|(!g_CluiData.fLayered ? WS_BORDER : 0),x,y,width,height,parent, 0, g_hInst,0);
+ hwnd = CreateWindowEx(WS_EX_LAYERED, CLUIFrameSubContainerClassName,_T("SubContainerWindow"),WS_POPUP|(!g_CluiData.fLayered ? WS_BORDER : 0),x,y,width,height,parent, 0, g_hInst,0);
SetWindowLongPtr(hwnd,GWL_STYLE,GetWindowLongPtr(hwnd,GWL_STYLE)&~(WS_CAPTION|WS_BORDER));
if (g_CluiData.fOnDesktop)
{
diff --git a/plugins/Clist_modern/src/modern_docking.cpp b/plugins/Clist_modern/src/modern_docking.cpp index 08036e2669..616c7af1c1 100644 --- a/plugins/Clist_modern/src/modern_docking.cpp +++ b/plugins/Clist_modern/src/modern_docking.cpp @@ -42,19 +42,14 @@ static int dock_drag_dy = 0; static void Docking_GetMonitorRectFromPoint(POINT pt,RECT *rc)
{
- HMODULE hUserInstance = GetModuleHandle(_T("user32"));
+ MONITORINFO monitorInfo;
+ HMONITOR hMonitor = MonitorFromPoint(pt,MONITOR_DEFAULTTONEAREST); // always returns a valid value
+ monitorInfo.cbSize = sizeof(MONITORINFO);
- if ( MyMonitorFromPoint )
+ if (GetMonitorInfo(hMonitor, &monitorInfo))
{
- MONITORINFO monitorInfo;
- HMONITOR hMonitor = MyMonitorFromPoint(pt,MONITOR_DEFAULTTONEAREST); // always returns a valid value
- monitorInfo.cbSize = sizeof(MONITORINFO);
-
- if ( MyGetMonitorInfo(hMonitor,&monitorInfo))
- {
- CopyMemory(rc,&monitorInfo.rcMonitor,sizeof(RECT));
- return;
- }
+ CopyMemory(rc,&monitorInfo.rcMonitor,sizeof(RECT));
+ return;
}
// "generic" win95/NT support, also serves as failsafe
diff --git a/plugins/Clist_modern/src/modern_skinengine.cpp b/plugins/Clist_modern/src/modern_skinengine.cpp index e270ee4ba9..960b5293a4 100644 --- a/plugins/Clist_modern/src/modern_skinengine.cpp +++ b/plugins/Clist_modern/src/modern_skinengine.cpp @@ -42,8 +42,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. SKINOBJECTSLIST g_SkinObjectList = {0};
CURRWNDIMAGEDATA * g_pCachedWindow = NULL;
-BOOL (WINAPI *g_proc_UpdateLayeredWindow)(HWND,HDC,POINT*,SIZE*,HDC,POINT*,COLORREF,BLENDFUNCTION*,DWORD);
-
BOOL g_flag_bPostWasCanceled = FALSE;
BOOL g_flag_bFullRepaint = FALSE;
BOOL g_mutex_bLockUpdating = FALSE;
@@ -3543,7 +3541,7 @@ static int ske_ValidateSingleFrameImage(FRAMEWND * Frame, BOOL SkipBkgBlitting) //MyAlphaBlend(g_pCachedWindow->hImageDC,x+x1,y+y1,w1,h1,hdc,x1,y1,w1,h1,bf);
}
- if ( fnGetScrollBarInfo && (GetWindowLongPtr(Frame->hWnd,GWL_STYLE) & WS_VSCROLL))
+ if (GetWindowLongPtr(Frame->hWnd,GWL_STYLE) & WS_VSCROLL)
{
//Draw vertical scroll bar
//
@@ -3554,7 +3552,7 @@ static int ske_ValidateSingleFrameImage(FRAMEWND * Frame, BOOL SkipBkgBlitting) int dx,dy;
SCROLLBARINFO si = {0};
si.cbSize = sizeof(SCROLLBARINFO);
- fnGetScrollBarInfo(Frame->hWnd,OBJID_VSCROLL,&si);
+ GetScrollBarInfo(Frame->hWnd, OBJID_VSCROLL, &si);
rLine = (si.rcScrollBar);
rUpBtn = rLine;
rDnBtn = rLine;
@@ -3841,10 +3839,10 @@ void ske_ApplyTransluency() IsTransparancy = g_CluiData.fSmoothAnimation || g_bTransparentFlag;
if ( !g_bTransparentFlag && !g_CluiData.fSmoothAnimation && g_CluiData.bCurrentAlpha != 0)
g_CluiData.bCurrentAlpha = 255;
- if ( !g_CluiData.fLayered && (/*(g_CluiData.bCurrentAlpha == 255) || */(g_proc_SetLayeredWindowAttributesNew && IsTransparancy)))
+ if ( !g_CluiData.fLayered && IsTransparancy)
{
if ( !layered) SetWindowLongPtr(hwnd, GWL_EXSTYLE, GetWindowLongPtr(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED);
- if (g_proc_SetLayeredWindowAttributesNew) g_proc_SetLayeredWindowAttributesNew(hwnd, RGB(0, 0, 0), (BYTE)g_CluiData.bCurrentAlpha, LWA_ALPHA);
+ SetLayeredWindowAttributes(hwnd, RGB(0, 0, 0), (BYTE)g_CluiData.bCurrentAlpha, LWA_ALPHA);
}
AniAva_RedrawAllAvatars(FALSE);
@@ -3884,13 +3882,13 @@ int ske_JustUpdateWindowImageRect(RECT *rty) dest.y = rect.top;
sz.cx = rect.right-rect.left;
sz.cy = rect.bottom-rect.top;
- if (g_proc_UpdateLayeredWindow && g_CluiData.fLayered)
+ if (g_CluiData.fLayered)
{
if ( !(GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE)&WS_EX_LAYERED))
SetWindowLongPtr(pcli->hwndContactList,GWL_EXSTYLE, GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE) |WS_EX_LAYERED);
Sync( SetAlpha, g_CluiData.bCurrentAlpha );
- res = g_proc_UpdateLayeredWindow(pcli->hwndContactList,g_pCachedWindow->hScreenDC,&dest,&sz,g_pCachedWindow->hImageDC,&src,RGB(1,1,1),&bf,ULW_ALPHA);
+ res = UpdateLayeredWindow(pcli->hwndContactList,g_pCachedWindow->hScreenDC,&dest,&sz,g_pCachedWindow->hImageDC,&src,RGB(1,1,1),&bf,ULW_ALPHA);
g_CluiData.fAeroGlass = false;
CLUI_UpdateAeroGlass();
}
|