code_ninja Posted June 13, 2009 Share Posted June 13, 2009 I need to know how to import an icon resource from a dll file in c++. Anyone know how to do this? I'v tried googling. Link to comment Share on other sites More sharing options...
0 code.kliu.org Posted June 13, 2009 Share Posted June 13, 2009 You call LoadIcon with the HMODULE of the DLL containing the resource that you want. To get the HMODULE of the DLL, you can use GetModuleHandle if the DLL is already loaded (e.g., if it's listed in your app's import table) or LoadLibrary otherwise (be sure to remember to FreeLibrary after you are done). (If targeting NT6+, you may want to consider using LoadIconMetric or LoadIconWithScaleDown instead of LoadIcon if the icon will be scaled and you want the scaling to use a newer, better algorithm.) Link to comment Share on other sites More sharing options...
0 code_ninja Posted June 13, 2009 Author Share Posted June 13, 2009 Thanks. Link to comment Share on other sites More sharing options...
Question
code_ninja
I need to know how to import an icon resource from a dll file in c++.
Anyone know how to do this? I'v tried googling.
Link to comment
Share on other sites
2 answers to this question
Recommended Posts