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. Hooks

Hooks

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
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.
  • D Offline
    D Offline
    Dave Kerr
    wrote on last edited by
    #1

    Hi All, I have a very large application that creates many dialogs. I have a CDialog derived class that skins dialogs. I would like to automatically make EVERY dialog in my application use this class - even message boxes, TWAIN interfaces etc etc. I was hoping I could simply use SetWindowsHookEx to do this but the problem that I'm having is that my dialogs are already 'CWnd' objects - when I try to subclass them as another CWnd (i.e. my Skinned Dialog class) I get assertations. Is there any way to safely subclass a CDialog object with another CDialog object? Thanks in advance, Dave

    _ 1 Reply Last reply
    0
    • D Dave Kerr

      Hi All, I have a very large application that creates many dialogs. I have a CDialog derived class that skins dialogs. I would like to automatically make EVERY dialog in my application use this class - even message boxes, TWAIN interfaces etc etc. I was hoping I could simply use SetWindowsHookEx to do this but the problem that I'm having is that my dialogs are already 'CWnd' objects - when I try to subclass them as another CWnd (i.e. my Skinned Dialog class) I get assertations. Is there any way to safely subclass a CDialog object with another CDialog object? Thanks in advance, Dave

      _ Offline
      _ Offline
      _Superman_
      wrote on last edited by
      #2

      You could use the CWnd::Detach method to detach the existing CWnd object and then use CWnd::Attach on the returned window handle to attach your CDialog derived class.

      «_Superman_» I love work. It gives me something to do between weekends.

      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