WCM Forum

WCM Forum (http://www.wcm.at/forum/index.php)
-   Programmierung (http://www.wcm.at/forum/forumdisplay.php?f=17)
-   -   Always on top (http://www.wcm.at/forum/showthread.php?t=88771)

Dane 20.02.2003 18:36

Always on top
 
Wie kann ich einem Programm das mit VisualBasic progammiert ist sagen das es immer ontop sein soll.
Kurze Beschreibung: hab mir eine soart zweite Taskleiste Programmiert aber wenn ich jetzt ein Programm starte dann verschwindet sie hinter dem Programm! Oder noch besser wäre eine möglichkeit sie fix an den Desktop zu binden!

ReiniBugman 21.02.2003 10:09

Ich habe folgendes von http://www.experts-exchange.com/Prog...ing_Languages/ Visual_Basic verwendet:


Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal x As Long, y, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Private Const HWND_TOPMOST = -1
Private Const HWND_NOTOPMOST = -2
Private Const SWP_NOMOVE = &H2
Private Const SWP_NOSIZE = &H1
Private Const TOPMOST_FLAGS = SWP_NOMOVE Or SWP_NOSIZE

Public Sub MakeNormal(hwnd As Long)
SetWindowPos hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, OPMOST_FLAGS
End Sub
Public Sub MakeTopMost(hwnd As Long)
SetWindowPos hwnd, HWND_TOPMOST, 0, 0, 0, 0, TOPMOST_FLAGS
End Sub

'Put this in your form_Load()
Call MakeTopMost(hwnd)
'If you wanna to be normal put
'Call MakeNormal(hwnd)

Dane 21.02.2003 20:38

Danke geht einwandfrei!

Sesa_Mina 21.02.2003 22:31

ein tip:

zwischendurch auch mal immer wieder aufrufen weil es andere apps gibt die sich dann doch noch "drüber" legen. Mit dem zwischendurch-aufruf verhinderst das :)


Alle Zeitangaben in WEZ +2. Es ist jetzt 06:05 Uhr.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
© 2009 FSL Verlag