下载
在VS2013中编译, 分别编译
DuiLib.dll* duilib.xml DuiLib_d.lib DuiLib_u.lib DuiLib_ud.lib DuiLib.lib DuiLib_d.dll* DuiLib_u.dll* DuiLib_ud.dll* |
从源码中抽取必要的

新建一个VS2013 的 WIN32工程. 在 sln 工程目录下加入 duilib的开发包.
并在工程属性:
点击(此处)折叠或打开
-
<VC++目录>/<包含目录> 添加 $(SolutionDir)/duilib/inc
-
<VC++目录>/<包含目录> 添加 $(SolutionDir)/duilib/lib
- <链接器>/<附加依赖项> 添加对应的 lib 文件.
点击(此处)折叠或打开
-
//引入 DUILIB
-
#include "UIlib.h"
-
using namespace DuiLib;
-
-
#ifdef _DEBUG
-
# ifdef _UNICODE
-
# pragma comment(lib, "DuiLib_ui.lib")
-
# else
-
# pragma comment(lib, "DuiLib_d.lib")
-
# endif
-
#else
-
# ifdef _UNICODE
-
# pragma comment(lib, "DuiLib_u.lib")
-
# else
-
# pragma comment(lib, "DuiLib.lib")
-
# endif
- #endif
点击(此处)折叠或打开
-
<?xml version="1.0" encoding="UTF-8"?>
-
<Window mininfo="200,360" size="360,600">
-
<Font shared="true" id="0" name="幼圆" size="12" default="true" />
-
<Font shared="true" id="1" name="微软雅黑" size="18" />
-
<Include source="scrollbar.xml" />
-
<Default shared="true" name="Slider" value="thumbsize="10,10" bkimage="file='bg.bmp' corner='6,0,6,0' mask='#FFFF00FF'" foreimage="file='fg.bmp' corner='6,0,6,0' mask='#FFFF00FF'" thumbimage="file='thumb.bmp' source='30,0,40,10' mask='#FFDAEBF9'" thumbhotimage="file='thumb.bmp' source='10,0,20,10' mask='#FFDAEBF9'" " />
-
<Default shared="true" name="Button" value="textcolor="#000000" hottextcolor="#FFFFFF" focusedtextcolor="#000000" pushedtextcolor="#77a8de" normalimage="file='Button/btn.png' corner='5,11,5,11' source='0,0,96,24'" hotimage="file='Button/btn.png' corner='5,11,5,11' source='0,24,96,48'" pushedimage="file='Button/btn.png' corner='5,11,5,11' source='0,48,96,72'" disabledimage="file='Button/btn.png' corner='5,11,5,11' source='0,72,96,96'"" />
-
<Default shared="true" name="Option" value="textcolor="#FFbac0c5" hottextcolor="#FF386382" selectedtextcolor="#FF386382" disabledtextcolor="#FFbac0c5" textpadding="18,2,0,0" align="left" selectedimage="file='Button/RadioBtnSel.png' source='0,0,13,13' dest='0,5,14,19'" normalimage="file='Button/RadioBtnNon.png' source='0,0,13,13' dest='0,5,14,19'"" />
-
<Default shared="true" name="CheckBox" value="textcolor="#FFbac0c5" hottextcolor="#FF386382" selectedtextcolor="#FF386382" disabledtextcolor="#FFbac0c5" textpadding="20,2,0,0" align="left" selectedimage="file='Icon/checked.png' dest='0,2,16,18'" normalimage="file='Icon/unchecked.png' dest='0,2,16,18'"" />
-
-
<VerticalLayout inset="10,6,10,6" bkcolor="#FFEA679F" colorhsl="true" bkimage="file='voice_rect.png' xtiled='true' ytiled='true' dest='0,0,200,400'">
-
<Slider name="alpha_controlor" min="20" max="255" value="255"/>
-
<Control height="4"/>
-
<Slider name="h_controlor" max="360" value="180"/>
-
<Control height="4"/>
-
<Slider name="s_controlor" max="200" value="100"/>
-
<Control height="4"/>
-
<Slider name="l_controlor" max="200" value="100"/>
-
<Button name="changeskinbtn" height="20" text="换肤" maxwidth="120" />
-
<RichEdit name="testrichedit" bordercolor="#FF0000" bordersize="0" borderround="18,18" inset="4,2,4,2" bkcolor="#A0F2F5FA" bkcolor2="#A0FF0000" bkcolor3="#A0F2F5FA" font="1" multiline="true" vscrollbar="true" autovscroll="true" enabled="true" rich="true" readonly="false" text="1爱3">
-
<Control bkcolor="#FFF22E2E" float="true" pos="80,40,260,220" bkimage="winbk.bmp" />
-
<Button name="insertimagebtn" float="0.5,0.5,0.5,0.5" pos="-80,-10,80,10" text="删除自己" />
-
</RichEdit>
-
<Control height="26"/>
-
<Edit name="testedit" text="{a }ddd{/a}" showhtml="true" maxwidth="280" bkcolor="#0000E000" nativebkcolor="#0000E000"/>
-
<RichEdit name="testrichedit1" bordercolor="#FF0000" bordersize="2" borderround="8,8" inset="4,2,4,2" bkcolor="#FFE2E5EA" bkcolor2="#FF00F5DA" bkcolor3="#FFF2F5FA" font="1" multiline="false" rich="false" hscrollbar="true" autohscroll="true"/>
-
<DateTime name="DateTime" width="200" height="30" bkcolor="#FFE2E5EA" padding="0,5,0,0" />
-
<CheckBox name="CheckBox1" width="20" height="20" bkcolor="#FFEA679F" />
-
<ComboBox name="ComboBox1" width="200" height="30" bkcolor="#FFEA679F" bordersize="1" bordercolor="0xFFFF0000">
-
<ListLabelElement text="11111111111111"/>
-
<ListLabelElement text="22222222222222"/>
-
<ListLabelElement text="33333333333333" selected="true"/>
-
<ListLabelElement text="44444444444444"/>
-
<ListLabelElement text="55555555555555"/>
-
<ComboBox height="30" bkcolor="#FF00679F" >
-
<Edit text="{a }ddd{/a}" />
-
<ListLabelElement text="666666666666666"/>
-
</ComboBox>
-
<Edit text="{a }ddd{/a}" />
-
</ComboBox>
-
<TreeView bkcolor="#ffffffff" visiblefolderbtn="true" visiblecheckbtn="true" vscrollbar="true" >
-
<TreeNode text="A1" folderattr="padding="0,1,0,0" width="16" height="16" normalimage="file='Icon/treeview_b.png' source='0,0,16,16' " hotimage="file='Icon/treeview_b.png' source='16,0,32,16' " selectedimage="file='Icon/treeview_a.png' source='0,0,16,16' " selectedhotimage="file='Icon/treeview_a.png' source='16,0,32,16' "" checkboxattr="width="16" height="16" normalimage="file='Icon/unchecked.png' " selectedimage="file='Icon/checked.png' "" >
-
<TreeNode text="B1" folderattr="padding="0,1,0,0" width="16" height="16" normalimage="file='Icon/treeview_b.png' source='0,0,16,16' " hotimage="file='Icon/treeview_b.png' source='16,0,32,16' " selectedimage="file='Icon/treeview_a.png' source='0,0,16,16' " selectedhotimage="file='Icon/treeview_a.png' source='16,0,32,16' "" checkboxattr="width="16" height="16" normalimage="file='Icon/unchecked.png' " selectedimage="file='Icon/checked.png' "" >
-
<TreeNode text="C1" folderattr="padding="0,1,0,0" width="16" height="16" normalimage="file='Icon/treeview_b.png' source='0,0,16,16' " hotimage="file='Icon/treeview_b.png' source='16,0,32,16' " selectedimage="file='Icon/treeview_a.png' source='0,0,16,16' " selectedhotimage="file='Icon/treeview_a.png' source='16,0,32,16' "" checkboxattr="width="16" height="16" normalimage="file='Icon/unchecked.png' " selectedimage="file='Icon/checked.png' "" >
-
<TreeNode text="D1" folderattr="padding="0,1,0,0" width="16" height="16" normalimage="file='Icon/treeview_b.png' source='0,0,16,16' " hotimage="file='Icon/treeview_b.png' source='16,0,32,16' " selectedimage="file='Icon/treeview_a.png' source='0,0,16,16' " selectedhotimage="file='Icon/treeview_a.png' source='16,0,32,16' "" checkboxattr="width="16" height="16" normalimage="file='Icon/unchecked.png' " selectedimage="file='Icon/checked.png' "" >
-
<Button text="扩展按钮" width="100" />
-
</TreeNode>
-
<Button text="扩展按钮" width="100" />
-
</TreeNode>
-
<Edit text="扩展文本框" tipvalue="扩展文本框" width="100" />
-
</TreeNode>
-
<Edit text="扩展文本框" tipvalue="扩展文本框" width="100" />
-
</TreeNode>
-
<TreeNode text="A2" folderattr="padding="0,1,0,0" width="16" height="16" normalimage="file='Icon/treeview_b.png' source='0,0,16,16' " hotimage="file='Icon/treeview_b.png' source='16,0,32,16' " selectedimage="file='Icon/treeview_a.png' source='0,0,16,16' " selectedhotimage="file='Icon/treeview_a.png' source='16,0,32,16' "" checkboxattr="width="16" height="16" normalimage="file='Icon/unchecked.png' " selectedimage="file='Icon/checked.png' "" >
-
<TreeNode text="B2" folderattr="padding="0,1,0,0" width="16" height="16" normalimage="file='Icon/treeview_b.png' source='0,0,16,16' " hotimage="file='Icon/treeview_b.png' source='16,0,32,16' " selectedimage="file='Icon/treeview_a.png' source='0,0,16,16' " selectedhotimage="file='Icon/treeview_a.png' source='16,0,32,16' "" checkboxattr="width="16" height="16" normalimage="file='Icon/unchecked.png' " selectedimage="file='Icon/checked.png' "" >
-
<TreeNode text="C2" folderattr="padding="0,1,0,0" width="16" height="16" normalimage="file='Icon/treeview_b.png' source='0,0,16,16' " hotimage="file='Icon/treeview_b.png' source='16,0,32,16' " selectedimage="file='Icon/treeview_a.png' source='0,0,16,16' " selectedhotimage="file='Icon/treeview_a.png' source='16,0,32,16' "" checkboxattr="width="16" height="16" normalimage="file='Icon/unchecked.png' " selectedimage="file='Icon/checked.png' "" >
-
<TreeNode text="D2" folderattr="padding="0,1,0,0" width="16" height="16" normalimage="file='Icon/treeview_b.png' source='0,0,16,16' " hotimage="file='Icon/treeview_b.png' source='16,0,32,16' " selectedimage="file='Icon/treeview_a.png' source='0,0,16,16' " selectedhotimage="file='Icon/treeview_a.png' source='16,0,32,16' "" checkboxattr="width="16" height="16" normalimage="file='Icon/unchecked.png' " selectedimage="file='Icon/checked.png' "" >
-
<Option text="扩展单选框" width="100" group="RadioBoxTest" />
-
</TreeNode>
-
<Option text="扩展单选框" width="100" group="RadioBoxTest" />
-
</TreeNode>
-
<CheckBox text="扩展复选框" width="100" />
-
</TreeNode>
-
<CheckBox text="扩展复选框" width="100" />
-
</TreeNode>
-
</TreeView>
-
</VerticalLayout>
- </Window>
点击(此处)折叠或打开
-
// Win32Prj_Duilib.cpp : 定义应用程序的入口点。
-
//
-
-
#include "stdafx.h"
-
#include "Win32Prj_Duilib.h"
-
-
#ifndef _DWMAPI_H_
-
typedef struct DWM_BLURBEHIND
-
{
-
DWORD dwFlags;
-
BOOL fEnable;
-
HRGN hRgnBlur;
-
BOOL fTransitionOnMaximized;
-
} DWM_BLURBEHIND;
-
-
typedef struct tagDWL_MARGINS {
-
int cxLeftWidth;
-
int cxRightWidth;
-
int cyTopHeight;
-
int cyBottomHeight;
-
} DWM_MARGINS, *PDWM_MARGINS;
-
-
// Window attributes
-
enum DWMWINDOWATTRIBUTE
-
{
-
DWMWA_NCRENDERING_ENABLED = 1, // [get] Is non-client rendering enabled/disabled
-
DWMWA_NCRENDERING_POLICY, // [set] Non-client rendering policy
-
DWMWA_TRANSITIONS_FORCEDISABLED, // [set] Potentially enable/forcibly disable transitions
-
DWMWA_ALLOW_NCPAINT, // [set] Allow contents rendered in the non-client area to be visible on the DWM-drawn frame.
-
DWMWA_CAPTION_BUTTON_BOUNDS, // [get] Bounds of the caption button area in window-relative space.
-
DWMWA_NONCLIENT_RTL_LAYOUT, // [set] Is non-client content RTL mirrored
-
DWMWA_FORCE_ICONIC_REPRESENTATION, // [set] Force this window to display iconic thumbnails.
-
DWMWA_FLIP3D_POLICY, // [set] Designates how Flip3D will treat the window.
-
DWMWA_EXTENDED_FRAME_BOUNDS, // [get] Gets the extended frame bounds rectangle in screen space
-
DWMWA_HAS_ICONIC_BITMAP, // [set] Indicates an available bitmap when there is no better thumbnail representation.
- DWMWA_DISALLOW_PEEK, // [set] Don