KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Determine SDI mode programmatically
PRODUCT: 4D | VERSION: 16R4 | PLATFORM: Win
Published On: September 14, 2017

In v16R4 for Windows, the SDI (Single Document Interface) is a new feature that does not require the MDI (Multiple Document Interface) window in the background anymore. The following utility method can determine if the 4D application is in SDI or MDI:

// ---------------------------------------------------------------------------
// Name: CHECK_SDI_MODE
// Description: Method will determine if the application is in SDI mode for
// Windows only.
//
// Output:
// $0 (BOOLEAN) - True - In SDI mode, False - In MDI mode (Default mode)
// ---------------------------------------------------------------------------
C_LONGINT($left;$top;$right;$bottom)
C_BOOLEAN($0)

GET WINDOW RECT($left;$top;$right;$bottom;-1)

If (($left=0) & ($top=0) & ($right=0) & ($bottom=0))
  $0:=True // SDI mode
Else
  $0:=False // MDI mode
End if


Here is an example of MDI mode:



C_TEXT($mode)

$mode:= CHECK_SDI_MODE // False


Here is an example of SDI mode:



C_TEXT($mode)

$mode:= CHECK_SDI_MODE // True


See Also: