Chinaunix首页 | 论坛 | 博客
  • 博客访问: 9417335
  • 博文数量: 1748
  • 博客积分: 12961
  • 博客等级: 上将
  • 技术积分: 20070
  • 用 户 组: 普通用户
  • 注册时间: 2009-01-09 11:25
个人简介

偷得浮生半桶水(半日闲), 好记性不如抄下来(烂笔头). 信息爆炸的时代, 学习是一项持续的工作.

文章分类

全部博文(1748)

文章存档

2024年(24)

2023年(26)

2022年(112)

2021年(217)

2020年(157)

2019年(192)

2018年(81)

2017年(78)

2016年(70)

2015年(52)

2014年(40)

2013年(51)

2012年(85)

2011年(45)

2010年(231)

2009年(287)

分类: Windows平台

2019-09-20 11:49:00

环境:
下载 
在VS2013中编译, 分别编译解决方案, 分别得到  body, pre { margin: 0; padding: 0; } pre { font-family: inherit; } #vt100 { float: left; border: 0px solid; padding: 1px; line-height: 116%; font-size: 9pt; font-family: 'Lucida Console', 'Lucida Console ', 'Consolas'; color: #BFBFBF; background-color: #000000; } .bd { font-weight: bold } .it { font-style: italic } .ul { text-decoration-line: underline } .st { text-decoration-line: line-through } .lu { text-decoration-line: line-through underline } .fg-color0 { color: #000000 } .bg-color0 { background-color: #000000 } .fg-color1 { color: #BF0000 } .bg-color1 { background-color: #BF0000 } .fg-color2 { color: #00BF00 } .bg-color2 { background-color: #00BF00 } .fg-color3 { color: #BFBF00 } .bg-color3 { background-color: #BFBF00 } .fg-color4 { color: #0000BF } .bg-color4 { background-color: #0000BF } .fg-color5 { color: #BF00BF } .bg-color5 { background-color: #BF00BF } .fg-color6 { color: #00BFBF } .bg-color6 { background-color: #00BFBF } .fg-color7 { color: #BFBFBF } .bg-color7 { background-color: #BFBFBF } .fg-color8 { color: #404040 } .bg-color8 { background-color: #404040 } .fg-color9 { color: #FF4040 } .bg-color9 { background-color: #FF4040 } .fg-color10 { color: #40FF40 } .bg-color10 { background-color: #40FF40 } .fg-color11 { color: #FFFF40 } .bg-color11 { background-color: #FFFF40 } .fg-color12 { color: #6060FF } .bg-color12 { background-color: #6060FF } .fg-color13 { color: #FF40FF } .bg-color13 { background-color: #FF40FF } .fg-color14 { color: #40FFFF } .bg-color14 { background-color: #40FFFF } .fg-color15 { color: #FFFFFF } .bg-color15 { background-color: #FFFFFF } .cursor { background-color: #BFBFBF } .font10 { font-family: 'F25 Blackletter Typewriter' }
DuiLib.dll*  duilib.xml     DuiLib_d.lib   DuiLib_u.lib    DuiLib_ud.lib  DuiLib.lib 
DuiLib_d.dll* DuiLib_u.dll* DuiLib_ud.dll* 

从源码中抽取必要的 文件, 得到 开发环境包. duilib_dev.zip
新建一个VS2013 的 WIN32工程.  在 sln 工程目录下加入 duilib的开发包.
并在工程属性: 

点击(此处)折叠或打开

  1. <VC++目录>/<包含目录> 添加 $(SolutionDir)/duilib/inc
  2. <VC++目录>/<包含目录> 添加 $(SolutionDir)/duilib/lib
  3. <链接器>/<附加依赖项> 添加对应的 lib 文件.
代码 stdafx.h 加入
点击(此处)折叠或打开
  1. //引入 DUILIB
  2. #include "UIlib.h"
  3. using namespace DuiLib;

  4. #ifdef _DEBUG
  5. # ifdef _UNICODE
  6. #        pragma comment(lib, "DuiLib_ui.lib")
  7. #    else
  8. #        pragma comment(lib, "DuiLib_d.lib")
  9. #    endif
  10. #else
  11. # ifdef _UNICODE
  12. # pragma comment(lib, "DuiLib_u.lib")
  13. # else
  14. # pragma comment(lib, "DuiLib.lib")
  15. # endif
  16. #endif
加入XML 的 UI文件. 到对应的 Debug/release/unicode_debug等目录中. 同时拷贝对应 DLL 文件到这行执行目录中.

点击(此处)折叠或打开

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <Window mininfo="200,360" size="360,600">
  3.     <Font shared="true" id="0" name="幼圆" size="12" default="true" />
  4.     <Font shared="true" id="1" name="微软雅黑" size="18" />
  5.     <Include source="scrollbar.xml" />
  6.     <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'" " />
  7.     <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'"" />
  8.     <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'"" />
  9.     <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'"" />
  10.     
  11.     <VerticalLayout inset="10,6,10,6" bkcolor="#FFEA679F" colorhsl="true" bkimage="file='voice_rect.png' xtiled='true' ytiled='true' dest='0,0,200,400'">
  12.         <Slider name="alpha_controlor" min="20" max="255" value="255"/>
  13.         <Control height="4"/>
  14.         <Slider name="h_controlor" max="360" value="180"/>
  15.         <Control height="4"/>
  16.         <Slider name="s_controlor" max="200" value="100"/>
  17.         <Control height="4"/>
  18.         <Slider name="l_controlor" max="200" value="100"/>
  19.         <Button name="changeskinbtn" height="20" text="换肤" maxwidth="120" />
  20.         <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">
  21.             <Control bkcolor="#FFF22E2E" float="true" pos="80,40,260,220" bkimage="winbk.bmp" />
  22.             <Button name="insertimagebtn" float="0.5,0.5,0.5,0.5" pos="-80,-10,80,10" text="删除自己" />
  23.         </RichEdit>
  24.         <Control height="26"/>
  25.         <Edit name="testedit" text="{a }ddd{/a}" showhtml="true" maxwidth="280" bkcolor="#0000E000" nativebkcolor="#0000E000"/>
  26.         <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"/>
  27.         <DateTime name="DateTime" width="200" height="30" bkcolor="#FFE2E5EA" padding="0,5,0,0" />
  28.         <CheckBox name="CheckBox1" width="20" height="20" bkcolor="#FFEA679F" />
  29.         <ComboBox name="ComboBox1" width="200" height="30" bkcolor="#FFEA679F" bordersize="1" bordercolor="0xFFFF0000">
  30.             <ListLabelElement text="11111111111111"/>
  31.             <ListLabelElement text="22222222222222"/>
  32.             <ListLabelElement text="33333333333333" selected="true"/>
  33.             <ListLabelElement text="44444444444444"/>
  34.             <ListLabelElement text="55555555555555"/>
  35.             <ComboBox height="30" bkcolor="#FF00679F" >
  36.                 <Edit text="{a }ddd{/a}" />
  37.                 <ListLabelElement text="666666666666666"/>
  38.             </ComboBox>
  39.             <Edit text="{a }ddd{/a}" />
  40.         </ComboBox>
  41.         <TreeView bkcolor="#ffffffff" visiblefolderbtn="true" visiblecheckbtn="true" vscrollbar="true" >
  42.             <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' "" >
  43.             <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' "" >
  44.                 <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' "" >
  45.                     <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' "" >
  46.                         <Button text="扩展按钮" width="100" />
  47.                     </TreeNode>
  48.                     <Button text="扩展按钮" width="100" />
  49.                 </TreeNode>
  50.                 <Edit text="扩展文本框" tipvalue="扩展文本框" width="100" />
  51.             </TreeNode>
  52.             <Edit text="扩展文本框" tipvalue="扩展文本框" width="100" />
  53.             </TreeNode>
  54.             <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' "" >
  55.             <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' "" >
  56.                 <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' "" >
  57.                     <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' "" >
  58.                         <Option text="扩展单选框" width="100" group="RadioBoxTest" />
  59.                     </TreeNode>
  60.                     <Option text="扩展单选框" width="100" group="RadioBoxTest" />
  61.                 </TreeNode>
  62.                 <CheckBox text="扩展复选框" width="100" />
  63.             </TreeNode>
  64.             <CheckBox text="扩展复选框" width="100" />
  65.             </TreeNode>
  66.         </TreeView>
  67.     </VerticalLayout>
  68. </Window>
去掉原工程中的代码. 添加.

点击(此处)折叠或打开

  1. // Win32Prj_Duilib.cpp : 定义应用程序的入口点。
  2. //

  3. #include "stdafx.h"
  4. #include "Win32Prj_Duilib.h"

  5. #ifndef _DWMAPI_H_
  6. typedef struct DWM_BLURBEHIND
  7. {
  8.     DWORD dwFlags;
  9.     BOOL fEnable;
  10.     HRGN hRgnBlur;
  11.     BOOL fTransitionOnMaximized;
  12. } DWM_BLURBEHIND;

  13. typedef struct tagDWL_MARGINS {
  14.     int cxLeftWidth;
  15.     int cxRightWidth;
  16.     int cyTopHeight;
  17.     int cyBottomHeight;
  18. } DWM_MARGINS, *PDWM_MARGINS;

  19. // Window attributes
  20. enum DWMWINDOWATTRIBUTE
  21. {
  22.     DWMWA_NCRENDERING_ENABLED = 1, // [get] Is non-client rendering enabled/disabled
  23.     DWMWA_NCRENDERING_POLICY, // [set] Non-client rendering policy
  24.     DWMWA_TRANSITIONS_FORCEDISABLED, // [set] Potentially enable/forcibly disable transitions
  25.     DWMWA_ALLOW_NCPAINT, // [set] Allow contents rendered in the non-client area to be visible on the DWM-drawn frame.
  26.     DWMWA_CAPTION_BUTTON_BOUNDS, // [get] Bounds of the caption button area in window-relative space.
  27.     DWMWA_NONCLIENT_RTL_LAYOUT, // [set] Is non-client content RTL mirrored
  28.     DWMWA_FORCE_ICONIC_REPRESENTATION, // [set] Force this window to display iconic thumbnails.
  29.     DWMWA_FLIP3D_POLICY, // [set] Designates how Flip3D will treat the window.
  30.     DWMWA_EXTENDED_FRAME_BOUNDS, // [get] Gets the extended frame bounds rectangle in screen space
  31.     DWMWA_HAS_ICONIC_BITMAP, // [set] Indicates an available bitmap when there is no better thumbnail representation.
  32.     DWMWA_DISALLOW_PEEK, // [set] Don
执行测试.




阅读(5228) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~