Examples for Windows

Flash app indicator in Task Bar

Declare Function FlashWindow Lib "User32" (HWND As Integer, invert As Boolean) As Boolean
Call FlashWindow(MyWindow.Handle, True) ' flash once

Enable window compositing

Sub EnableComposite(w As DesktopWindow)
  #If TargetWindows
    Const GWL_EXSTYLE = -20
    Const WS_EX_COMPOSITED = &h2000000

    Declare Function GetWindowLongW Lib "user32" (hwnd As Ptr, nIndex As Int32) As Integer
    Dim style As Integer = GetWindowLongW(w.Handle, GWL_EXSTYLE)
    style = BitwiseOr(style, WS_EX_COMPOSITED)

    Declare Sub SetWindowLongW Lib "user32" (hwnd As Ptr, nIndex As Int32, dwNewLong As Integer)
    SetWindowLongW(w.Handle, GWL_EXSTYLE, style)
  #EndIf
End Sub

Declare example projects

  • Examples/Advanced/GetPID

  • Examples/Advanced/WindowOpacity

  • Examples/Platform-Specific/Windows/CommandLinkExample

  • Examples/Platform-Specific/Windows/CPUUsage

  • Examples/Platform-Specific/Windows/CustomWindowShape

  • Examples/Platform-Specific/Windows/DeclareDrawing

  • Examples/Platform-Specific/Windows/SetWindowIcon

See also

Declare