How to customize multimedia authentic collars in VC

zhaozj2021-02-17  55

How to customize multimedia colorful enclosures in VC 5.0 to customize multimedia real color enlarged pages in their own applications, enrich the application in display name and copyright feature, avoiding a lot of data initialization due to application startup When the user has a long-term empty waiting process, while adding vivid features and professional characteristics to the application, it has also played the role of promotion and advertising. 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.

Equalization of VC5: 1. Making a seal page bitmap: Production application multimedia boot page true color graph, record the height and width of bitmaps, establish files such as other multimedia sounds required; 2. 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 file files for splash.h and splash.cpp, and increase WM_CREATE and WM_PAINT message mapping functions; 3. Define variables and functions: Define the following member variables and functions in Splash.h: public: bool create (cwnd * pparentWnd = null); Handle HbitsRC; LPSTR PBITSRC; UINT IW, IH; 4. Establish a boot window window: Add the Create function in splash.cpp, establish the pop-up window of the display bitmap: #include "windowsx.h" // Add the extended window to establish ... Struct {// bitmap header structure BITMAPINFOHEADER header;} Info; BOOL CSplashWnd :: Create (CWnd * pParentWnd) {// build pop-up window displays 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 here CenterWindow (); / / RETURN 0 in the pop-up window;} 5. Improve the destructive function: Perfect the destructor in splash.cpp ; IH = 480; // Bit map width and height info.Header.bisize = Sizeof (BITMAPINFOHEADER); Info.Header.biWidth = iW; Info.Header.biHeight = iH; Info.Header.biPlanes = 1L; Info.Header.biBitCount = 24L; hBitsSrc = :: GlobalAlloc (GHND, (long) ( IW * IH * 3)); // Assign Memory PBITSRC = (LPSTR) :: Globalock (HBitsSrc); // Dax Lock Memory} CSPlashWnd :: ~ csplashWnd () {:: GlobalUnlock (hbitssrc); // Unlock memory: : GlobalFree (hbitssrc); // Release Memory} 6. Show true color bitmap: Perfect OnPAINT functions in Splash.cpp, implement true color graph display: void csplashWnd :: onpaint () {...... // Todo: add your message hardler code here cfile fbmp; fbmp.open ("c: //windows/emc1.bmp"

转载请注明原文地址:https://www.9cbs.com/read-28911.html

New Post(0)