🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: pl.comp.lang.vbasic
2 messages
2 total messages Started by Jabberwock Wed, 26 Nov 1997 17:09
Jak zrobic aplikacje "always on top" w VB4?
#213
Author: Jabberwock
Date: Wed, 26 Nov 1997 17:09
3 lines
640 bytes
Pytanie jak w temacie...

Jabberwock
Re: Jak zrobic aplikacje "always on top" w VB4?
#214
Author: Pawel
Date: Wed, 26 Nov 1997 20:46
54 lines
2232 bytes
Jabberwock wrote:
> 
> Pytanie jak w temacie...
> 
> Jabberwock

Dwie procedury:

Sub OnTopOff(frm As Form)
    
    'Wylaczenie "always on top"
    SetWindowPos frm.hWnd, HWND_NOTOPMOST, frm.Left / 15, _
             frm.Top / 15, frm.Width / 15, _
             frm.Height / 15, SWP_NOACTIVATE Or SWP_SHOWWINDOW

End Sub

Sub OnTopOn(frm As Form)
        
    'Zalaczenie "Always on top"
    SetWindowPos frm.hWnd, HWND_TOPMOST, frm.Left / 15, _
            frm.Top / 15, frm.Width / 15, _
            frm.Height / 15, SWP_NOACTIVATE Or SWP_SHOWWINDOW

End Sub

i kilka deklaracji ...

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_NOACTIVATE = &H10
Const SWP_SHOWWINDOW = &H40


Mozesz teraz ustawic dowolna forme na "always on top" wywolujac funkcje:

OnTopOn Me          'zalaczenie
OnTopOff Me         'wylaczenie

Oczywiscie, wywolanie musi byc z formy (najlepien w Sub Form_Load() )

Pozdrawiam,

-- 
 ============================================================
     MikroSysteM                                 Pawel Rosiak
 01-499 Warszawa 46            mailto:MikroSysteM@WriteMe.com
     Po. Box. 44             http://www.medianet.pl/~msystem/
 ============================================================
 CONGRESS.SYS Corrupted. Re-boot the Washington D.C (Y / N) ?
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads