diff options
Diffstat (limited to 'yapp')
-rw-r--r-- | yapp/popwin.cpp | 100 | ||||
-rw-r--r-- | yapp/version.h | 2 |
2 files changed, 53 insertions, 49 deletions
diff --git a/yapp/popwin.cpp b/yapp/popwin.cpp index cb20dc1..4f9c5a3 100644 --- a/yapp/popwin.cpp +++ b/yapp/popwin.cpp @@ -26,7 +26,7 @@ void SetStartValues() { MONITORINFO mi;
mi.cbSize = sizeof(mi);
- GetMonitorInfo(hMonitor, &mi);
+ MyGetMonitorInfo(hMonitor, &mi);
wa_rect = mi.rcWork;
@@ -188,7 +188,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa pwd->barBrush = CreateSolidBrush(darkBg); // make sidebar a dark version of the bg
} else {
pwd->bkBrush = CreateSolidBrush(colBg);
- pwd->barBrush = CreateSolidBrush(colSidebar); + pwd->barBrush = CreateSolidBrush(colSidebar);
}
if(options.border) pwd->bPen = (HPEN)CreatePen(PS_SOLID, 1, colBorder);
@@ -218,12 +218,12 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa #ifdef WS_EX_LAYERED
SetWindowLong(hwnd, GWL_EXSTYLE, GetWindowLong(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED);
#endif
- -#ifdef CS_DROPSHADOW - if (options.drop_shadow) { - SetClassLong(hwnd, GCL_STYLE, CS_DROPSHADOW); - } -#endif +
+#ifdef CS_DROPSHADOW
+ if (options.drop_shadow) {
+ SetClassLong(hwnd, GCL_STYLE, CS_DROPSHADOW);
+ }
+#endif
#ifdef LWA_ALPHA
if(MySetLayeredWindowAttributes) {
@@ -334,37 +334,37 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa break;
case WM_ERASEBKGND:
{
- HDC hdc = (HDC) wParam; - RECT r, r_bar; - GetClientRect(hwnd, &r); - - // bg - FillRect(hdc, &r, pwd->bkBrush); - // sidebar - r_bar = r; - r_bar.right = r.left + options.sb_width; - FillRect(hdc, &r_bar, pwd->barBrush); - // border - if(options.border) { - - HBRUSH hOldBrush = (HBRUSH)SelectObject(hdc, GetStockObject(NULL_BRUSH)); - HPEN hOldPen = (HPEN)SelectObject(hdc, pwd->bPen); - - int h = 0; - if(options.round) { - int v; - int w=14; - h=(r.right-r.left)>(w*2)?w:(r.right-r.left); - v=(r.bottom-r.top)>(w*2)?w:(r.bottom-r.top); - h=(h<v)?h:v; - //} else { - // Rectangle(hdc, r.left, r.top, (r.right - r.left), (r.bottom - r.top)); - } - RoundRect(hdc, 0, 0, (r.right - r.left), (r.bottom - r.top), h, h); - - SelectObject(hdc, hOldBrush); - SelectObject(hdc, hOldPen); - } + HDC hdc = (HDC) wParam;
+ RECT r, r_bar;
+ GetClientRect(hwnd, &r);
+
+ // bg
+ FillRect(hdc, &r, pwd->bkBrush);
+ // sidebar
+ r_bar = r;
+ r_bar.right = r.left + options.sb_width;
+ FillRect(hdc, &r_bar, pwd->barBrush);
+ // border
+ if(options.border) {
+
+ HBRUSH hOldBrush = (HBRUSH)SelectObject(hdc, GetStockObject(NULL_BRUSH));
+ HPEN hOldPen = (HPEN)SelectObject(hdc, pwd->bPen);
+
+ int h = 0;
+ if(options.round) {
+ int v;
+ int w=14;
+ h=(r.right-r.left)>(w*2)?w:(r.right-r.left);
+ v=(r.bottom-r.top)>(w*2)?w:(r.bottom-r.top);
+ h=(h<v)?h:v;
+ //} else {
+ // Rectangle(hdc, r.left, r.top, (r.right - r.left), (r.bottom - r.top));
+ }
+ RoundRect(hdc, 0, 0, (r.right - r.left), (r.bottom - r.top), h, h);
+
+ SelectObject(hdc, hOldBrush);
+ SelectObject(hdc, hOldPen);
+ }
}
return TRUE;
@@ -504,7 +504,7 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa DeleteObject(pwd->bkBrush);
DeleteObject(pwd->bPen);
- DeleteObject(pwd->barBrush); + DeleteObject(pwd->barBrush);
KillTimer(hwnd, ID_MOVETIMER);
KillTimer(hwnd, ID_CLOSETIMER);
@@ -594,13 +594,13 @@ LRESULT CALLBACK PopupWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPa if(options.av_layout != PAV_NONE && ServiceExists(MS_AV_DRAWAVATAR)) {
AVATARCACHEENTRY *ace = (AVATARCACHEENTRY *)CallService(MS_AV_GETAVATARBITMAP, (WPARAM)pd->lchContact, 0);
if(ace && (ace->dwFlags & AVS_BITMAP_VALID) && !(ace->dwFlags & AVS_HIDEONCLIST)) {
- if(ace->bmHeight >= ace->bmWidth) { - pwd->real_av_height = options.av_size; - pwd->real_av_width = (int)(options.av_size * (ace->bmWidth / (double)ace->bmHeight)); - } else { - pwd->real_av_height = (int)(options.av_size * (ace->bmHeight / (double)ace->bmWidth)); - pwd->real_av_width = options.av_size; - } + if(ace->bmHeight >= ace->bmWidth) {
+ pwd->real_av_height = options.av_size;
+ pwd->real_av_width = (int)(options.av_size * (ace->bmWidth / (double)ace->bmHeight));
+ } else {
+ pwd->real_av_height = (int)(options.av_size * (ace->bmHeight / (double)ace->bmWidth));
+ pwd->real_av_width = options.av_size;
+ }
pwd->have_av = true;
pwd->av_height = pwd->real_av_height;
}
@@ -729,7 +729,11 @@ void InitWindowStack() { MySetLayeredWindowAttributes = (BOOL (WINAPI *)(HWND,COLORREF,BYTE,DWORD))GetProcAddress(hUserDll, "SetLayeredWindowAttributes");
MyAnimateWindow=(BOOL (WINAPI*)(HWND,DWORD,DWORD))GetProcAddress(hUserDll,"AnimateWindow");
MyMonitorFromRect=(HMONITOR (WINAPI*)(LPCRECT,DWORD))GetProcAddress(hUserDll, "MonitorFromRect");
- MyGetMonitorInfo=(BOOL (WINAPI*)(HMONITOR,LPMONITORINFO))GetProcAddress(hUserDll, "GetMonitorInfo");
+ #if defined( _UNICODE )
+ MyGetMonitorInfo=(BOOL (WINAPI*)(HMONITOR,LPMONITORINFO))GetProcAddress(hUserDll, "GetMonitorInfoW");
+ #else
+ MyGetMonitorInfo=(BOOL (WINAPI*)(HMONITOR,LPMONITORINFO))GetProcAddress(hUserDll, "GetMonitorInfoA");
+ #endif
}
}
diff --git a/yapp/version.h b/yapp/version.h index 3c595ac..eb3c9f0 100644 --- a/yapp/version.h +++ b/yapp/version.h @@ -4,7 +4,7 @@ #define __MAJOR_VERSION 0
#define __MINOR_VERSION 2
#define __RELEASE_NUM 1
-#define __BUILD_NUM 5
+#define __BUILD_NUM 6
#define __FILEVERSION_STRING __MAJOR_VERSION,__MINOR_VERSION,__RELEASE_NUM,__BUILD_NUM
#define __FILEVERSION_STRING_DOTS __MAJOR_VERSION.__MINOR_VERSION.__RELEASE_NUM.__BUILD_NUM
|