Solved How can i pack several png files into a dll as icons?


bluedxca93

Member
Local time
8:46 AM
Posts
23
OS
24h2 , 24.10

Hi everyone,

I've recently written a minimal file manager called cabinet using GTK3 and MSYS2, and I'm trying to figure out how to pack PNG icons into a DLL so that they can be accessed by my application at runtime. I would appreciate any guidance or examples on how to achieve this. Below are the details of my setup and what I've tried so far.

Current Setup​

  • Operating System: Windows 11
  • Development Environment: MSYS2
  • Graphics Library: GTK3
  • Programming Language: C/C++

Requirements​

  1. Pack PNG Icons: I want to bundle several PNG icons into a single DLL file.
  2. Load Icons at Runtime: The application should be able to load these icons during runtime.

What I Have Tried​

  1. As a temporary solution, I placed the PNG files in the same directory as the executable. However, this isn't ideal for deployment.
I would appreciate if someone could guide me through the process of creating a DLL with embedded PNG icons. Specifically:
  1. Creating the DLL:
    • What tools and commands should I use in MSYS2 to create a DLL?
    • How should I structure the project directory?
  2. Embedding PNG Files:
    • What is the best way to embed PNG files into the DLL?
    • Are there specific tools or libraries I should use?
  3. Loading Icons in GTK:
    • How can I access and load these icons from the DLL at runtime?
    • Are there specific GTK functions or techniques I should be aware of?
icon-fix.webp

Using the windows api just will not wirk as SII_COPY or STD_COPY and so on is broken on windows 11 due to gui redesign and msys2 mi9ngw compiler.

Best regards,
bluedxca93
 
Last edited:

My Computer

System One

  • OS
    24h2 , 24.10
    Computer type
    PC/Desktop
    Manufacturer/Model
    Amd
Got it working somehow:cab-shell-gtk.webpBildschirmfoto zu 2025-08-26 08-21-31.webp
 

My Computer

System One

  • OS
    24h2 , 24.10
    Computer type
    PC/Desktop
    Manufacturer/Model
    Amd
Back
Top Bottom