Announcement

Collapse
No announcement yet.

Given hWnd, find Window Class?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Given hWnd, find Window Class?

    I have an application I am developing which uses MDI windows.

    The MDI child windows may be any one of (currently) three different Window Classes.

    One of these classes is "Reports;" the user may have created any number of these child windows. I want to offer the user a menu option to "close all report windows."

    I can enumerate all the MDI child Windows OK, but I can't seem to figure out how to tell if this particular child Window is of window class "Report."

    I hoped there might be a GetWindowLong I could use to get the Classname of a window, but I can't seem to find one.

    A thought I had was to identify the report windows with a "special" value using SetWindowLong (i.e., SetWindowLong hWnd, %GWL_USERDATA, %ID_REPORT_WINDOW) to set the extra data which I can interrogate later, but that seems clunky.

    Is there a better way?

    Regards,
    MCM

    Michael Mattias
    Tal Systems Inc. (retired)
    Racine WI USA
    [email protected]
    http://www.talsystems.com

  • #2
    Hi Michael,

    I hope I haven't missed something obvious here - isn't it just
    GetClassName() that you need ?
    Zippety Software, Home of the Lynx Project Explorer
    http://www.zippety.net
    My e-mail

    Comment


    • #3
      Duh, yup, GetClassName looks promising.

      I was going through the help file under "GetWindowxxxxxxx"

      Must be one of my fellow ethic Eastern Europeans who was in charge of naming the API calls...

      MCM

      Michael Mattias
      Tal Systems Inc. (retired)
      Racine WI USA
      [email protected]
      http://www.talsystems.com

      Comment

      Working...
      X