Owner Drawn dynamic menus

This is a discussion on Owner Drawn dynamic menus within the Windows Programming forums, part of the Platform Specific Boards category; Alrighty, here's a rough one... The Gist: I'm trying to create a popup menu that enumerates and loads the files ...

  1. #1
    Registered User
    Join Date
    Feb 2005
    Posts
    11

    Owner Drawn dynamic menus

    Alrighty, here's a rough one...

    The Gist:
    I'm trying to create a popup menu that enumerates and loads the files in the recent documents menu that exist, and launch the file when clicked. The owner drawn menu is to display the associated icon (through ExtractAssociatedIcon).

    What Works:
    Then menus appear correctly with the appropriate icons.

    What Doesn't:
    When hovering over, I get a memory error.

    What I Think:
    WM_DRAWITEM works for the initial draw, hence everything looking good. When the item is selected, it sends to WM_DRAWITEM, which in turn calls a function to handle the drawing. I believe the problem occurs because I have the dynamic menu redrawn under the default switch for the itemID. The whole dynamic menu is redrawn because it cycles through every file.

    The Question:
    Short and Skinny, how can I load a directory's contents, with icons, into a menu, and still be able to click and launch?

    Attached are the main.c, expand.h (menu loading functions), and resource.h.

    If the full project would help, e-mail me and I'll zip it up. Thanks!
    Attached Files Attached Files

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Problems defining classes
    By esmeco in forum C++ Programming
    Replies: 47
    Last Post: 10-24-2007, 02:13 PM
  2. Owner Drawn (a few questions)
    By Oldman47 in forum Windows Programming
    Replies: 2
    Last Post: 04-17-2007, 09:21 PM
  3. Multiple Owner Drawn buttons
    By budoka in forum Windows Programming
    Replies: 5
    Last Post: 07-20-2005, 01:19 AM
  4. Multiple Owner Drawn buttons
    By budoka in forum C++ Programming
    Replies: 3
    Last Post: 07-12-2005, 03:00 AM
  5. Owner Drawn Menus
    By Okiesmokie in forum Windows Programming
    Replies: 6
    Last Post: 08-09-2002, 10:39 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21