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

Re: edit control (Naming an edit box)

Expand Messages
  • paulbt2000
    In my product code how do I name an edit box? I am using C++. Paul ... it ... does
    Message 1 of 5 , Feb 27, 2002
      In my product code how do I name an edit box? I am using C++.

      Paul


      --- In perlguitest@y..., "erngui" <erngui@y...> wrote:
      > Hi,
      >
      > --- In perlguitest@y..., "gbouzas" <gbouzas@y...> wrote:
      > > Is there a way to select a named edit control in order to fill
      it
      > in
      > > with the SendKeys function?
      > > I´d rather prefer not using tabs after a SetForegroundWindow and
      > > select directly the control to avoid errors...
      >
      > Instead of just selecting the control and typing, you can use
      > WMGetText on the control directly. You'll need to get the window
      > handle first using FindWindowLike. The 'eg/notepad.pl' example
      does
      > this. Notepad is just a big edit control with a frame around it...
      >
      > Regards,
      > Ernesto.
      > --
      > Ernesto Guisado
      > mailto:erngui@a...
      > http://triumvir.org
    • erngui
      Hi, ... It normally already has a number that identifies it (that s the control id). In MFC it normally is a define that looks like IDC_EDIT1. You can then
      Message 2 of 5 , Feb 27, 2002
        Hi,

        --- In perlguitest@y..., "paulbt2000" <pcovington@a...> wrote:
        > In my product code how do I name an edit box? I am using C++.

        It normally already has a number that identifies it (that's the
        control id). In MFC it normally is a define that looks like
        IDC_EDIT1. You can then lookup the control id in the resource.h file:

        #define IDC_EDIT1 1000

        If your dialog box has the title "Silly Example" you can use this
        code:

        my @win = FindWindowLike(0, "Silly Example");
        my @edit = FindWindowLike(shift @win, "", "Edit", 1000);
        WMSetText(shift @edit, "Whatever");

        Regards,
        Ernesto.
        --
        Ernesto Guisado
        mailto:erngui@...
        http://triumvir.org
      • paulbt2000
        very cool, I will try that as soon as I get a chance. Thanks Ernesto. Paul
        Message 3 of 5 , Feb 27, 2002
          very cool, I will try that as soon as I get a chance. Thanks Ernesto.

          Paul

          --- In perlguitest@y..., "erngui" <erngui@y...> wrote:
          > Hi,
          >
          > --- In perlguitest@y..., "paulbt2000" <pcovington@a...> wrote:
          > > In my product code how do I name an edit box? I am using C++.
          >
          > It normally already has a number that identifies it (that's the
          > control id). In MFC it normally is a define that looks like
          > IDC_EDIT1. You can then lookup the control id in the resource.h
          file:
          >
          > #define IDC_EDIT1 1000
          >
          > If your dialog box has the title "Silly Example" you can use this
          > code:
          >
          > my @win = FindWindowLike(0, "Silly Example");
          > my @edit = FindWindowLike(shift @win, "", "Edit", 1000);
          > WMSetText(shift @edit, "Whatever");
          >
          > Regards,
          > Ernesto.
          > --
          > Ernesto Guisado
          > mailto:erngui@a...
          > http://triumvir.org
        Your message has been successfully submitted and would be delivered to recipients shortly.