用MFC製作程式啟動logo

2021-07-11 05:24:07 字數 1445 閱讀 5193

完了,這次土鱉了,介紹個非常過時的東西,其實就是自己收藏一下,怕以後想用的時候自己忘了。

直接進入正題,首先用ps等工具做乙個自己喜歡的程式啟動的logo點陣圖,我這裡製作的logo大小為500*313,比例為**比例,看上去很舒服。

新建mfc工程,把製作好的logo點陣圖新增的資源中去,資源id號設定為idb_splash。

新建類csplashwnd,

[cpp]view plain

copy

#pragma once

#include "afxwin.h"

class

csplashwnd :  

public

cwnd  

;  

為各成員函式新增**:

[cpp]view plain

copy

#include "stdafx.h"

#include "splashwnd.h"

#include "resource.h"

csplashwnd* csplashwnd::c_psplashwnd;  

begin_message_map(csplashwnd, cwnd)  

on_wm_create()  

on_wm_paint()  

on_wm_timer()  

end_message_map()  

csplashwnd::csplashwnd(void

)  /*: c_psplashwnd(null)*/

csplashwnd::~csplashwnd(void

)    

void

csplashwnd::showsplashscreen(cwnd* pparentwnd)  

bool

csplashwnd::create(cwnd* pparentwnd)  

intcsplashwnd::oncreate(lpcreatestruct lpcreatestruct)  

void

csplashwnd::onpaint()  

void

csplashwnd::ontimer(

uint_ptr

nidevent)    

其中消隱時間的設定為你喜歡的數值。

接下來,只需在mfc工程中的cmainframe類中新增函式oncreate,並在函式定義中新增語句csplashwnd::showsplashscreen(this);

[cpp]view plain

copy

intcmainframe::oncreate(lpcreatestruct lpcreatestruct)    

好了,你的程式啟動logo做好了,編譯執行吧,少年!~~

from: 

用VC製作應用程式啟動畫面

使用啟動畫面一是可以減少等待程式載入過程中的枯燥感 尤其是一些大型程式 二是 可以用來顯示軟體名稱和版權等提示資訊。怎樣使用vc 製作應用程式的啟動畫面呢?本文提供四種方法。前三種適用於基於文件的應用程式,第四種適用於基於對話方塊的應用程 序。1.利用元件庫中的splash screen元件實現 1...

MFC 程式啟動流程分析

一 mfc程式執行過程剖析 相信大家有點暈點了吧,實際程式設計中沒有必要深刻理解這麼多,這些大都是由mfc內部自動幫我們完成的。實際mfc程式設計過程中,其實懂得mfc程式中各個函式的執行流程即可。有時候過於追究mfc細節會白白浪費我們的精力,應該將主要精力放在使用mfc解決實際問題上。二 vc6中...

MFC用GDI 動感歌詞的製作

源 源 1.插入乙個對話方塊的資源,刪除預設控制項,並為對話方塊建立乙個類,命名為clyricdlg 2.在對話方塊的標頭檔案中新增gdi 相關的標頭檔案和動態庫 define unicode ifndef ulong ptr define ulong ptr unsigned long endif...