本帖最后由 anythinging 于 2021-2-26 11:33 编辑
遇到个小问题,背景色和状态栏用的是同样的代码,但显示 的颜色却不一样,系统是win10帮助文件中的这句不是很理解 ,返回 RGB COLORREF 颜色, 传递颜色值必须是 16 位 BGR 颜色值, 或 RGB COLORREF 值.
感谢指点!#include <ColorConstants.au3>
#include <GUIConstantsEx.au3>
#include <GuiStatusBar.au3>
#include <WinAPITheme.au3>
Example()
Func Example()
Local $hGUI, $hStatus
Local $aParts[3] = [75, 150, -1]
; 创建 GUI
$hGUI = GUICreate("设置状态栏背景颜色", 400, 300)
GUISetBkColor(0x0000FF)
$hStatus = _GUICtrlStatusBar_Create($hGUI)
GUISetState(@SW_SHOW)
; to allow the setting of Bk Color at least under Windows 10
_WinAPI_SetWindowTheme($hStatus, "", "")
; 设置部件
_GUICtrlStatusBar_SetParts($hStatus, $aParts)
_GUICtrlStatusBar_SetText($hStatus, "部件 1")
_GUICtrlStatusBar_SetText($hStatus, "部件 2", 1)
_GUICtrlStatusBar_SetText($hStatus, "部件 3", 2)
; 设置背景颜色
;~ _GUICtrlStatusBar_SetBkColor($hStatus, $CLR_MONEYGREEN)
_GUICtrlStatusBar_SetBkColor($hStatus, 0x0000FF)
; 循环到用户退出.
Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE
GUIDelete()
EndFunc ;==>Example
|