0

On a Win32 property sheet the texts "OK", "Cancel", "Apply" and "Help" are automatically displayed in the system's language. That can be a problem if the language of a Software is different of the system's language.

For instance if a customer installs the French version of our software on an English Windows, the property sheet's content will be in French but the standard buttons at the bottom of the property sheet will be in English not matter what.

Does anybody know how can I change these texts.

Jabberwocky
  • 48,281
  • 17
  • 65
  • 115
  • You can [change the process's UI language](http://blogs.msdn.com/b/michkap/archive/2010/04/29/10003565.aspx) but I imagine this only works if you have the corresponding language pack installed. And language packs are only supported on the more expensive SKUs (like Windows 7 Ultimate and Enterprise). – arx Mar 14 '13 at 15:27
  • That's not a viable solution. – Jabberwocky Mar 22 '13 at 07:51
  • [This answer](http://stackoverflow.com/a/6709574/292432) changes the text on the Apply button. The control IDs for the OK and Cancel buttons are IDOK and IDCANCEL (see [MessageBox](http://msdn.microsoft.com/en-gb/library/windows/desktop/ms645505%28v=vs.85%29.aspx)). There is also an IDHELP (value 9) which probably corresponds to the Help button, but I haven't tried it. I would guess this is consistent across Windows versions but it's not actually documented to be. – arx Mar 22 '13 at 11:14

1 Answers1

3

Actually changing these texts is quite simple. The only thing that must be done is to derive a class from CPropertySheet, override the OnInitDialog method and change the texts in the overridden OnInitDialog.

class CMyPropertySheet : public CPropertySheet
{
public :
  CMyPropertySheet() ;

protected:
  virtual BOOL OnInitDialog();

  DECLARE_MESSAGE_MAP()
} ;

BOOL CMyPropertySheet::OnInitDialog()
{
  ...
  SetDlgItemText(IDOK, whatever..) ;
  SetDlgItemText(0x3021, whatever..) ;   // 0x3021 == IDAPPLY
  SetDlgItemText(IDCANCEL, whatever...) ;
  SetDlgItemText(IDHELP, whatever...) ;
}
Jabberwocky
  • 48,281
  • 17
  • 65
  • 115
  • Affirming that 0x3021 is recognized as IDAPPLY on my WinXp machine as well. All Buttons are aligned relative to Apply Button; thus destroying it causes all buttons to be misplaced horizontally. – user13947194 Jan 18 '22 at 21:08