DrawSystemIcon – Draw a system icon on any device context

Private Declare Function LoadIconByID Lib "user32" Alias "LoadIconA" (ByVal _    hInstance As Long, ByVal lpIconName As Long) As LongPrivate Declare Function DrawIcon Lib "user32" (ByVal hDC As Long, _    ByVal x As Long, ByVal y As Long, ByVal hIcon As Long) As LongEnum SystemIconConstants    IDI_APPLICATION = 32512    IDI_HAND = 32513    IDI_QUESTION = 32514    IDI_EXCLAMATION = 32515    IDI_ASTERISK = 32516    IDI_WINDOWS = 32517End Enum' draw a system icon on the specified device contextSub DrawSystemIcon(ByVal icon As SystemIconConstants, ByVal hDC As Long, _    ByVal x As Long, ByVal y As Long)    Dim hIcon As Long    ' get the handle of the icon    hIcon = LoadIconByID(0, icon)    ' draw it onto the specified device context    DrawIcon hDC, x, y, hIconEnd Sub

Share the Post:
Share on facebook
Share on twitter
Share on linkedin


Recent Articles: