API
@-Formulas
JavaScript
LotusScript
Reg Exp
Web Design
Notes Client
XPages
 
Determine User Screen Resolution
If you would like to open a different navigator based on the user's screen resolution, there is a pretty easy way to do it using the Windows API (assuming your clients are Windows clients).

In the Database Script, go to the (Declarations) section and insert the following LotusScript code:

Type RECTANGLE
   x1 As Long
   y1 As Long
   x2 As Long
   y2 As Long
End Type


'Note: The following declare statements are case sensitive.

Declare Function GetDesktopWindow Lib "User32" () As Long
Declare Function GetWindowRect Lib "User32" (Byval hWindow As Long, r As RECTANGLE) As Long


Next, in the Initialize event for the database, use the Windows API libraries defined above to read the screen resolution and set an environment variable. The reason we do this is because it's easier to open a navigator with @Command than with LotusScript, so we'll use @Commands in the PostOpen event (see below) to open the navigator. But we have to use LotusScript to read the API. Since they can't be intermixed in the same function, use script in the Initialize which will run before the PostOpen. Here's the code for the Database Script, Initialize event:

Sub Initialize
   Dim s As New NotesSession
   Dim R As RECTANGLE
   Dim hWindow As Long
   Dim RC As Long
   Dim WindowResolution As String
   hWindow = GetDesktopWindow ()
   RC = GetWindowRect(hWindow, R)
   WindowResolution = (R.x2 - R.x1) & "x" & (R.y2 - R.y1)
   Call s.SetEnvironmentVar("ScreenResolution", WindowResolution)
End Sub


Finally, in the PostOpen event for the database, read the environment variable set in the Initialize event and then use that value to decide which navigator to open. For example:

S := @Environment("ScreenResolution");
@If(S = "1024x768"; @Command(OpenNavigator; "Nav1024"); S = "800x600"; @Command(OpenNavigator; "Nav800"); @Command(OpenNavigator; "NavMisc"))