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. C / C++ / MFC
  4. how to change window icon

how to change window icon

Scheduled Pinned Locked Moved C / C++ / MFC
tutorialquestion
6 Posts 3 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.
  • V Offline
    V Offline
    vividtang
    wrote on last edited by
    #1

    other people tell me if i want to change the icon on the window,i must send WM_SECTION to window,so i write: in initinstance of app HICON hIcon=AfxGetApp() ->LoadIcon(IDI_ICON) ASSERT(hIcon) AfxGetMainWnd() ->SendMessage(WM_SECTION,TRUE,(LPARAM)hIcon) ,but when i compile note not declare WM_SECTION,why ,do you know?if true,tell me please.

    D S 2 Replies Last reply
    0
    • V vividtang

      other people tell me if i want to change the icon on the window,i must send WM_SECTION to window,so i write: in initinstance of app HICON hIcon=AfxGetApp() ->LoadIcon(IDI_ICON) ASSERT(hIcon) AfxGetMainWnd() ->SendMessage(WM_SECTION,TRUE,(LPARAM)hIcon) ,but when i compile note not declare WM_SECTION,why ,do you know?if true,tell me please.

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      vividtang wrote: ,but when i compile note not declare WM_SECTION Do you mean that you receive a compiler error? If so, it may be because that message does not exist, at least that I could find. What is it used for?


      "The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)

      V 1 Reply Last reply
      0
      • D David Crow

        vividtang wrote: ,but when i compile note not declare WM_SECTION Do you mean that you receive a compiler error? If so, it may be because that message does not exist, at least that I could find. What is it used for?


        "The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)

        V Offline
        V Offline
        vividtang
        wrote on last edited by
        #3

        then can you have an idea to help me solve the problem?thx

        D 1 Reply Last reply
        0
        • V vividtang

          then can you have an idea to help me solve the problem?thx

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          Not without some detailed information as to what you are wanting.


          "The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)

          1 Reply Last reply
          0
          • V vividtang

            other people tell me if i want to change the icon on the window,i must send WM_SECTION to window,so i write: in initinstance of app HICON hIcon=AfxGetApp() ->LoadIcon(IDI_ICON) ASSERT(hIcon) AfxGetMainWnd() ->SendMessage(WM_SECTION,TRUE,(LPARAM)hIcon) ,but when i compile note not declare WM_SECTION,why ,do you know?if true,tell me please.

            S Offline
            S Offline
            sps itsec46
            wrote on last edited by
            #5

            Hi! I guess you want to use **WM_SETICON** and not **WM_SECTION**... ;) The latter windows message doesn't exist. Regards, mYkel

            V 1 Reply Last reply
            0
            • S sps itsec46

              Hi! I guess you want to use **WM_SETICON** and not **WM_SECTION**... ;) The latter windows message doesn't exist. Regards, mYkel

              V Offline
              V Offline
              vividtang
              wrote on last edited by
              #6

              hi: you are right ,run ok,thx:rose:

              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