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. Other Discussions
  3. Site Bugs / Suggestions
  4. CBitmap, CButton, HBITMAP and more...

CBitmap, CButton, HBITMAP and more...

Scheduled Pinned Locked Moved Site Bugs / Suggestions
comgraphicslearning
2 Posts 2 Posters 9 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.
  • R Offline
    R Offline
    Remi Morin
    wrote on last edited by
    #1

    This function do not work, why... CSpecialControl is derived from CWnd BOOL CSpecialControl::Create(const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext) { BOOL Oktemp; //after this line hbm is null, IDB_BITMAP1 is a valid resource... HBITMAP hbm = ::LoadBitmap(NULL,MAKEINTRESOURCE(IDB_BITMAP1)); //this work CBitmap MyBitmap; MyBitmap.LoadBitmap( IDB_BITMAP1); //this work Oktemp = CWnd::Create (NULL,_T(""),WS_CHILD|WS_CLIPCHILDREN, rect, pParentWnd, nID ,pContext); //this work, I can see the button and catch his command Oktemp &= m_cBouton_1.Create (_T(""),WS_CHILD |BS_PUSHBUTTON|BS_BITMAP|WS_VISIBLE ,CRect(0,0,16,16),pParentWnd,IDC_BUTTONGAUCHE); //and the bitmap is never displayed on the button.... m_cBouton_1.SetBitmap(MyBitmap); m_cBouton_1.ShowWindow(SW_SHOWNORMAL); return Oktemp; } Remi Morin Rmorin@Operamail.com Remi.Morin@Lyrtech.com

    T 1 Reply Last reply
    0
    • R Remi Morin

      This function do not work, why... CSpecialControl is derived from CWnd BOOL CSpecialControl::Create(const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext) { BOOL Oktemp; //after this line hbm is null, IDB_BITMAP1 is a valid resource... HBITMAP hbm = ::LoadBitmap(NULL,MAKEINTRESOURCE(IDB_BITMAP1)); //this work CBitmap MyBitmap; MyBitmap.LoadBitmap( IDB_BITMAP1); //this work Oktemp = CWnd::Create (NULL,_T(""),WS_CHILD|WS_CLIPCHILDREN, rect, pParentWnd, nID ,pContext); //this work, I can see the button and catch his command Oktemp &= m_cBouton_1.Create (_T(""),WS_CHILD |BS_PUSHBUTTON|BS_BITMAP|WS_VISIBLE ,CRect(0,0,16,16),pParentWnd,IDC_BUTTONGAUCHE); //and the bitmap is never displayed on the button.... m_cBouton_1.SetBitmap(MyBitmap); m_cBouton_1.ShowWindow(SW_SHOWNORMAL); return Oktemp; } Remi Morin Rmorin@Operamail.com Remi.Morin@Lyrtech.com

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

      I guess you want a skinned button. I found a source code here in "CodeProject". It's a class derived from CButton that make create the button from resource bitmaps. I'll bet if you search in the CodeProject for "skin button" or "skin CButton", you'll find it. if not, email me and I'll send you by mail the source code. Name: STR Mission: Take Over The World (c: Tips: If you build it, he will come. EMail: sagiv@musicgenome.com

      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