Rubrik: Maus & Tastatur | 22.03.05 |
![]() Diese Funktion setzt die Blinkzeit für Carets. | ||
Betriebssystem: Win95, Win98, WinNT 3.1, Win2000, WinME | Views: 7.329 |
Deklaration:
Declare Function SetCaretBlinkTime Lib "user32" (ByVal wMSeconds As Long) As Long
Beschreibung:
Diese Funktion setzt die Blinkzeit für Carets.
Parameter:
wMSeconds | Erwartet die neue Blinkzeit für Carets in Millisekunden. |
Rückgabewert:
Ist die Funktion erfolgreich, so wird ein Wert "ungleich 0" zurückgegeben, andernfalls derWert "0". Für erweiterte Fehlerinformationen rufen Sie die GetLastError-Funktion auf.
Beispiel:
Private Declare Function CreateCaret Lib "user32" ( _ ByVal hwnd As Long, _ ByVal hBitmap As Long, _ ByVal nWidth As Long, _ ByVal nHeight As Long) As Long Private Declare Function GetCaretBlinkTime Lib "user32" () As Long Private Declare Function SetCaretBlinkTime Lib "user32" ( _ ByVal wMSeconds As Long) As Long Private Declare Function ShowCaret Lib "user32" (ByVal hwnd As Long) As Long Dim OldBlinkTime As Long, Retval As Long
' Standard Blinkzeit für Carets ermitteln und neue setzen Private Sub Form_Load() OldBlinkTime = GetCaretBlinkTime Call SetCaretBlinkTime(200) ' Caretbitmap vorladen Picture1.AutoSize = True Picture1.Picture = LoadPicture(App.Path & "\NewCaret.bmp") End Sub
' Caret Blinkzeit wieder herstellen Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) Call SetCaretBlinkTime(OldBlinkTime) End Sub
' Caret erstellen und anzeigen Private Sub Text1_GotFocus() Retval = CreateCaret(Text1.hwnd, Picture1.Picture, 0&, 0&) Retval = ShowCaret(Text1.hwnd) End Sub