PM_TranslateWindow

Note: This page includes content based on the F1 documentation for Centura development. It may be partially converted to support APF development, but should be regarded to be of uncertain actuality. It is provided as is. Eventually, it should be replaced by documentation available from within Visual Studio.

Const.PM_TranslateWindow

The Const.PM_TranslateWindow message is sent to a window to translate the window contents.

Parameters

Name Description
nWhat = wParamStandard method parameter. Possible values are Const.METHOD_Inquire, Const.METHOD_Execute, Const.METHOD_GetType
lParamUnused

Returns

When nWhat = Const.METHOD_Inquire, the return value is TRUE.

When nWhat = Const.METHOD_Execute: the return value is TRUE if the window was translated, FALSE otherwise.

Comments

Applications typically do not need to process this message since the framework does so for all framework objects. However there can be situations where an application has language-dependant data cached in variables or similar. In those cases applications should process the Const.PM_TranslateWindow message and retranslate the language dependant data in order to support run-time change of language.

Example

This example uses the Const.PM_TranslateWindow message to retranslate a custom window title when the language changes.

On PM_TranslateWindow 
   Call SalSendClassMessage( PM_TranslateWindow , wParam, lParam )
   ! Set custom window title whenever the window is translated
   Call SalSetWindowText( i_hWndFrame, TranslateConstant( TEXT_Title )
C# code
private void __dlgQuerySave_MessageActions(ref SalMessage message)
{
	#region Actions
	switch (message.Code)
	{
		
		case Sys.SAM_Create:
			this.__dlgQuerySave_OnSAM_Create(ref message);
			break;
	}
	#endregion
}

private void __dlgQuerySave_OnSAM_Create(ref SalMessage message)
{
	#region Actions
	message.Handled = true;
	Sal.SendMsg(this, Const.PM_TranslateWindow, Const.METHOD_Execute, 0);
	Sal.CenterWindow(this);
	this.dfsValue.Text = this.sValue;
	this.cbGlobal.Checked = this.bGlobal;
	if (!(this.bGlobalEditable)) 
	{
		Sal.DisableWindow(this.cbGlobal);
	}
	Sal.WaitCursor(false);
	#endregion
}