Rubrik: System/Windows · Desktop/Bildschirm/Display | VB-Versionen: VB4, VB5, VB6 | 12.10.04 |
Desktop refreshen Dieser Tipp zeigt, wie sich der Windows-Desktop refreshen lässt, so als hätte man F5 gedrückt. | ||
Autor: Dieter Otter | Bewertung: | Views: 15.196 |
www.tools4vb.de | System: Win9x, WinNT, Win2k, WinXP, Win7, Win8, Win10, Win11 | Beispielprojekt auf CD |
Nachfolgender Tipp zeigt, wie sich der Desktop refreshen lässt, so als hätte man die F5-Taste gedrückt.
Option Explicit ' Benötigte API-Deklarationen Private Declare Function InvalidateRect Lib "user32" ( _ ByVal hwnd As Long, _ lpRect As Any, _ ByVal bErase As Long) As Long Private Type RECT Left As Long Top As Long Right As Long Bottom As Long End Type
' Desktop aktualisieren Public Sub DesktopRefresh() Dim nResult As Long nResult = InvalidateRect(0&, 0&, False) If nResult <> 0 Then Call InvalidateRect(0&, 0&, False) End If End Sub