guides:programming:programmers_reference_manual:start_window

Start_Window function

Executes a specified OpenInsight window (form), or returns its structure as a dynamic array so it can be modified before execution.

InstanceID = Start_Window( WindowID, 
                              OwnerID,
                              CreateParam,
                              GetStructureFlag,
                              Reserved )
NameRequiredDescription
WindowIDYesName of the window to execute. Must be in upper-case.
OwnerIDNoName of the window that "owns" the new window. Must be in upper-case.



Windows that have an owner window always appear in front of their owner and are minimized when the owner is. They are also automatically destroyed when the owner is destroyed.
CreateParamNoData to pass to the window's CREATE event. This data is passed as the "CreateParam" argument when the CREATE event is triggered.
GetStructureFlagNoIf TRUE$ then the window is not executed. Rather it's structure is returned as a dynamic array.

If GetStructureFlag is FALSE$ or omitted then the Instance ID of the newly executed window is returned if successful. Null is returned if the window fails to start. The instance ID is usually the same as the passed Window ID, but if the window is flagged as multi-instance then the PS can append a unique number (delimited with an "*" character) to the returned ID to ensure that there are no conflicts with existing windows.

If GetStructureFlag is TRUE$ then a dynamic array containing the window structure (along with the structure for any child controls) is returned instead. This structure may be adjusted and then passed to the SYSTEM CREATE method to execute the window instead.

In the event of an error the Start_Window function returns null. Error information may be obtained via the Get_Status function.

The basic structure for a window object is described in the PS_EQUATES and PS_WINDOW_EQUATES insert records.

The window's CREATE event (if any) will be triggered before Start_Window returns.

Do not use this function to create an MDI child window – use the Start_MDIChild function instead.

 
//// Start a standalone window on the desktop passing it a record//
   //// ID to process in its CREATE event.//
   RowID      = "X12W"
   InstanceID = Start_Window( "MYFORM", "", RowID, FALSE$ )
   If BLen( InstanceID ) Then
      //// The form executed successfully//
   End Else
      ErrorText = ""
      If Get_Status( ErrorText ) Then
         //// Handle the error//
      End
   End
   
   //// Start a standalone window on the desktop with the current window//
   //// as the owner//
   InstanceID = Start_Window( "MYFORM", @Window, "", FALSE$ )
   If BLen( InstanceID ) Then
      //// The form executed successfully//
   End Else
      ErrorText = ""
      If Get_Status( ErrorText ) Then
         //// Handle the error//
      End
   End
   
   //// Get the structure of the MYFORM window, modify it, and then create//
   //// it "manually"//
   WinStruct = Start_Window( "MYFORM", "", "", TRUE$ )
   If BLen( WinStruct ) Then
      //// We have the structure - process it as needed and then execute//
      
      //// ... processing ...//
      
      //// Now execute//
      CreateVal = Exec_Method( "SYSTEM", "CREATE", WinStruct )
      
   End Else
      ErrorText = ""
      If Get_Status( ErrorText ) Then
         //// Handle the error//
      End
   End
 
 
 

Dialog_Box function, End_Window function, Start_MDIChild function, SYSTEM CREATE method, OWNER property, WINDOW object, WINDOW CREATE event.

  • guides/programming/programmers_reference_manual/start_window.txt
  • Last modified: 2024/10/14 18:18
  • by 127.0.0.1