Results 1 to 8 of 8

Thread: Subclassing Message

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 1999
    Posts
    363

    Question

    Hi, I need to redraw a menu that's dynamically generated. Because the entire menu is created at run-time, it disappears if it's not redrawn periodically. I'm subclassing so I can redraw it if I know what message is sent when the menu is deleted. Anyone know the window message or constant that's generated when the menubar is killed??

    p.s. I tried WM_Paint - it's not always fired.

    Thanks in advance,
    Wade
    Wade

  2. #2
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    When I need to do this I just subclass and print all the messages to debug, then try to cause the message (ie by deleting a menu) and see what I get.

  3. #3
    Fanatic Member
    Join Date
    Jan 2000
    Location
    Nitro
    Posts
    633
    Sam!

    The term "subclassing" is new to me. What does it mean?
    Chemically Formulated As:
    Dr. Nitro

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 1999
    Posts
    363
    If I print all the messages to debug, I've got a tremendous amount of messages to sift through. Because so many are generated so quickly, it's hard for me to decipher which is the right message.

    Anyone know which message is generated when a menu is deleted or redrawn?

    Thanks,
    Wade
    Wade

  5. #5
    Lively Member
    Join Date
    Apr 2000
    Location
    Hell
    Posts
    89
    I believe it is WM_NCPAINT.
    - Steve

    Real programmers use COPY CON PROGRAM.EXE

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 1999
    Posts
    363
    Thanks. I found &H105A in an example and this works. Couldn't find it in the Win32api list that comes with vb, but it works.

    Wade

  7. #7
    Lively Member
    Join Date
    Apr 2000
    Location
    Hell
    Posts
    89
    As all messages over &H0400& are in the WM_USER range (i.e. application-defined), I'd love to see that example.

    Incidentally, why are you drawing your own menu?
    - Steve

    Real programmers use COPY CON PROGRAM.EXE

  8. #8

    Thread Starter
    Hyperactive Member
    Join Date
    Nov 1999
    Posts
    363
    I need this b/c I'm bringing a parent form's menu down into its children forms.
    Wade

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width