Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: VB4/32,VB5,VB6
Expertise: Intermediate
Apr 7, 2001

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 Long
Private Declare Function DrawIcon Lib "user32" (ByVal hDC As Long, _
    ByVal x As Long, ByVal y As Long, ByVal hIcon As Long) As Long

Enum SystemIconConstants
    IDI_APPLICATION = 32512
    IDI_HAND = 32513
    IDI_QUESTION = 32514
    IDI_EXCLAMATION = 32515
    IDI_ASTERISK = 32516
    IDI_WINDOWS = 32517
End Enum

' draw a system icon on the specified device context

Sub 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, hIcon
End Sub
Francesco Balena
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date