Public oform1 > >oform1=Newobject("form1") >oform1.Show >Return >Define Class form1 As Form > Top = 114 > Left = 197 > DoCreate = .T. > Caption = "Form1" > l = 6956042 > Add Object command1 As CommandButton With ; > AutoSize = .T., ; > Top = 24, ; > Left = 96, ; > Height = 27, ; > Width = 208, ; > Caption = "Changer la couleur de la barre titre", ; > Name = "Command1" > Add Object command2 As CommandButton With ; > AutoSize = .T., ; > Top = 78, ; > Left = 110, ; > Height = 27, ; > Width = 181, ; > Caption = "Remettre la couleur original", ; > Name = "Command2" > Procedure changerlacouleurdelabarredetitre > Lparameters NewColor > #Define COLOR_ACTIVECAPTION 2 > Local lRet > lRet = SetSysColors(1, COLOR_ACTIVECAPTION, NewColor) > ChangeTitleBarColor = lRet > 0 > Endproc > Procedure trouverlacouleur > GetTitleBarColor1 = GetSysColor(COLOR_ACTIVECAPTION) > Return GetTitleBarColor1 > Endproc > Procedure Load > Declare Integer GetSysColor In user32 Integer nIndex > Declare Integer SetSysColors In user32; > INTEGER nChanges,; > INTEGER @ lpSysColor,; > INTEGER @ lpColorValues > > Endproc > Procedure command1.Click > Thisform.l = Thisform.trouverlacouleur() > Thisform.changerlacouleurdelabarredetitre(Rgb(255, 0, 0)) > Endproc > Procedure command2.Click > Thisform.changerlacouleurdelabarredetitre(Thisform.l) > Endproc > >EnddefineWhen I ran this program, the color of the command window changed to red. The form's title remained as is.