Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win


Making a window stay onto

Posted on 2004-10-23
Medium Priority
Last Modified: 2010-04-17

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?

Question by:heymanr
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
LVL 86

Expert Comment

by:Mike Tomlinson
ID: 12390176
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?


Author Comment

ID: 12390184
I have VB6
LVL 86

Accepted Solution

Mike Tomlinson earned 500 total points
ID: 12390641
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

Assisted Solution

flubs earned 500 total points
ID: 12392729
Or a more permanent solution is to use a resource editor such as this one http://www.wilsonc.demon.co.uk/d6peresourceeditor.htm  (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!)

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
This article will show how Aten was able to supply easy management and control for Artear's video walls and wide range display configurations of their newsroom.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

604 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question