MCPcopy Create free account
hub / github.com/AutoHotkey/AutoHotkey / ControlSetProgressOptions

Method ControlSetProgressOptions

source/script_gui.cpp:9802–9823  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9800
9801
9802void GuiType::ControlSetProgressOptions(GuiControlType &aControl, GuiControlOptionsType &aOpt, DWORD aStyle)
9803// Caller has ensured that aControl.type is Progress.
9804// Caller has ensured that aOpt.color_bk is CLR_INVALID if no change should be made to the
9805// bar's current background color.
9806{
9807 // If any options are present that cannot be manifest while a visual theme is in effect, ensure any
9808 // such theme is removed from the control (currently, once removed it is never put back on):
9809 // Override the default so that colors/smooth can be manifest even when non-classic theme is in effect.
9810 if ( IS_AN_ACTUAL_COLOR(aOpt.color)
9811 || IS_AN_ACTUAL_COLOR(aOpt.color_bk)
9812 || (aStyle & PBS_SMOOTH))
9813 SetWindowTheme(aControl.hwnd, L"", L""); // Remove theme if options call for something theme can't show.
9814
9815 if (aOpt.range_min || aOpt.range_max) // Must check like this because although it valid for one to be zero, both should not be.
9816 SendMessage(aControl.hwnd, PBM_SETRANGE32, aOpt.range_min, aOpt.range_max);
9817
9818 if (aOpt.color != CLR_INVALID) // Explicit color change was requested.
9819 SendMessage(aControl.hwnd, PBM_SETBARCOLOR, 0, aOpt.color);
9820
9821 if (aOpt.color_bk != CLR_INVALID) // Explicit color change was requested.
9822 SendMessage(aControl.hwnd, PBM_SETBKCOLOR, 0, aOpt.color_bk);
9823}
9824
9825
9826

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected