Greetings,
Seen this done before - here's some code I just tried that worked:
'Paste me into the Form in the Declarations
Private Const HWND_TOPMOST = -1
Private Const HWND_NOTOPMOST = -2
Private Const SWP_NOMOVE = &H2
Private Const SWP_NOSIZE = &H1
Private Const SWP_NOACTIVATE = &H10
Private Const SWP_SHOWWINDOW = &H40
Private Const FLAGS = SWP_NOMOVE Or SWP_NOSIZE
Private Declare Function SetWindowPos Lib "user32" _
(ByVal hwnd As Long, ByVal hWndInsertAfter As Long, _
ByVal x As Long, ByVal y As Long, _
ByVal cx As Long, ByVal cy As Long, _
ByVal wFlags As Long) As Long
'Form load is the likely place to call this, but it could be done anywhere..
Private Sub Form_Load()
Call SetWindowPos(Me.hwnd, HWND_TOPMOST, 0, 0, 0, 0, FLAGS)
End Sub
------------------------------------------------------------
Just in case someone asks about doing this with a user form in VBA. this
links to an example in the script library - its moderately more difficult to
do in the VBA environment because you don't have me.Hwnd like you do in a VB
form.
http://www.bostonworkstation.com/customer_center/script_center/script_detail
s.aspx?id=206&cat=21
Regards,
Thom
Thom C. Blackwell
Product Manager
Boston Software Systems
(866) 653-5105 ex 807
www.bossoft.com <http://www.bossoft.com/>
Sign <http://www.bostonworkstation.com/customer_center/special_events.aspx>
up for my weekly webinar!
LEGAL NOTICE Unless expressly stated otherwise, this message is confidential
and may be privileged. It is intended for the addressee(s) only. Access to
this E-mail by anyone else is unauthorized. If you are not an addressee, any
disclosure or copying of the contents of this E-mail or any action taken (or
not taken) in reliance on it is unauthorized and may be unlawful. If you are
not an addressee, please inform the sender immediately, then delete this
message and empty from your trash.
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Hayes, Daniel
Sent: Monday, April 14, 2008 4:28 PM
To: [email protected]
Subject: [Talk] findwindow and setparent functions
Does anyone have any experience using the findwindow and setparent functions
in VB6?
I have a modeless user form. I want the form to float on top of a web
application. The functionality I want is similar to the 'solution explorer'
or 'properties' windows in visual studio. The form will always stay on top
of just the parent. Any help is appreciated.
Danny Hayes
Level III Engineer
Streamline Health
--------------------------------------------------------------------
The information contained in this e-mail message is intended by
Streamline Health for the use of the individual or entity to which
it is addressed and may contain information that is privileged,
confidential and protected from disclosure under applicable law.
If the reader of this message is not the intended recipient, or an
employee or agent responsible for delivering this message to the
intended recipient, you are hereby notified that any dissemination,
distribution or copying of this communication is strictly prohibited.
If you received this email in error, please notify us immediately by
replying to the message and deleting it from your computer.