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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. GET ICON

GET ICON

Scheduled Pinned Locked Moved C / C++ / MFC
question
3 Posts 2 Posters 0 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.
  • K Offline
    K Offline
    kedar dave
    wrote on last edited by
    #1

    hiii... how can i get an ICON from a window and pass it to the CreateWindowEx function? regards, kedar.

    T 1 Reply Last reply
    0
    • K kedar dave

      hiii... how can i get an ICON from a window and pass it to the CreateWindowEx function? regards, kedar.

      T Offline
      T Offline
      ThatsAlok
      wrote on last edited by
      #2

      kedar.dave wrote: how can i get an ICON from a window and pass it to the CreateWindowEx function? if you want to get the Icon from some other window and use that in your window program you can use ExtractIcon api here is small code listing for that

      HICON m_hRemoteIcon;
      CString m_strFileName;
      //Assume m_strFileName point to valid Program file//Now use the Extract Icon api to Extract the Icon
      //First Parameter =NULL( indicateuse the curent instance)
      //Second Parameter = Name of file from which you want to extract icon
      //Third Parameter : Index of icon ,here i am extracting the
      // first icon from the exefile

      m_hRemoteIcon=ExtractIcon(NULL,m_strFileName,0);
      //here m_statIcon is static ctrl of type ICON
      m_statIcon.SetIcon(m_hRemoteIcon);


      "I Think this Will Help"

      visit me at http://www.thisisalok.tk
      K 1 Reply Last reply
      0
      • T ThatsAlok

        kedar.dave wrote: how can i get an ICON from a window and pass it to the CreateWindowEx function? if you want to get the Icon from some other window and use that in your window program you can use ExtractIcon api here is small code listing for that

        HICON m_hRemoteIcon;
        CString m_strFileName;
        //Assume m_strFileName point to valid Program file//Now use the Extract Icon api to Extract the Icon
        //First Parameter =NULL( indicateuse the curent instance)
        //Second Parameter = Name of file from which you want to extract icon
        //Third Parameter : Index of icon ,here i am extracting the
        // first icon from the exefile

        m_hRemoteIcon=ExtractIcon(NULL,m_strFileName,0);
        //here m_statIcon is static ctrl of type ICON
        m_statIcon.SetIcon(m_hRemoteIcon);


        "I Think this Will Help"

        visit me at http://www.thisisalok.tk
        K Offline
        K Offline
        kedar dave
        wrote on last edited by
        #3

        thanks a lot Alok... i also have another Query... how can i get a bitmap and an image n use it ? if possible...can u attach a piece of code.. regards, kedar.

        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