Examples for Windows

Flash app indicator in Task Bar

Declare Function FlashWindow Lib "User32" (HWND As Ptr, 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
    Var 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

These can be found in Examples/Topics/Declares.

See also

Declare