How to Load Icon
-
Hi , Iam using the following code to load an icon
HICON hIconImage; hIconImage = (HICON)LoadImage(NULL, MAKEINTRESOURCE (IDR_ICON ), IMAGE_ICON, ICON_SIZE, ICON_SIZE, LR_LOADTRANSPARENT|LR_CREATEDIBSECTION );
But hIconImage is NULL after the loading. Regards, FarPointer -
Hi , Iam using the following code to load an icon
HICON hIconImage; hIconImage = (HICON)LoadImage(NULL, MAKEINTRESOURCE (IDR_ICON ), IMAGE_ICON, ICON_SIZE, ICON_SIZE, LR_LOADTRANSPARENT|LR_CREATEDIBSECTION );
But hIconImage is NULL after the loading. Regards, FarPointerYour first parameter of the LoadImage is (Taken from MSDN:) "hinst [in] Handle to an instance of the module that contains the image to be loaded. To load an OEM image, set this parameter to zero." so why do you use NULL? use something like AfxGetInstanceHandle().... Ask not what your application can do for you, Ask what you can do for your application
-
Hi , Iam using the following code to load an icon
HICON hIconImage; hIconImage = (HICON)LoadImage(NULL, MAKEINTRESOURCE (IDR_ICON ), IMAGE_ICON, ICON_SIZE, ICON_SIZE, LR_LOADTRANSPARENT|LR_CREATEDIBSECTION );
But hIconImage is NULL after the loading. Regards, FarPointerif icon is in resoruce use LoadIcon(AfxGetApp()->m_hInstance,name icon);