Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Icons from dll file

Icons from dll file

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 2.1k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • VrtniPatuljakV Offline
    VrtniPatuljakV Offline
    VrtniPatuljak
    wrote on last edited by
    #1

    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.

    raven-worxR 1 Reply Last reply
    0
    • Chris KawaC Online
      Chris KawaC Online
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by
      #2

      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.

      VrtniPatuljakV 1 Reply Last reply
      2
      • VrtniPatuljakV VrtniPatuljak

        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.

        raven-worxR Offline
        raven-worxR Offline
        raven-worx
        Moderators
        wrote on last edited by
        #3

        @VrtniPatuljak
        actually there is already an example available

        --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
        If you have a question please use the forum so others can benefit from the solution in the future

        VrtniPatuljakV 1 Reply Last reply
        3
        • Chris KawaC Chris Kawa

          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.

          VrtniPatuljakV Offline
          VrtniPatuljakV Offline
          VrtniPatuljak
          wrote on last edited by
          #4

          @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).

          1 Reply Last reply
          0
          • raven-worxR raven-worx

            @VrtniPatuljak
            actually there is already an example available

            VrtniPatuljakV Offline
            VrtniPatuljakV Offline
            VrtniPatuljak
            wrote on last edited by
            #5

            @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 ^^

            1 Reply Last reply
            0
            • T Trung FPT referenced this topic on

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved