Rubrik: Fenster | 22.03.05 |
PostQuitMessage-Funktion Diese Funktion beendet den aktuellen Thread. Dies ist die normale Reaktion auf eine "WM_DESTROY"-Fensternachricht. | ||
Betriebssystem: Win95, Win98, WinNT 3.1, Win2000, WinME | Views: 7.713 |
Deklaration:
Declare Sub PostQuitMessage Lib "user32" (ByVal nExitCode As Long)
Beschreibung:
Diese Funktion beendet den aktuellen Thread. Dies ist die normale Reaktion auf eine "WM_DESTROY"-Fensternachricht.
Parameter:
nExitCode | Erwartet den Beendigungscode eines Programms. Dies kannz.B. der "wParam"-Wert der "WM_QUIT"-Fensternachricht sein. |
Rückgabewert:
keine
Beispiel:
Private Declare Function SetLayeredWindowAttributes Lib "user32" ( _ ByVal hWnd As Long, _ ByVal crKey As Long, _ ByVal bAlpha As Byte, _ ByVal dwFlags As Long) As Long Private Declare Function GetWindowLong Lib "user32" _ Alias "GetWindowLongA" ( _ ByVal hWnd As Long, _ ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" _ Alias "SetWindowLongA" ( _ ByVal hWnd As Long, _ ByVal nIndex As Long, _ ByVal dwNewLong As Long) As Long Private Declare Sub PostQuitMessage Lib "user32" (ByVal nExitCode As Long) ' eine der Get-/ SetWindowLong-Konstanten Private Const GWL_EXSTYLE = (-20) ' Erweiterte Fensterstile ' SetLayeredWindowAttributes dwFlags-Konstanten Private Const LWA_COLORKEY = &H1 ' Die angegebene Farbe soll transparent erscheinen Private Const LWA_ALPHA = &H2 ' Das ganze Fenster soll transparent wirken ' einer der Standard-Fensterstile Private Const WS_EX_LAYERED = &H80000 ' (Windows 2000/XP) Fenstertyp "Layered"
' Fenster transparent machen Private Sub Form_Load() Dim Retval As Long ' Fensterstil auf Layered setzen Call SetWindowLong(Me.hWnd, GWL_EXSTYLE, GetWindowLong(Me.hWnd, _ GWL_EXSTYLE) Or WS_EX_LAYERED) ' Transparenzeffekt erstellen SetLayeredWindowAttributes Me.hWnd, 0, 96, LWA_ALPHA End Sub
' Programm beenden (Achtung!! die IDE wird auch beendet) Private Sub Command1_Click() Call PostQuitMessage(0) End Sub