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. subclass all

subclass all

Scheduled Pinned Locked Moved C / C++ / MFC
comtutorialquestion
2 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.
  • J Offline
    J Offline
    johny_d
    wrote on last edited by
    #1

    does anyone know how to subclass all controls of a specific type in a window? what i mean is the window style just like corel draw 9. everything including the CFileDialog and the print dialogs has the same style - same buttons, edit boxes,etc (i dont believe they subclassed each control separately) Live long and in prosper johny74656@gmail.com

    B 1 Reply Last reply
    0
    • J johny_d

      does anyone know how to subclass all controls of a specific type in a window? what i mean is the window style just like corel draw 9. everything including the CFileDialog and the print dialogs has the same style - same buttons, edit boxes,etc (i dont believe they subclassed each control separately) Live long and in prosper johny74656@gmail.com

      B Offline
      B Offline
      Blake Miller
      wrote on last edited by
      #2

      The subclassing of a window can occur per window instance or for the entire class, meaning for the entire process. So, if you want to subclass all windows for a single dialog, you need to subclass each instance of a child control window separately. You replace the window procedure for the window's instance. -> SetWindowLong(hWnd, GWL_WNDPROC, ... ); If you want all child windows to be modified for the entire application, then you can subclass the window procedure globally by replacing the window class's window procedure with your own code. -> SetClassLongPtr(hWnd, GCLP_WNDPROC, ... );

      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