SessionCreateWindow

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.

SalWindowHandle SessionCreateWindow( SalString sWindowName,
SalWindowHandle hWndParent )

The SessionCreateWindow method creates modeless dialog boxes, MDI windows, form windows, and top-level table windows at runtime, transferring all "globals".

Parameters

Name Description
SalString sWindowName Name of the form window, table window or dialog box to be created. This parameter should be a packed message if globals are meant to change.
SalWindowHandle hWndParent The handle (or name) of the owner window. Specify hWndNULL if there is no owner window.

Returns

The return value is the handle of the created window, or hWndNULL if the window could not be created.

Comments

Applications should use SessionCreateWindow instead of SalCreateWindow where it is desirable (for instance when starting a details window from an overview) that the created window gets the same user globals (e.g. COMPANY_ID and PROCESS) as the window from which it was created.

If any of the user globals should be converted to another value during the startup this can be done by passing a packed message instead of just a window name. The message passed should contain beside the START_WINDOW attribute that should contain the name of the window to start. Also any global to change as an attribute. Both Pack and PackComment messages are recognized.

It is not possible to create windows with parameters using SessionCreateWindow.

Example

Function: UM_ShowDetails
   Actions
       ! Start the customer details window
       Call ..DataSourcePrepareKeyTransfer( 'frmCustomerDetails' )
       If SessionCreateWindow ( 'frmCustomerDetails', hWndMDI ) != hWndNULL
          Return TRUE
       Else
          Return FALSE 
       ! Start Tab window in special version 
       Call Msg.Construct( ) 
       Call Msg.AddAttribute( 'START_WINDOW', 'frmTabWindow' )
       Call Msg.AddAttribute( 'VERSION', 'INVOICE' )
       Return SessionCreateWindow( Msg.Pack( ), hWndMDI ) 
new C# coding sample
case Ifs.Fnd.ApplicationForms.Const.METHOD_Execute:
	Sal.WaitCursor(true);
	hWndSource = this;
	sSourceName = "PROJ_RESOURCE_SUM_HEADER";
	sItemNames[0] = "RESOURCE_ID";
	hWndItems[0] = colResourceId;
	Ifs.Fnd.ApplicationForms.Var.DataTransfer.Init(sSourceName, 
hWndSource, sItemNames, hWndItems); Msg.Construct(); Msg.AddAttribute("VERSION", "STRUCTURE"); Msg.SetName("frmResourceSumGraph"); sVersion = "frmResourceSumGraph@VERSION=STRUCTURE^"; bOk = SessionCreateWindow(sVersion, Sys.hWndMDI); Sal.WaitCursor(false); return true;