Domino Code Fragment

Code Name*
Set a dialog box to "always on-top"
Date*
04/29/2024
Source (or email address if you prefer)*
Rlatulippe@romac.com
IP address:.3.145.130.31
Description*
Editor's Note (11/30/95): This example uses 16 bit Windows API calls and will not work in the 32 bit. For the same functionality in the 32 bit version of Word Pro, change the Declare statements to the appropriate 32 bit Window API call. Place the following declarations in the Globals, and the Dialogevent code in your dialog box object, and the dialog box will be set to be always on top, even when you switch to another application. Note: this will probably not work with dialog bars, since they are child windows of Word Pro, not top level windows like normal dialogs. Note2: This will be slighly easier (and more robust) when the GetHwnd method is implemented for CustomDialog.
Type*
LotusScript
Categories*
(Misc)
Implementation:
Required Client:
Server:
Limitations:
Comments:
Files/Graphics attachments (if applicable): Code:
Declare Function FindWindow Lib "User" (Byval lpClassName As Any, Byval lpWindowName As Any) As Integer
Declare Sub SetWindowPos Lib "User" (Byval hWnd As Integer, Byval hWndInsertAfter As Integer, Byval X As Integer, Byval Y As Integer, Byval cx As Integer, Byval cy As Integer, Byval wFlags As Integer)

Const HWND_TOPMOST = -1
Const SWP_NOMOVE = &H2
Const SWP_NOSIZE = &H1

Const DlgOpened = 7001

Sub Dialogevent(Source As Customdialog, Controlid As Integer, Why As Integer)
If (Why = DlgOpened) Then
hWnd = FindWindow(0&, Source.Text)
SetWindowPos hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE+SWP_NOSIZE
End If
End Sub