CDialogsk - a dialog box that supports skin

zhaozj2021-02-16  52

CDialogsk - a dialog box that supports skin

First, introducing this class from the MFC's cdialog inherit, supports the following features: 1. Running on the Win2000 or WinXP platform, any transparency can be used in the area of ​​the Perspective dialog. 2. On the WIN2000 or WinXP platform, the entire dialog can be transparent. 3, use bitmap background. Bitmaps can come from resource files, BMP, or hbitmap4, set background types: title, center, and telescopic; set the size of the dialog for the size of the bitmap 5, you can click any part of the dialog Allow / disable mobile dialog

Second, the use of this class is as follows: 1. Add files cdialogsk.h and cdialog.cpp2 into the project, including cdialogsd.h3 in your dialog box, in your dialog box, replace all CDialog4 If you want to use the background image, find the type option for the dialog property, make Style = Popup,

Border = None and makes Title Bar as unselected states. 5. At the end of your dialog box class, add the CDialogsk property method to call: BOOL CSKINDIALOG_DEMODLG :: OnIndialog () {... enableeeasymove (); // Allow mobile setBitmap (IDB_BACKGROUND); // Set background bit Figure setStyle (LO_RESize); // Make the dialog size suitable for bitmap size setTransparentColor (RGB (0, 255, 0)); // Set transparent color is green

Return true;} 6, for example, if you want to generate a circular dialog box, you can create a picture, the background is green, draw a blue circle. Then, call the setBitmap, the parameter is the path to the image, call SettransParentColor, the color (green) of the parameters (green). This can't see the background, get a circular window.

Third, the method CDialogSK class provides the following methods: 1, DWORD SetBitmap (HBITMAP hBitmap); 2, DWORD SetBitmap (int nBitmap); 3, DWORD SetBitmap (LPCTSTR lpszFileName); 4, void SetStyle (LayOutStyle style); LO_DEFAULT, LO_TILE ( Title picture), LO_CENTER (central picture), LO_STRETCH (telescopic)

The picture is suitable for dialog box size), or LO_RESIZE (Bool Penable = true); 6, Bool SetTransparent (BYTE BALPHA); make the entire dialog transparent, range 0 (transparent) -255 (opaque). Only suitable for Win2000 and above

This 7, Bool SetTransparentColor (ColorRef Col, Bool Btrans = true); Specify transparent color. Only for Win2000 and above.

CDialogsk file download address http://www.codeguru.com/code/legacy/dialog/cDialogsk_src.zip

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

New Post(0)