[API]
LoadImageA

[INCLUDE]
IsHighColor

[CODE]
Public Function LoadResEx_Image_MultiColor(ByVal ResID As Long, ByVal ResType As Long, Optional ByVal DesiredSize As Long = 32&) As Long
  Dim xFlags As Long
  
  If resType = 0& Then
    xFlags = &H2040&
    DesiredSize = 0&
    End If

  #If LoadResEx_SetThemeFile Then
    LoadResEx_Image_MultiColor = LoadImageA(LoadResEx_ThemeFile_hModule, ByVal (ResID - CLng(IsHighColor)), ResType, DesiredSize, DesiredSize, xFlags)
    If Not LoadResEx_Image_MultiColor = 0& Then Exit Function
    LoadResEx_Image_MultiColor = LoadImageA(LoadResEx_ThemeFile_hModule, ByVal ResID, ResType, DesiredSize, DesiredSize, xFlags)
    If Not LoadResEx_Image_MultiColor = 0& Then Exit Function
    #End If
  LoadResEx_Image_MultiColor = LoadImageA(App.hInstance, ByVal (ResID - CLng(IsHighColor)), ResType, DesiredSize, DesiredSize, xFlags)
  If Not LoadResEx_Image_MultiColor = 0& Then Exit Function
  LoadResEx_Image_MultiColor = LoadImageA(App.hInstance, ByVal ResID, ResType, DesiredSize, DesiredSize, xFlags)
#If InIDE And LoadResEx_SetLanguageFile Then
  If Not LoadResEx_Image_MultiColor = 0& Then Exit Function
  LoadResEx_Image_MultiColor = LoadImageA(LoadResEx_LanguageFile_hModule, ByVal (ResID - CLng(IsHighColor)), ResType, DesiredSize, DesiredSize, xFlags)
  If Not LoadResEx_Image_MultiColor = 0& Then Exit Function
  LoadResEx_Image_MultiColor = LoadImageA(LoadResEx_LanguageFile_hModule, ByVal ResID, ResType, DesiredSize, DesiredSize, xFlags)
#End If
  End Function