Visual Basic Question - Always on Top 
Author Message
 Visual Basic Question - Always on Top

I've just made a little program that allows users to select
which language (ie. french or german) they wish to view a
multimedia presentation in. I also have another little button
that closes the multimedia presentation and switches back to the language
selection screen. As the multimedia and language selection applications will be
running on a touch  screen with no keyboard interface I want the button to be
'always on top'. I know this can be done as the Windows Clock can be set to be
always on top and so can help files. Does anyone know how to do this?

Thanks in advance and anticipation



Fri, 14 May 1999 03:00:00 GMT  
 Visual Basic Question - Always on Top


| I've just made a little program that allows users to select
| which language (ie. french or german) they wish to view a
| multimedia presentation in. I also have another little button
| that closes the multimedia presentation and switches back to the language

| selection screen. As the multimedia and language selection applications
will be
| running on a touch  screen with no keyboard interface I want the button
to be
| 'always on top'. I know this can be done as the Windows Clock can be set
to be
| always on top and so can help files. Does anyone know how to do this?
|
| Thanks in advance and anticipation
|
You need to call a DLL function called  SetWindowPos (it's in
win32api.txt).
Define a function like:

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

Public Const SWP_NOSIZE = &H1
Public Const SWP_NOMOVE = &H2
Public Const FLAGS As Long = SWP_NOMOVE Or SWP_NOSIZE
Public Const HWND_TOPMOST = -1
Public Const HWND_NOTOPMOST = -2

Call it like:
Private Sub optTopmost_Click()
    SetWindowPos frmtopmost.hwnd, HWND_TOPMOST, 0, 0, 0, 0, FLAGS
End Sub

Good luck



Fri, 14 May 1999 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Visual Basic Always on Top

2. Always on top (ALWAYS)

3. Make a form always on top - always

4. Make a window always on top (of every window..always)

5. Always On Top - Form Question

6. Always on top question

7. Help.. VB 4.0 Form question-always on top

8. See how you compare to our Top Ten List of Visual Basic Programmers

9. TOP Visual Basic positions in NYC

10. The top Visual Basic books are reviewed

11. The top Visual Basic books are reviewed

12. The top Visual Basic books are reviewed

 

 
Powered by phpBB® Forum Software