Making a window stay onto


Here goes it:

I have a program that I use, I didn't create the program. Nortel Networks created the program. Unfortunately in this program there is no feature to make the
window stay on top at all times. Is there any way I can make this program stay ontop at all times? Either through the registery or what not?

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Mike TomlinsonMiddle School Assistant TeacherCommented:
If you have access to a programming language such as C or VB, then you can get a handle to the window and make it topmost using API's.

What tools are available to you?

heymanrAuthor Commented:
I have VB6
Mike TomlinsonMiddle School Assistant TeacherCommented:
Here is one way to do it using the FindWindow() and SetWindowPos() API's.  Just replace "Calculator" with the exact caption of the window you want to stay on top.

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 Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long

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

Private Sub Command1_Click()
    Dim calcWnd As Long
    calcWnd = FindWindow(vbNullString, "Calculator")
    If calcWnd <> 0 Then
        SetWindowPos calcWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE Or SWP_NOMOVE
        MsgBox "Window not found"
    End If
End Sub

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Or a more permanent solution is to use a resource editor such as this one  (there's plenty of others) to edit the resources in the appliction, and change parameters of dialogs menus etc.

Of course since someone else wrote this software, you should check if the license prohibits reverse-engineering (which it probably does!)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.