[INCLUDE]
LoadResEx_Icon_Shared

[CODE]
Public Function LoadResEx_Icon(ByVal ResID As Long, Optional ByVal DesiredSize As Long = 32&) As Long
  Dim xLong1 As Long
    
  For xLong1 = LoadResex_Caps_WinDIcon To 0& Step -1&
    If IconIDIsUseable(xLong1, LoadResex_Caps_WinDIcon) Then
#If InIDE And LoadResEx_LanguageFile Then
      LoadResEx_Icon = LoadImageA(LoadResEx_LanguageFile_hModul, byval (ResID + xLong1), 1&, DesiredSize, DesiredSize, 0&)
#Else
      LoadResEx_Icon = LoadImageA(App.hInstance, byval (ResID + xLong1), 1&, DesiredSize, DesiredSize, 0&)
#End If
      If Not LoadResEx_Icon = 0& Then Exit For
      End If
    Next
  End Function