Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Windows API
  4. PE Resource Update

PE Resource Update

Scheduled Pinned Locked Moved Windows API
announcementlearning
3 Posts 2 Posters 11 Views 1 Watching
  • 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.
  • M Offline
    M Offline
    MrDooDoo
    wrote on last edited by
    #1

    Hi everyone, Does anyone have an Idea for changing the default icon of an EXE. I have found some piece of code for changing dialog boxes and string tables. But their methods don't work for icons. regards.

    C 1 Reply Last reply
    0
    • M MrDooDoo

      Hi everyone, Does anyone have an Idea for changing the default icon of an EXE. I have found some piece of code for changing dialog boxes and string tables. But their methods don't work for icons. regards.

      C Offline
      C Offline
      Captain Price
      wrote on last edited by
      #2

      If you're registering the window class by your self (i guess you do), you can specify the icon in WNDCLASS before registering the window class.

      wndclass.hIcon = LoadIcon (MAKEINTRESOURCE(ID_ICON), IDI_APPLICATION) ;

      Or Whenever you want (after your window has been created), you can load it to your window by SetClassLong :

      HICON hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_ICON));
      SetClassLong(hWnd, GCL_HICON, (LONG)hIcon);

      cheers !

      "If A is a success in life, then A=x+y+z. (Work is x; y is play; and z is keeping your mouth shut.)"

      M 1 Reply Last reply
      0
      • C Captain Price

        If you're registering the window class by your self (i guess you do), you can specify the icon in WNDCLASS before registering the window class.

        wndclass.hIcon = LoadIcon (MAKEINTRESOURCE(ID_ICON), IDI_APPLICATION) ;

        Or Whenever you want (after your window has been created), you can load it to your window by SetClassLong :

        HICON hIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_ICON));
        SetClassLong(hWnd, GCL_HICON, (LONG)hIcon);

        cheers !

        "If A is a success in life, then A=x+y+z. (Work is x; y is play; and z is keeping your mouth shut.)"

        M Offline
        M Offline
        MrDooDoo
        wrote on last edited by
        #3

        Thanks for your favor, But I think you didn't get what I mean. I aim to change the Icon of an EXE as what is shown in windows explorer, Not the Icon of Window of the program. This Icon is one of program resources but when I work with UpdateResource function for changing it, the process fails. thanks.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups