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

Re: How to click on toolbar's buttons?

Expand Messages
  • pkaluski
    Hi, 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
    Message 1 of 12 , Jan 11, 2005
    • 0 Attachment
      Hi,
      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?
      url=/library/en-
      us/shellcc/platform/commctls/toolbar/toolbar_overview.asp.
      You can also check Jeff's Prosize "Programming Windows with MFC (2nd
      edition)", chapter 12.

      -Piotr


      --- In perlguitest@yahoogroups.com, Wenjie Wang <wiseagent2000@y...>
      wrote:
      >
      > 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.
    • wenjie wang
      ... However, ... that ... it). ... command ... 0, ... not ... case ... can ... which ... You ... (2nd ... Thanks for the summary. It has presented a better
      Message 2 of 12 , Jan 11, 2005
      • 0 Attachment
        --- In perlguitest@yahoogroups.com, "pkaluski" <pkaluski@p...> wrote:
        >
        > Hi,
        > 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?
        > url=/library/en-
        > us/shellcc/platform/commctls/toolbar/toolbar_overview.asp.
        > You can also check Jeff's Prosize "Programming Windows with MFC
        (2nd
        > edition)", chapter 12.
        >

        Thanks for the summary. It has presented a better picture of our
        discussion.

        As far as GUI concern, I'm mainly using win32 API / MFC / ATL. I'm
        using PERL for other purpose. It happened that I have to perform
        automated GUI manipulation in one of my new project and GuiTest
        module is picked for the project. I haven't spent much time
        investigating it futher till I read your comments in your web site.
        and then dive into guitest.pm;-)

        Luckily, what I've done so far is valid and works fine for my
        project.

        Regards
        W Wang

        +-Wenjie Wang a.k.a William -------------------------------------+
        | WANG Infonology Systems |EMail : wwang@... |
        | Phone : (02) 9871 2018 | WISeAgent2000@... |
        | Mobile: 0412 688 380 |http://users.bigpond.net.au/WISeAgent |
        +-------------------------+--------------------------------------+
      Your message has been successfully submitted and would be delivered to recipients shortly.