Make a window always on top (of every window..always) 
Author Message
 Make a window always on top (of every window..always)

I have a Active X exe that I use from my main application, that takes care of
things like progress bars, and "Please Wait" animations (because of the
blocking that occurs in my main program, I needed to run these things in a
seperate thread).

Anyway, I want to always show the forms within the ActiveX exe to be always on
top of every window in my main application, and in one case, I want the form to
be display above all windows in the entire OS. Is there a way to do this with
Win32...(there must be)



Mon, 09 Oct 2000 03:00:00 GMT  
 Make a window always on top (of every window..always)

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
    Const HWND_TOPMOST = -1
    Const HWND_NOTOPMOST = -2
    Const SWP_NOMOVE = &H2
    Const SWP_NOSIZE = &H1
    Dim lngWindowPosition As Long

Private Sub ChckTop_Click()
    If ChckTop.Value = 1 Then
    lngWindowPosition = SetWindowPos(frmTime.hwnd, _
                                           HWND_TOPMOST, _
                                           0, _
                                           0, _
                                           0, _
                                           0, _
                                           SWP_NOMOVE Or SWP_NOSIZE)
    Else
    lngWindowPosition = SetWindowPos(frmTime.hwnd, _
                                           HWND_NOTOPMOST, _
                                           0, _
                                           0, _
                                           0, _
                                           0, _
                                           SWP_NOMOVE Or SWP_NOSIZE)
    End If
End Sub

This does that with a check box and an API call. It will keep this window above ALL
other windows.

Quote:

> I have a Active X exe that I use from my main application, that takes care of
> things like progress bars, and "Please Wait" animations (because of the
> blocking that occurs in my main program, I needed to run these things in a
> seperate thread).

> Anyway, I want to always show the forms within the ActiveX exe to be always on
> top of every window in my main application, and in one case, I want the form to
> be display above all windows in the entire OS. Is there a way to do this with
> Win32...(there must be)



Mon, 09 Oct 2000 03:00:00 GMT  
 Make a window always on top (of every window..always)


Quote:
>I have a Active X exe that I use from my main application, that takes care of
>things like progress bars, and "Please Wait" animations (because of the
>blocking that occurs in my main program, I needed to run these things in a
>seperate thread).

>Anyway, I want to always show the forms within the ActiveX exe to be always on
>top of every window in my main application, and in one case, I want the form to
>be display above all windows in the entire OS. Is there a way to do this with
>Win32...(there must be)

Look at the SetWindowPos API, with the HWND_TOPMOST flag set.  
Also, it is possible to start a new thread in VB5 standard EXE...so
using an ActiveX EXE is not totally needed...

Donkey

????????????????????????????????????????????
DOS never says "EXCELLENT command or filename"
-
Note: remove "NOSPAM" from my address
to e-mail me
????????????????????????????????????????????



Mon, 09 Oct 2000 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Making Always On Top windows

2. Windows ALWAYS on top ...

3. Setting the Always On Top Flag for a Browser Window

4. force window always on top?

5. Always on top window

6. Always on top window

7. Showing inactive windows on top or showing always...

8. Application window always on top?

9. always on top of my windows

10. Does anybody know how to make an external applicatoin's window always stay on top

11. Keep my window, always on top?

12. Help, I want my form ALWAYS staying on top of ANY other window

 

 
Powered by phpBB® Forum Software