View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Peter T Peter T is offline
external usenet poster
 
Posts: 5,600
Default Special modeless "Userform" object....

' be sure to show the form as modeless, eg in normal module
' UserForm1.Show vbModeless

Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" ( _
ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function SetWindowLongA Lib "user32" _
(ByVal hWnd As Long, _
ByVal nIndex As Long, _
ByVal dwNewLong As Long) As Long

Private Const GWL_HWNDPARENT As Long = -8

Private Sub UserForm_Initialize()
Dim hWnd As Long
hWnd = FindWindow("ThunderDFrame", Me.Caption)
SetWindowLongA hWnd, GWL_HWNDPARENT, 0&
End Sub

Search this group if you want to put minimize/restore buttons in the
caption.

Regards,
Peter T


"Robert Crandal" wrote in message
...
I know this is far-fetched, but is there any way to create a
modeless Userform that stays visible somewhere on the
desktop even when the Excel application is minimized on the
taskbar???

Thank you everyone!