Special modeless "Userform" object....

R

Robert Crandal

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!
 
P

Patrick Molloy

I don't think so, but you make the application's visible property False - ie
hide excel
 
P

Peter T

' 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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top