VC++ Splash Window封装类CSplash
|
1
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
// ===========================================================================
// File Splash.h // Desc The interface of the CSplash class // =========================================================================== #ifndef _ABHI_SPLASH_H_ #define _ABHI_SPLASH_H_ #include "windows.h" // =========================================================================== // ======================================================================= // ======================================================================= // ======================================================================= // ======================================================================= // ======================================================================= // ======================================================================= LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam); HWND m_hwnd; private: }; #endif //_ABHI_SPLASH_H_ |
|
1
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 |
// ===========================================================================
// File Splash.cpp // Desc The implementation file for the CSplash class. // =========================================================================== #include "splash.h" // =========================================================================== lpfnSetLayeredWindowAttributes g_pSetLayeredWindowAttributes; #define WS_EX_LAYERED 0x00080000 // =========================================================================== LRESULT CALLBACK CSplash::WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) return DefWindowProc (hwnd, uMsg, wParam, lParam) ; void CSplash:: OnPaint(HWND hwnd) // ======================================================================= RECT rect; ::SelectObject(hMemDC, hOldBmp); ::DeleteDC(hMemDC); void CSplash::Init() // ======================================================================= g_pSetLayeredWindowAttributes = (lpfnSetLayeredWindowAttributes) CSplash::CSplash() CSplash::CSplash(LPCTSTR lpszFileName, COLORREF colTrans) SetBitmap(lpszFileName); CSplash::~CSplash() HWND CSplash::RegAndCreateWindow() if(!RegisterClassEx (&wndclass)) // ======================================================================= ; // ======================================================================= int CSplash::DoLoop() // ======================================================================= return msg.wParam ; } void CSplash::ShowSplash() DWORD CSplash::SetBitmap(LPCTSTR lpszFileName) DWORD CSplash::SetBitmap(HBITMAP hBitmap) void CSplash::FreeResources() int CSplash::CloseSplash() bool CSplash::SetTransparentColor(COLORREF col) return MakeTransparent(); bool CSplash::MakeTransparent() |
测试调用:
|
1
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
// ===========================================================================
// File SplashClient.cpp // Desc Test stub for the CSplash class // =========================================================================== #include "stdafx.h" #include "splash.h" int APIENTRY WinMain(HINSTANCE hInstance, // your start up code here // Close the splash screen // ======================================================================= Sleep(); splashAbout.CloseSplash(); ; |
效果图:

出处:https://www.codeproject.com/Articles/7658/CSplash-A-Splash-Window-Class
VC++ Splash Window封装类CSplash的更多相关文章
- VC获得window操作系统版本号, 获取操作系统位数
原文链接: http://www.greensoftcode.net/techntxt/2014315195331643021849 #include <Windows.h>include ...
- C# WinForm开发系列 - Form/Window
Form是WinForm开发中非常重要的一个控件, 本文将包含如何制作一个关于对话框,系统载入提示窗体, 创建类似于QQ提示框以及创建不规则窗体等(文章及相关代码搜集自网络,仅供学习参考,版权属于原作 ...
- iOS UIButton加在window上点击无效果问题
UIButton加在window上,点击没有效果,找了很久,原来是没有加上这名:[self.window makeKeyAndVisible]; self.window = [[UIWindow al ...
- iOS切换window根控制器 (转)
转自linfengwenyou 在运行过程中更改根控制器的方法:(假设:A为当前根控制器,B为要设的根控制器) 方法一: 1. appdelegate.m中 self.window = [[UIWin ...
- VC++ 轻松实现“闪屏” SplashWnd
我们平时使用的好多软件在运行启动时都会有一个“闪屏”画面显示,一般用于标识软件的一些信息,如软件版本名称.公司等,通过查找资料发现,其实实现起来很简单,一个类就能搞定! SplashWnd.h C+ ...
- [转]WinForm下Splash(启动画面)制作
本文转自:http://www.smartgz.com/blog/Article/1088.asp 原文如下: 本代码可以依据主程序加载进度来显示Splash. static class Progra ...
- 为你的Web程序加个启动画面
.Net开发者一定熟悉下面这个画面: 这就是宇宙第一IDE Visual Studio的启动画面,学名叫Splash Screen(或者Splash Window).同样,Javar们一定对Eclip ...
- JSPatch来更新已上线的App中出现的BUG(超级详细)
JSPatch的作用是什么呢? 简单来说:(后面有具体的操作步骤以及在操作过程中会出现的错误) 1.iOS应用程序上架到AppStore需要等待苹果公司的审核,一般审核时间需要1到2周.虽然程序在上架 ...
- ios10新特性-UserNotification
引言:iOS的通知分本地通知和远程通知,iOS10之前采用的是UILocationNotification类,远程通知有苹果服务器进行转发,本地通知和远程通知其回调的处理都是通过AppDelegate ...
随机推荐
- 〖Android〗K860/K860i CM10.2 Logcat
--------- beginning of /dev/log/main I/installd( 1377): installd firing up I/DEBUG ( 1370): debugger ...
- Ldap登陆AD(Active Directory)进行认证的Java示例
原文地址:http://hi.baidu.com/js2007/item/24efbb0fae1c9b90a3df432a package LdapTest; import java.util.Has ...
- mysql数据结构优化,范式和反范式
1.范式,正常的建表,反范式,为了提高效率,适当的已空间换时间 2.垂直拆分,就是把经常用的.或者text大存储的字段单独拉出来存表 3.水平拆分,解决数据量大的问题,进行取莫的方式将数据放到相同的n ...
- Idea 翻译插件
https://github.com/YiiGuxing/TranslationPlugin
- 转:Mosquitto配置----日志设置
1.mosquitto的日志输出方式简介 mosquitto是一个纯C的代码,它的日志输出支持若干中日志输出方式,通过修改配置项:log_dest即可完成对各种日志输出类型的切换,常见的日志输出类型有 ...
- HDU 4280Island Transport(网络流之最大流)
题目地址:pid=4280">http://acm.hdu.edu.cn/showproblem.php? pid=4280 这个题是一个纯最大流模板题..就是用来卡时间的.. 还好我 ...
- Android异步任务处理框架AsyncTask源代码分析
[转载请注明出处:http://blog.csdn.net/feiduclear_up CSDN 废墟的树] 引言 在平时项目开发中难免会遇到异步耗时的任务(比方最常见的网络请求).遇到这样的问题.我 ...
- ToString(“N2”)和ToString(“0.00”)之间的区别
看来N会包含数千个分隔符,而0.00则不会. N2将以500.00的方式工作,但是当您有5000.00时,N2将显示为 5,000.00 代替 5000.00 If you do this inste ...
- c语言中各种数据类型的长度
在32位平台和64位平台上,同一种数据类型可能有不同的数据长度: 类型 32位平台 64位平台 char 1 1 short 2 2 int 4 4 long 4 8 long long 8 8 fl ...
- atitit.词法分析的实现token attilax总结
atitit.词法分析的实现token attilax总结 1. 词法分析(英语:lexical analysis)跟token 1 1.1. 扫描器 2 2. 单词流必须识别为保留字,标识符(变量) ...