Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Icons from dll file
-
Hi, I am building application for windows and I would like to get icons for :"save", "save_as", "open" and "close" from windows standard icons which are stored at C://windows/system32/imageres.dll
Is there anyway to extract icons from c++ in Qt or maybe load whole dll file as a resource to my project.
Kind regards.
-
dll resources are Windows specific so there's no direct way to do that in Qt, but it should be easy with minimum platform specific code. Just load the icon using LoadImage and then you can convert it to Qt's QPixmap with the QtWinExtras module's fromHICON.
-
@VrtniPatuljak
actually there is already an example available
-
@Chris-Kawa Can you please write a simple code for LoadImage since I don't get the HINSTACE part. Idea is to get icons from C://Windows/system32/imageres.dll with exact numbers (like 100, 200 ,300 ,400).
-
@raven-worx this actually works, I have found that example before but try it only in my virtual machine where it did not work. However I have run it now in a real pc and it works perfectly. Thank you a lot ^^