Loading ...
Sorry, an error occurred while loading the content.

705Re: How to click on toolbar's buttons?

Expand Messages
  • pkaluski
    Jan 11, 2005
    • 0 Attachment
      This is a summary response to your last 3 posts (702-704).

      You are right. I have also observed that for basic controls like
      Edits, ComboBoxes etc. resource ID is equal to control ID. However,
      this is only an observation. I haven't found any document saying that
      control id = resource id (if anyone can confirm/deny, please do it).
      From the other hand I have seen controls defined by CONTROL command
      in rc file, which had resource ID != 0 and control ID = 0. You can
      try with VC++. Create a project with application hosting an
      Activex control. You will see the control will have Control ID = 0,
      in the same time having resource id != 0.

      As for handling a toolbar. According to your description you are not
      dealing with the standard toolbar, like ToolbarWindow32 (used in
      Spy++, for example). You deal with a custom made toolbar, which
      is actually a dialog box with button controls on it. For such a case
      you are right - it works and you can select buttons by control ID.
      However, it is not going to work for standart toolbars (present in
      Spy++ or in basic MFC applications created by AppWizard). As you can
      see, there are no children of such a toolbar control. The standard
      control toolbar works this way - you pass it a set of bitmaps which
      should appears as buttons. Toolbar control is resposible for
      notifying you, which button was clicked (when you click on it). You
      can check the link http://msdn.microsoft.com/library/default.asp?
      You can also check Jeff's Prosize "Programming Windows with MFC (2nd
      edition)", chapter 12.


      --- In perlguitest@yahoogroups.com, Wenjie Wang <wiseagent2000@y...>
      > The toolbar itself is dialog based class "#32770 (Dialog)" with
      button, combo and other controls. The toolbar is attached to
      window's rebar.
      > It has more than one buttons in the toolbar, and that's why I need
      to use control ID of the button to distinguish between them.
      > Again, control ID of the button control is used when calling
      PushChildButton function.
    • Show all 12 messages in this topic