Always on top

I know how to make a form always on it possible to for another application to always be on top? ( ie. another application running concurrently )?
Who is Participating?
BeedleGuisConnect With a Mentor Commented:
yes . . just use the same setwindowpos api call using that applications window handle.  Let me know if you need more details.
dapumpAuthor Commented:
How would i grab that application's handle?
use one of the getwindow, getforgroundwindow.  What do you know about the application's window before you need to make the csll?  Haven't tried it yet, but I think you can use getdesktopwindow, the use getwindow passing the desktop windows handle and GW_FINDFIRST for the wcmd, then use the handle returned from that to call getwindowtext, compare the returned string to the applications title, use getwindow with that windows handle and GW_HWNDNEXT for the wcmd until the lpstring from getwindowtext = the applications title.  I'll write the routine if you want to up the points.
oops that GW_CHILD for the getwindow call with the desktops handle.
or if you want to do it the easy way:

Public Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long

handle = findwindow(vbnullstring,AppTitle)

forgot about this function

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.