窗口的自绘比较难,先上一个自绘窗口,不支持放控件,后续增加放控件
详细说明等以后有空再添加,先放上源码,好久没添加内容了,也在测试中
感谢Ycxw2008 发布的源码,这里用到了你的画关闭按钮和最小化按钮的方法
#include <DirUIGui.au3>
_GDIPlus_Startup()
$hDirUIGui = _DirUIGui_CreatWin("第十八讲GDI+窗口自绘无控件", 400, 300, -1, -1, 0)
_DirUIGui_SetWinSkin($hDirUIGui, "back.jpg")
;~ $hDirUIGui2 = _DirUIGui_CreatWin("AAAAAA", 300, 200, 1, 1, $hDirUIGui)
Const $tagMSG1 = "hwnd hWnd;uint message;wparam wParam;lparam lParam;dword time;long x;long y"
; #### message loop ####
; =====================================================
Local $tMsg = DllStructCreate($tagMSG1)
Local $pMsg = DllStructGetPtr($tMsg)
While _IsWindow($hDirUIGui)
If _GetMessage($pMsg, 0, 0, 0) < 1 Then
ExitLoop
EndIf
$sMsg = DllStructCreate($tagMSG1, $pMsg)
;鼠标左键释放,改变窗口颜色
If DllStructGetData($sMsg, "message") = $WM_LBUTTONUP Then
$r = Random(0, 255)
$g = Random(0, 255)
$b = Random(0, 255)
$color = BitOR(0xFF000000, _;Alpha
BitShift($r, -16), _;Red
BitShift($g, -8), _;Green
$b);Blue
_DirUIGui_SetWinSkin($hDirUIGui, $color)
EndIf
_TranslateMessage($pMsg)
_DispatchMessage($pMsg)
WEnd
DllCallbackFree($__DirUIGui_hProc)
_GDIPlus_Shutdown()
DirUIGui.au3部分隐藏,回复下载保存吧
|