diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2013-08-19 15:12:03 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2013-08-19 15:12:03 +0000 |
commit | 7056d9f7bf15b9e9d8e21bb8f38688733a73920d (patch) | |
tree | a36e623e51faafe2613cfff096a8eb3aa4026a7d /plugins/SplashScreen/src/splash.cpp | |
parent | dc9bcdf426102a9a8c00ce5ad5d33551b27d608c (diff) |
own function replaced by winapi
git-svn-id: http://svn.miranda-ng.org/main/trunk@5748 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/SplashScreen/src/splash.cpp')
-rw-r--r-- | plugins/SplashScreen/src/splash.cpp | 76 |
1 files changed, 31 insertions, 45 deletions
diff --git a/plugins/SplashScreen/src/splash.cpp b/plugins/SplashScreen/src/splash.cpp index 196c4adedd..9738fe005b 100644 --- a/plugins/SplashScreen/src/splash.cpp +++ b/plugins/SplashScreen/src/splash.cpp @@ -32,7 +32,6 @@ LRESULT CALLBACK SplashWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM logMessage(_T("WM_LOADED"), _T("called"));
#endif
- if (!MyUpdateLayeredWindow) ShowWindow(hwndSplash, SW_SHOWNORMAL);
if (!options.showtime) SetTimer(hwnd, 7, 2000, 0);
break;
@@ -91,29 +90,26 @@ LRESULT CALLBACK SplashWindowProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM case WM_CLOSE:
{
- if (MyUpdateLayeredWindow) // Win 2000+
+ RECT rc; GetWindowRect(hwndSplash, &rc);
+ POINT ptDst = { rc.left, rc.top };
+ POINT ptSrc = { 0, 0 };
+ SIZE sz = { rc.right - rc.left, rc.bottom - rc.top };
+
+ BLENDFUNCTION blend;
+ blend.BlendOp = AC_SRC_OVER;
+ blend.BlendFlags = 0;
+ blend.SourceConstantAlpha = 255;
+ blend.AlphaFormat = AC_SRC_ALPHA;
+
+ // Fade Out
+ if (options.fadeout)
{
- RECT rc; GetWindowRect(hwndSplash, &rc);
- POINT ptDst = { rc.left, rc.top };
- POINT ptSrc = { 0, 0 };
- SIZE sz = { rc.right - rc.left, rc.bottom - rc.top };
-
- BLENDFUNCTION blend;
- blend.BlendOp = AC_SRC_OVER;
- blend.BlendFlags = 0;
- blend.SourceConstantAlpha = 255;
- blend.AlphaFormat = AC_SRC_ALPHA;
-
- // Fade Out
- if (options.fadeout)
+ int i;
+ for (i = 255; i>=0; i -= options.fosteps)
{
- int i;
- for (i = 255; i>=0; i -= options.fosteps)
- {
- blend.SourceConstantAlpha = i;
- MyUpdateLayeredWindow(hwndSplash, NULL, &ptDst, &sz, SplashBmp->getDC(), &ptSrc, 0xffffffff, &blend, LWA_ALPHA);
- Sleep(1);
- }
+ blend.SourceConstantAlpha = i;
+ UpdateLayeredWindow(hwndSplash, NULL, &ptDst, &sz, SplashBmp->getDC(), &ptSrc, 0xffffffff, &blend, LWA_ALPHA);
+ Sleep(1);
}
}
if (bserviceinvoked) bserviceinvoked = false;
@@ -283,34 +279,24 @@ int SplashThread(void *arg) //free (ptr_verString);
}
- if (MyUpdateLayeredWindow) // Win 2000+
- {
- SetWindowLongPtr(hwndSplash, GWL_EXSTYLE, GetWindowLongPtr(hwndSplash, GWL_EXSTYLE) | WS_EX_LAYERED);
- /*
- if (splashWithMarkers)
- {
- ++ptSrc.x;
- ++ptSrc.y;
- }
- */
- MyUpdateLayeredWindow(hwndSplash, NULL, &ptDst, &sz, SplashBmp->getDC(), &ptSrc, 0xffffffff, &blend, LWA_ALPHA);
+ SetWindowLongPtr(hwndSplash, GWL_EXSTYLE, GetWindowLongPtr(hwndSplash, GWL_EXSTYLE) | WS_EX_LAYERED);
+ UpdateLayeredWindow(hwndSplash, NULL, &ptDst, &sz, SplashBmp->getDC(), &ptSrc, 0xffffffff, &blend, LWA_ALPHA);
- ShowWindow(hwndSplash, SW_SHOWNORMAL);
+ ShowWindow(hwndSplash, SW_SHOWNORMAL);
- if (options.fadein)
+ if (options.fadein)
+ {
+ // Fade in
+ int i;
+ for (i = 0; i < 255; i += options.fisteps)
{
- // Fade in
- int i;
- for (i = 0; i < 255; i += options.fisteps)
- {
- blend.SourceConstantAlpha = i;
- MyUpdateLayeredWindow(hwndSplash, NULL, &ptDst, &sz, SplashBmp->getDC(), &ptSrc, 0xffffffff, &blend, LWA_ALPHA);
- Sleep(1);
- }
+ blend.SourceConstantAlpha = i;
+ UpdateLayeredWindow(hwndSplash, NULL, &ptDst, &sz, SplashBmp->getDC(), &ptSrc, 0xffffffff, &blend, LWA_ALPHA);
+ Sleep(1);
}
- blend.SourceConstantAlpha = 255;
- MyUpdateLayeredWindow(hwndSplash, NULL, &ptDst, &sz, SplashBmp->getDC(), &ptSrc, 0xffffffff, &blend, LWA_ALPHA);
}
+ blend.SourceConstantAlpha = 255;
+ UpdateLayeredWindow(hwndSplash, NULL, &ptDst, &sz, SplashBmp->getDC(), &ptSrc, 0xffffffff, &blend, LWA_ALPHA);
if (DWORD(arg) > 0)
{
|