Questa soluzione, utile agli sviluppatori,
permette di capire in che risoluzione si trova lo schermo dell'utente.
Ciò potrebbe risultare particolarmente utile per esempio, quando
si vuole aprire un tipo di NAVIGATOR del client Notes a seconda di quale
impostazione video ci si ritrovi.
Nelle Declaration del Database Script nella inserire il seguente codice:
***************************************************
Type RECTANGLE
x1 As Long
y1 As Long
x2 As Long
y2 As Long
End Type
Declare Function GetDesktopWindow Lib "User32" () As Long
Declare Function GetWindowRect Lib "User32" (Byval hWindow
As Long, r As RECTANGLE) As Long
***************************************************
Nell'Inizialize del Database inserire il seguente codice:
***************************************************
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
***************************************************
Ed infine nel PostOpen del Database inserire il seguente codice:
***************************************************
S:= @Environment("ScreenResolution");
@If(S = "1024x768"; @Command(OpenNavigator; "Nav1024");
S = "800x600"; @Command(OpenNavigator; "Nav800");
@Command(OpenNavigator; "NavMisc"))
***************************************************
Informazioni sulla risoluzione dello schermo sfruttando le API di Windows
- 05/25/2005
- 0 commenti
0 Commenti:
Nessun Commento Trovato