diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2013-09-22 17:14:55 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2013-09-22 17:14:55 +0000 |
commit | d8967087af559a43f1801e3e89411d570cbb3110 (patch) | |
tree | b6596526a66c1aa8b80bab769cc7fd5472b327a8 /plugins/FloatingContacts/src | |
parent | d867e44172947b51b34d60a672673dffd771a304 (diff) |
plugins cleanup
git-svn-id: http://svn.miranda-ng.org/main/trunk@6185 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/FloatingContacts/src')
-rw-r--r-- | plugins/FloatingContacts/src/fltcont.h | 9 | ||||
-rw-r--r-- | plugins/FloatingContacts/src/main.cpp | 22 | ||||
-rw-r--r-- | plugins/FloatingContacts/src/options.cpp | 7 | ||||
-rw-r--r-- | plugins/FloatingContacts/src/stdhdr.h | 1 | ||||
-rw-r--r-- | plugins/FloatingContacts/src/thumbs.cpp | 27 |
5 files changed, 14 insertions, 52 deletions
diff --git a/plugins/FloatingContacts/src/fltcont.h b/plugins/FloatingContacts/src/fltcont.h index d854e8083e..c4e98ab498 100644 --- a/plugins/FloatingContacts/src/fltcont.h +++ b/plugins/FloatingContacts/src/fltcont.h @@ -130,12 +130,6 @@ FCOptions; extern FCOptions fcOpt;
-extern BOOL (WINAPI *pSetLayeredWindowAttributes)(HWND,COLORREF,BYTE,DWORD);
-extern BOOL (WINAPI *pUpdateLayeredWindow)
- (HWND hwnd, HDC hdcDST, POINT *pptDst, SIZE *psize, HDC hdcSrc, POINT *pptSrc,
- COLORREF crKey, BLENDFUNCTION *pblend, DWORD dwFlags);
-
-
/////////////////////////////////////////////////////////////////////////////
static __forceinline BOOL ImageList_GetIconSize_my(HIMAGELIST himl, SIZE &sz)
@@ -164,9 +158,6 @@ int OnOptionsInitialize(WPARAM wParam, LPARAM lParam); /////////////////////////////////////////////////////////////////////////////
-typedef HRESULT (STDAPICALLTYPE *pfnSHAutoComplete)(HWND,DWORD);
-extern pfnSHAutoComplete fnSHAutoComplete;
-
#endif // #ifndef __FLTCONT_H__
/////////////////////////////////////////////////////////////////////////////
diff --git a/plugins/FloatingContacts/src/main.cpp b/plugins/FloatingContacts/src/main.cpp index 4dbb233dd1..ec0e266b33 100644 --- a/plugins/FloatingContacts/src/main.cpp +++ b/plugins/FloatingContacts/src/main.cpp @@ -18,11 +18,6 @@ No warranty for any misbehaviour. #include "../Utils/mir_fonts.h"
-BOOL (WINAPI *pSetLayeredWindowAttributes)(HWND, COLORREF, BYTE, DWORD);
-BOOL (WINAPI *pUpdateLayeredWindow)
- (HWND hwnd, HDC hdcDST, POINT *pptDst, SIZE *psize, HDC hdcSrc, POINT *pptSrc,
- COLORREF crKey, BLENDFUNCTION *pblend, DWORD dwFlags);
-
// Globals
// TODO: move to some more approriate place, probably part of Thumbs manager
@@ -73,8 +68,6 @@ HGENMENU hMenuItemRemove, hMenuItemHideAll, hMainMenuItemHideAll; int hLangpack;
CLIST_INTERFACE *pcli;
-pfnSHAutoComplete fnSHAutoComplete;
-
//Options
FCOptions fcOpt = {0};
@@ -960,21 +953,6 @@ extern "C" int __declspec(dllexport) Load() HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoded);
HookEvent(ME_SYSTEM_PRESHUTDOWN, OnPreshutdown);
- HMODULE hUserDll = GetModuleHandleA("user32.dll");
- if (hUserDll) {
- pSetLayeredWindowAttributes =
- (BOOL (WINAPI *)(HWND, COLORREF, BYTE, DWORD))
- GetProcAddress(hUserDll, "SetLayeredWindowAttributes");
- pUpdateLayeredWindow =
- (BOOL (WINAPI *)(HWND, HDC, POINT *, SIZE *, HDC, POINT *, COLORREF, BLENDFUNCTION *, DWORD))
- GetProcAddress(hUserDll, "UpdateLayeredWindow");
- }
- else {
- pSetLayeredWindowAttributes = NULL;
- pUpdateLayeredWindow = NULL;
- }
-
- fnSHAutoComplete = (pfnSHAutoComplete)GetProcAddress(GetModuleHandle(_T("shlwapi")), "SHAutoComplete");
return 0;
}
diff --git a/plugins/FloatingContacts/src/options.cpp b/plugins/FloatingContacts/src/options.cpp index c28b3c767f..cd910b224d 100644 --- a/plugins/FloatingContacts/src/options.cpp +++ b/plugins/FloatingContacts/src/options.cpp @@ -192,8 +192,7 @@ static INT_PTR APIENTRY OptSknWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP CheckDlgButton(hwndDlg, IDC_TILEV, ((bmpUse & CLBF_TILEV) ? BST_CHECKED : BST_UNCHECKED));
CheckDlgButton(hwndDlg, IDC_PROPORTIONAL, ((bmpUse & CLBF_PROPORTIONAL) ? BST_CHECKED : BST_UNCHECKED));
- if (fnSHAutoComplete)
- fnSHAutoComplete(GetDlgItem(hwndDlg, IDC_FILENAME), 1);
+ SHAutoComplete(GetDlgItem(hwndDlg, IDC_FILENAME), 1);
// Windows 2K/XP
BYTE btOpacity = (BYTE)db_get_b(NULL, MODULE, "Opacity", 100);
@@ -203,8 +202,8 @@ static INT_PTR APIENTRY OptSknWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP mir_snprintf(szPercent, SIZEOF(szPercent), "%d%%", btOpacity);
SetDlgItemTextA(hwndDlg, IDC_OPACITY, szPercent);
- EnableWindow(GetDlgItem(hwndDlg, IDC_SLIDER_OPACITY), pSetLayeredWindowAttributes != 0);
- EnableWindow(GetDlgItem(hwndDlg, IDC_OPACITY), pSetLayeredWindowAttributes != 0);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_SLIDER_OPACITY), SetLayeredWindowAttributes != 0);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_OPACITY), SetLayeredWindowAttributes != 0);
}
return TRUE;
diff --git a/plugins/FloatingContacts/src/stdhdr.h b/plugins/FloatingContacts/src/stdhdr.h index c7a46e6f56..e5d1b328a2 100644 --- a/plugins/FloatingContacts/src/stdhdr.h +++ b/plugins/FloatingContacts/src/stdhdr.h @@ -7,6 +7,7 @@ #include <windows.h>
#include <assert.h>
#include <math.h>
+#include <Shlwapi.h>
#include <newpluginapi.h>
#include <m_system_cpp.h>
diff --git a/plugins/FloatingContacts/src/thumbs.cpp b/plugins/FloatingContacts/src/thumbs.cpp index 180637b9f5..ae14979ff0 100644 --- a/plugins/FloatingContacts/src/thumbs.cpp +++ b/plugins/FloatingContacts/src/thumbs.cpp @@ -470,7 +470,7 @@ void ThumbInfo::ThumbDeselect(BOOL bMouse) void ThumbInfo::SetThumbOpacity(BYTE bAlpha)
{
- if (pUpdateLayeredWindow && (bAlpha != btAlpha)) {
+ if (bAlpha != btAlpha) {
btAlpha = bAlpha;
UpdateContent();
}
@@ -673,25 +673,18 @@ void ThumbInfo::UpdateContent() SetTextColor(hdcDraw, oldColor);
SetBkMode(hdcDraw, oldBkMode);
- if (pUpdateLayeredWindow) {
- SetWindowLongPtr( hwnd, GWL_EXSTYLE, GetWindowLongPtr(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED );
+ SetWindowLongPtr( hwnd, GWL_EXSTYLE, GetWindowLongPtr(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED );
- RECT rc; GetWindowRect(hwnd, &rc);
- POINT ptDst = {rc.left, rc.top};
- POINT ptSrc = {0, 0};
+ GetWindowRect(hwnd, &rc);
+ POINT ptDst = {rc.left, rc.top};
+ POINT ptSrc = {0, 0};
- BLENDFUNCTION blend;
- blend.BlendOp = AC_SRC_OVER;
- blend.BlendFlags = 0;
- blend.SourceConstantAlpha = 255;
- blend.AlphaFormat = AC_SRC_ALPHA;
+ blend.BlendOp = AC_SRC_OVER;
+ blend.BlendFlags = 0;
+ blend.SourceConstantAlpha = 255;
+ blend.AlphaFormat = AC_SRC_ALPHA;
- pUpdateLayeredWindow(hwnd, NULL, &ptDst, &szSize, bmpContent.getDC(), &ptSrc, 0xffffffff, &blend, ULW_ALPHA);
- }
- else {
- RedrawWindow(hwnd, NULL, NULL, RDW_INVALIDATE);
- UpdateWindow(hwnd);
- }
+ UpdateLayeredWindow(hwnd, NULL, &ptDst, &szSize, bmpContent.getDC(), &ptSrc, 0xffffffff, &blend, ULW_ALPHA);
}
void ThumbInfo::PopupMessageDialog( )
|