Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Splash screen on dialog-based?

Splash screen on dialog-based?

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    User 11731824
    wrote on last edited by
    #1

    Can anyone give me a hint on how to display splash screen on a dialog-based app, please? Thanks a lot in advance.

    A 1 Reply Last reply
    0
    • U User 11731824

      Can anyone give me a hint on how to display splash screen on a dialog-based app, please? Thanks a lot in advance.

      A Offline
      A Offline
      Andrebon
      wrote on last edited by
      #2

      Hello? First, Make Bitmap Resource, for example IDB_SPLASH Second, Add Next Class to your Project(Dialog-Based) ///////////////////////////////////////////// MySplashWnd.h #if !defined(AFX_MYSPLASHWND_H__08C608F3_1FB3_11D1_830E_58A47E000000__INCLUDED_) #define AFX_MYSPLASHWND_H__08C608F3_1FB3_11D1_830E_58A47E000000__INCLUDED_ #if _MSC_VER >= 1000 #pragma once #endif // _MSC_VER >= 1000 // MySplashWnd.h : header file // ///////////////////////////////////////////////////////////////////////////// // CMySplashWnd window class CMySplashWnd : public CWnd { // Construction public: CMySplashWnd(UINT nBitmapID, UINT nDuration = 2500); // Attributes public: BOOL Create(); // Operations public: // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CMySplashWnd) public: virtual BOOL PreTranslateMessage(MSG* pMsg); //}}AFX_VIRTUAL // Implementation public: // Generated message map functions protected: //{{AFX_MSG(CMySplashWnd) afx_msg void OnPaint(); afx_msg void OnTimer(UINT nIDEvent); //}}AFX_MSG DECLARE_MESSAGE_MAP() protected: BOOL GetBitmapAndPalette(UINT nIDResource, CBitmap &bitmap, CPalette &pal); protected: UINT m_nBitmapID; UINT m_nDuration; UINT m_nTimerID; CBitmap m_bitmap; CPalette m_pal; CWnd m_wndInvisible; }; ///////////////////////////////////////////////////////////////////////////// //{{AFX_INSERT_LOCATION}} // Microsoft Developer Studio will insert additional declarations immediately before the previous line. #endif // !defined(AFX_MYSPLASHWND_H__08C608F3_1FB3_11D1_830E_58A47E000000__INCLUDED_) MySplashWnd.cpp // MySplashWnd.cpp : implementation file // #include "stdafx.h" #include "RichEdit.h" #include "SplashWnd.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // CMySplashWnd CMySplashWnd::CMySplashWnd(UINT nBitmapID, UINT nDuration /*= 2500*/) { m_nBitmapID = nBitmapID; m_nDuration = nDuration; } BEGIN_MESSAGE_MAP(CMySplashWnd, CWnd) //{{AFX_MSG_MAP(CMySplashWnd) ON_WM_PAINT() ON_WM_TIMER() //}}AFX_MSG_MAP END_MESSAGE_MAP() BOOL CMySplashWnd::Create() { if( !GetBitmapAndPalette(m_nBitmapID, m_bitmap, m_pal) ) { TRACE1( "Could not load bitmap resource - %d\n", m_nBitmapID ); return FALSE; } BITMAP bm; m_bitmap.GetObject(sizeof(BITMAP), &bm); // First create an invi

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups