I'm not sure, in which language you are doing it

.Net
If you are using an MDI Form and opening all your child windows in it,
then you should only set the TopMost Property of your main form to
true, otherwise, set the TopMost property of all the forms in your
application to true, this way, your forms will open TopMost of all the
applications..

VB6
Use SetWindowPos API to do that suff in your forms. Following is the
example from API-Guide (http://www.allapi.net)

//Form's declaration section
Const HWND_TOPMOST = -1
Const HWND_NOTOPMOST = -2
Const SWP_NOSIZE = &H1
Const SWP_NOMOVE = &H2
Const SWP_NOACTIVATE = &H10
Const SWP_SHOWWINDOW = &H40
Private Declare Sub 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)

Private Sub Form_Activate()
    'KPD-Team 1998
    'URL: http://www.allapi.net/
    'E-Mail: [EMAIL PROTECTED]
    'Set the window position to topmost
    SetWindowPos Me.hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE Or
SWP_SHOWWINDOW Or SWP_NOMOVE Or SWP_NOSIZE
End Sub


If you want to do it in all the forms, you should move the code into a
bas module and change it accordingly to accept form's hWnd property as
parameter.

Now activating/deactivating the top most position, in .Net, it's
simple, use set the TopMost property to false, in VB6 just change 
HWND_TOPMOST to  HWND_NOTOPMOST to set the form into normal position.


Waqas...



> > Members,
> >
> > Can anyone help me with a simple coding issue?
> >
> > I am sure some of you have had to deal with this before. I have been
> > trying to find the answer for a week or so and, so far, have not been
> > able to.
> >
> > The question is:
> >
> > Is there any way to code (like into a MENU command) code that will
> > allow a user to set a program to always be "On Top"?
> >
> > Such a thing would be needed in a program that runs, while other
> > programs are running; but causes the particular form to always be
> > visible. Even though someone might be working on something else like
> > MS-Word or something.
> >
> > I hope my request is clear enough. I am sure that the coding for this
> > is only about 4 lines or so. Wouldn't that make sense that something
> > so simple to do is so hard to find?


------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/k7folB/TM
--------------------------------------------------------------------~-> 


'// =======================================================
    Rules : http://ReliableAnswers.com/List/Rules.asp
    Home  : http://groups.yahoo.com/group/vbHelp/
    =======================================================
    Post  : [EMAIL PROTECTED]
    Join  : [EMAIL PROTECTED]
    Leave : [EMAIL PROTECTED]
'// =======================================================
 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/vbhelp/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to