[Win32 API] LoadIcon Function



Load the specified icon resource.


Syntax


HICON WINAPI LoadIcon(
  __in_opt  HINSTANCE hInstance,
  __in      LPCTSTR lpIconName
);



Parameters

  • hInstance[optional] : A handle to an instance of the module whose executable file contains the icon to be loaded. This parameter must be NULL when a standard icon is being loaded.
  • lpIconName : The name of the icon resource to be loaded. To use one of the predefined icons, one of the follow values.
    • ValueMeaning

      IDI_APPLICATION
      MAKEINTRESOURCE(32512)
      Default application icon.

      IDI_ASTERISK
      MAKEINTRESOURCE(32516)
      Asterisk icon. Same as IDI_INFORMATION.

      IDI_ERROR
      MAKEINTRESOURCE(32513)
      Hand-shaped icon.

      IDI_EXCLAMATION
      MAKEINTRESOURCE(32515)
      Exclamation point icon. Same as IDI_WARNING.

      IDI_HAND
      MAKEINTRESOURCE(32513)
      Hand-shaped icon. Same as IDI_ERROR.

      IDI_INFORMATION
      MAKEINTRESOURCE(32516)
      Asterisk icon.

      IDI_QUESTION
      MAKEINTRESOURCE(32514)
      Question mark icon.

      IDI_SHIELD
      MAKEINTRESOURCE(32518)
      Security Shield icon.

      IDI_WARNING
      MAKEINTRESOURCE(32515)
      Exclamation point icon.

      IDI_WINLOGO
      MAKEINTRESOURCE(32517)
      Default application icon.
      Windows 2000:  Windows logo icon. 
Return Value

HICON
if the function succeeds, the reuturn value is a handle to the newly loaded icon
if the function fails, the return value is NULL. To get extended error information, cal GetLastError.


Reference :http://msdn.microsoft.com/en-us/library/ms648029(v=VS.85).aspx

댓글

이 블로그의 인기 게시물

[Win32 API] WINAPI - 함수호출규약

JAVA Frame Icon setting

JAVA Spinner