cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to change the color of standard installation progress dialog

How to change the color of standard installation progress dialog

Need to disable the themes in order to control the default appearance and this can be done by using SetWindowTheme API for an entire dialog or for an individual control. Once theme is disabled for progress control, you can use PBM_SETBKCOLOR and PBM_SETBARCOLOR to change color values.

prototype UxTheme.SetWindowTheme(HWND, string, string);

#define PBM_SETBKCOLOR (0x2001)
#define PBM_SETPOS (WM_USER+2)
#define PBM_STEPIT (WM_USER+5)
#define PBM_SETBARCOLOR (WM_USER+9)

hDlg = GetDlgItem(CmdGetHwndDlg(szDlg), ctrl_progress);
hDlg = GetDlgItem(CmdGetHwndDlg(szDlg), ctrl_progress);
UxTheme.SetWindowTheme(hDlg, "", "");
SendMessage(hDlg, PBM_SETBARCOLOR, 0, RGB(255,0,0));
SendMessage(hDlg, PBM_SETBKCOLOR, 0, RGB(180,180,180));      
SendMessage(hDlg, PBM_SETPOS, 10, 0);
for nIndex = 10 to 120 step 10
       SendMessage(hDlg, PBM_STEPIT, 0, 0); Delay(1);
endfor; 

 

Visual appearance of dialog controls is controlled by Windows Themes and it is not recommended to change it as appearance will not be consistent with other dialogs.

Was this article helpful? Yes No
No ratings
Version history
Last update:
‎Feb 02, 2021 03:38 AM
Updated by:
Contributors