872777825 发表于 2011-12-22 16:02:29

多界面切换窗口加载皮肤问题




问题如图所示

小弟使用在多个窗口切换的工具里用了 论坛上 辉哥皮肤动态链接库 的皮肤

发现一切换窗口试 皮肤就失效   不知道有没办法可以处理下呢

麻烦各位老师指点一二谢谢#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Local $cB
FileInstall("wmSkin.dll",@SystemDir&"\wmSkin.dll")
DllCall ( "wmSkin.dll", "none", "wmSkin" , "int", 24,"int", 1)
$Form1 = GUICreate("Form1", 625, 443, -1, -1)
$Button1 = GUICtrlCreateButton("窗口1", 528, 40, 75, 25, $WS_GROUP)
$Button2 = GUICtrlCreateButton("窗口2", 528, 88, 75, 25, $WS_GROUP)
$Button3 = GUICtrlCreateButton("窗口3", 528, 136, 75, 25, $WS_GROUP)

$Form2 = GUICreate("Choices Dialog", 345, 252, 30, 30, $WS_CHILD,"", $Form1)
$bListBox1 = GUICtrlCreateList("", 8, 8, 137, 201)
GUICtrlSetData(-1, "Item1|Item2|Item3|Item4|Item5")
$bButton1 = GUICtrlCreateButton(">", 156, 15, 30, 25, $WS_GROUP)
$bButton2 = GUICtrlCreateButton(">>", 156, 48, 31, 25, $WS_GROUP)
$bButton3 = GUICtrlCreateButton("<", 157, 81, 31, 25, $WS_GROUP)
GUICtrlSetState(-1, $GUI_DISABLE)
$bButton4 = GUICtrlCreateButton("<<", 157, 114, 32, 25, $WS_GROUP)
$bListBox2 = GUICtrlCreateList("", 200, 8, 137, 201)
$bButton5 = GUICtrlCreateButton("&OK", 104, 225, 75, 25, $WS_GROUP)
$bButton6 = GUICtrlCreateButton("&Cancel", 184, 225, 75, 25, $WS_GROUP)
$bButton7 = GUICtrlCreateButton("&Help", 264, 225, 75, 25, $WS_GROUP)




$Form3 = GUICreate("Tabbed Notebook Dialog", 420, 320, 30, 30, $WS_CHILD,"", $Form1)
$cPageControl1 = GUICtrlCreateTab(8, 8, 396, 256)
GUICtrlSetResizing(-1, $GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
$cTabSheet1 = GUICtrlCreateTabItem("TabSheet1")
$cTabSheet2 = GUICtrlCreateTabItem("TabSheet2")
$cTabSheet3 = GUICtrlCreateTabItem("TabSheet3")
GUICtrlCreateTabItem("")
$cB = GUICtrlCreateButton("&OK", 166, 272, 75, 25, $WS_GROUP)
$cB = GUICtrlCreateButton("&Cancel", 246, 272, 75, 25, $WS_GROUP)
$cB = GUICtrlCreateButton("&Help", 328, 272, 75, 25, $WS_GROUP)




$Form4 = GUICreate("About", 340, 253, 30, 30, $WS_CHILD,"", $Form1)
$dGroupBox1 = GUICtrlCreateGroup("", 8, 8, 305, 185)
$dLabel1 = GUICtrlCreateLabel("Product Name", 152, 24, 72, 17, $WS_GROUP)
$dLabel2 = GUICtrlCreateLabel("Version", 152, 48, 39, 17, $WS_GROUP)
$dLabel4 = GUICtrlCreateLabel("Comments", 16, 160, 53, 17, $WS_GROUP)
$dLabel3 = GUICtrlCreateLabel("Copyright", 16, 136, 48, 17, $WS_GROUP)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$dButton1 = GUICtrlCreateButton("&OK", 112, 208, 75, 25, $WS_GROUP)

Local $Current = ""

GUISetState(@SW_SHOW, $Form1)


While 1
      $nMsg = GUIGetMsg()
      Switch $nMsg
                Case $GUI_EVENT_CLOSE
                        Exit
                Case $Button1
                        If $Current <> "" Then GUISetState(@SW_HIDE, $Current)
                        GUISetState(@SW_SHOW, $Form2)
                        $Current = $Form2
                Case $Button2
                        If $Current <> "" Then GUISetState(@SW_HIDE, $Current)
                        GUISetState(@SW_SHOW, $Form3)
                        $Current = $Form3                        
                Case $Button3
                        If $Current <> "" Then GUISetState(@SW_HIDE, $Current)
                        GUISetState(@SW_SHOW, $Form4)
                        $Current = $Form4                        
      EndSwitch
WEnd皮肤附件

menfan1 发表于 2011-12-22 17:42:01

很简单,多次加载皮肤呗呵呵

872777825 发表于 2011-12-22 18:17:19

额拿也不行滴。。。。 难道这个问题没办法解决

872777825 发表于 2011-12-22 18:18:29

难道注定我这个工具 不能使用皮肤 ?
试过换另种写法但由于东西太多    切换的时候效果不理想就这种写法灰常好可惜皮肤呀 可惜呀

menfan1 发表于 2011-12-23 09:06:00

你把代码发给我试试看哈

64202171 发表于 2011-12-23 10:20:03

思想很不错。值得学习

872777825 发表于 2011-12-23 22:49:02

回复 5# menfan1


    到嘛全部在上面呀

menfan1 发表于 2011-12-24 10:16:44

在GUISetState(@SW_SHOW, $Form2)
GUISetState(@SW_SHOW, $Form3)
GUISetState(@SW_SHOW, $Form4)前都再加载一次皮肤吧
页: [1]
查看完整版本: 多界面切换窗口加载皮肤问题