J
JimWeaver
Unregistered / Unconfirmed
GUEST, unregistred user!
要实现Skin界面,现在我们在网上看到的方法一般都是隐藏窗体的标题栏和边框,然后自己用TImage、TPanel等组件“搭建”标题栏和边框,典型的是TNeoForm;或者直接使用KSDev SkinEngine套件之类的庞然大物。
但是,小弟用 Resource Hacker 检查了金山词霸.net 2001 的XDICT.exe(系 VC++ 生成),发现其主窗体上并没有放置任何用于“搭建”标题栏和边框的Image或Panel之类的控件,窗体的Style也是有最大化、最小化按钮和系统菜单的,而且,词霸的几个按钮(回退、前一词、后一词、主菜单)都是标准控件BUTTON的自绘风格。请看:
101 DIALOGEX 0, 0, 196, 152
STYLE WS_MAXIMIZEBOX | WS_MINIMIZEBOX | WS_POPUP | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
EXSTYLE WS_EX_APPWINDOW
CAPTION ""
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
FONT 10, "Arial"
{
CONTROL "", 1002, COMBOBOX, CBS_DROPDOWN | CBS_OWNERDRAWVARIABLE | CBS_AUTOHSCROLL | CBS_HASSTRINGS | CBS_NOINTEGRALHEIGHT | WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_TABSTOP, 24, 2, 86, 106
CONTROL "B", 1003, BUTTON, BS_OWNERDRAW | WS_CHILD | WS_VISIBLE, 116, 2, 18, 14
CONTROL "P", 1004, BUTTON, BS_OWNERDRAW | WS_CHILD | WS_VISIBLE, 135, 2, 18, 14
CONTROL "N", 1005, BUTTON, BS_OWNERDRAW | WS_CHILD | WS_VISIBLE, 154, 2, 18, 14
CONTROL "M", 1006, BUTTON, BS_OWNERDRAW | WS_CHILD | WS_VISIBLE, 173, 2, 18, 14
CONTROL "", 1001, "SysTreeView32", TVS_HASLINES | TVS_SHOWSELALWAYS | WS_CHILD | WS_BORDER | WS_TABSTOP, 4, 83, 20, 17
CONTROL "", 1007, "SysTreeView32", TVS_HASLINES | TVS_SHOWSELALWAYS | WS_CHILD | WS_BORDER | WS_TABSTOP, 28, 83, 20, 17
CONTROL "", 1011, "XDICT_TitleView", 0x50000000, 82, 21, 110, 14 , 0x00000004
CONTROL "", 1009, "XDICT_ExplainView", 0x50810000, 82, 41, 110, 96 , 0x00000004
CONTROL "", 1013, "XDICT_PlayView", 0x50000000, 4, 103, 70, 35
CONTROL "", 1012, "XDICT_StatusBar", 0x52000000, 4, 141, 188, 7
CONTROL "Tab1", 1018, "SysTabControl32", TCS_TABS | TCS_BOTTOM | TCS_FIXEDWIDTH | TCS_OWNERDRAWFIXED | TCS_FOCUSNEVER | WS_CHILD | WS_VISIBLE, 4, 21, 70, 58
CONTROL "", 1087, BUTTON, BS_OWNERDRAW | WS_CHILD, 4, 2, 17, 14
}
由此,我猜测,除了“另起炉灶”搭建“伪”标题栏和边框之外,还有另外的可以改变窗体、按钮的界面的方法,但是,小弟才疏学浅,上网查找也无济于事,不知哪位大虾有这方面的资料或者范例,望不吝赐教:)
jimweaver@zjgl.net.cn
但是,小弟用 Resource Hacker 检查了金山词霸.net 2001 的XDICT.exe(系 VC++ 生成),发现其主窗体上并没有放置任何用于“搭建”标题栏和边框的Image或Panel之类的控件,窗体的Style也是有最大化、最小化按钮和系统菜单的,而且,词霸的几个按钮(回退、前一词、后一词、主菜单)都是标准控件BUTTON的自绘风格。请看:
101 DIALOGEX 0, 0, 196, 152
STYLE WS_MAXIMIZEBOX | WS_MINIMIZEBOX | WS_POPUP | WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
EXSTYLE WS_EX_APPWINDOW
CAPTION ""
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
FONT 10, "Arial"
{
CONTROL "", 1002, COMBOBOX, CBS_DROPDOWN | CBS_OWNERDRAWVARIABLE | CBS_AUTOHSCROLL | CBS_HASSTRINGS | CBS_NOINTEGRALHEIGHT | WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_TABSTOP, 24, 2, 86, 106
CONTROL "B", 1003, BUTTON, BS_OWNERDRAW | WS_CHILD | WS_VISIBLE, 116, 2, 18, 14
CONTROL "P", 1004, BUTTON, BS_OWNERDRAW | WS_CHILD | WS_VISIBLE, 135, 2, 18, 14
CONTROL "N", 1005, BUTTON, BS_OWNERDRAW | WS_CHILD | WS_VISIBLE, 154, 2, 18, 14
CONTROL "M", 1006, BUTTON, BS_OWNERDRAW | WS_CHILD | WS_VISIBLE, 173, 2, 18, 14
CONTROL "", 1001, "SysTreeView32", TVS_HASLINES | TVS_SHOWSELALWAYS | WS_CHILD | WS_BORDER | WS_TABSTOP, 4, 83, 20, 17
CONTROL "", 1007, "SysTreeView32", TVS_HASLINES | TVS_SHOWSELALWAYS | WS_CHILD | WS_BORDER | WS_TABSTOP, 28, 83, 20, 17
CONTROL "", 1011, "XDICT_TitleView", 0x50000000, 82, 21, 110, 14 , 0x00000004
CONTROL "", 1009, "XDICT_ExplainView", 0x50810000, 82, 41, 110, 96 , 0x00000004
CONTROL "", 1013, "XDICT_PlayView", 0x50000000, 4, 103, 70, 35
CONTROL "", 1012, "XDICT_StatusBar", 0x52000000, 4, 141, 188, 7
CONTROL "Tab1", 1018, "SysTabControl32", TCS_TABS | TCS_BOTTOM | TCS_FIXEDWIDTH | TCS_OWNERDRAWFIXED | TCS_FOCUSNEVER | WS_CHILD | WS_VISIBLE, 4, 21, 70, 58
CONTROL "", 1087, BUTTON, BS_OWNERDRAW | WS_CHILD, 4, 2, 17, 14
}
由此,我猜测,除了“另起炉灶”搭建“伪”标题栏和边框之外,还有另外的可以改变窗体、按钮的界面的方法,但是,小弟才疏学浅,上网查找也无济于事,不知哪位大虾有这方面的资料或者范例,望不吝赐教:)
jimweaver@zjgl.net.cn