How to customize multimedia color enclosures in VC5
Liaoning Tieling Municipal Committee, Song Libo ---- Customize multimedia color enclosures in their own application, enrich the application in display name and copyright feature, avoiding a large amount of data initialization before the application starts The long-term empty waiting process has increased the role of promotion and advertising while adding vivid features and professional characteristics to the application. Although this feature has a particular class in VC5, it is also possible to make your own application unique by customizing your application multimedia booting page.
Realization Steps in VC5: ---- First, Production Cap Page List: Production Application Multimedia Startup Seal Page True Capital Graph, Recording the Height and Width of Bitmap, Establishing the other multimedia sounds needed; - - Second, establish an application: Use the File-> New menu to establish a multi-document application framework named Start, and use the class wizard appwizard to increase the new class CSPlashWnd, which is Generic CWnd, and rename the new class file to Splash. H and Splash.cpp, and increase the message mapping function of WM_CREATE and WM_PAINT; Handle HbitsSrc; LPSTR PBITSRC; UINT IW, IH; ---- Four Add an extended window to establish ... struct {// bitmap file header structure BitmapInfoHeader Header;} info; bool csplashWnd :: Create (cwnd * pparentWnd) {// Establish a pop-up of display bitmap Return Createex (0, AfxRegisterWndClass (0, AfxGetApp () -> LoadStandardCursor (IDC_ARROW)), NULL, WS_POPUP | WS_VISIBLE, 0,0,672,480, pParentWnd-> GetSafeHwnd (), NULL);} int CSplashWnd :: OnCreate (lPCREATESTRUCT lpCreateStruct) {.... ..// Todo: Add Your Specialized Creation Code HeRecenterWindow (); // Make the pop-up window to return Return 0;} ---- Five, improve the destructor: Perfect the destructor in Splash.cpp, to display the bitmap Preparation: csplashWnd :: CSPlashWnd () // Perfect destructor {IW = 672; IH = 480; // Bit map width and height info.Header.biwidth; info.Header.biwidth = IW Info .Header.biheight = Ih; info.Header.Biplanes = 1L; info.Header.bibitcount = 24L; hBitsrc = :: Globalalloc (ghnd, (i * h * 3)); // Assign memory PBITSRC = LPSTR) :: GlobalLock (hbitssrc); // Plock memory} csplashWnd :: ~ csplashWnd () {:: globalunlock (hbitssrc); // Unlock memory :: globalfree (hbitsSRC); // Release memory} ---- 6. Display true color graph: Perfect the onpaint function in splash.cpp, realize the display of true color graph: void csplashWnd :: onpaint () {... // Todo: add your message handler code HeRecfile FBMP FBMP.Open ("C: //Windows//emc1.bmp", cfile :: moderad | cfile :: typebinary | cfile :: ShareXClusive); // Open FBMP.SEEK (54, cfile :: begin);