Windows Vista Forums

Buttons to output strings to cursor focus
  1. #1


    mocha99 Guest

    Buttons to output strings to cursor focus

    Hi all

    I need to create a window or little dashboards with buttons, if I click
    on a button this should output a string of text (associated with that
    button) to wherever the cursor is blinking at the moment I click
    (without loosing the focus).

    Is thta possible?



    Any example?

    Thanks

      My System SpecsSystem Spec

  2. #2


    Tom Lavedas Guest

    Re: Buttons to output strings to cursor focus

    On Sep 9, 7:15*pm, mocha99 <moch...@xxxxxx> wrote:

    > Hi all
    >
    > I need to create a window or little dashboards with buttons, if I click
    > on a button this should output a string of text (associated with that
    > button) to wherever the cursor is blinking at the moment I click
    > (without loosing the focus).
    >
    > Is thta possible?
    >
    > Any example?
    >
    > Thanks
    I think this does what you want. Save it as an HTA (hypertext
    application) file ...

    <html>
    <script language="vbscript">
    dim oWSHShell

    sub initiate
    set oWSHShell = createobject("wscript.shell")
    end sub

    sub droptext
    txtwdw.focus
    oWSHShell.Sendkeys window.event.srcElement.title
    end sub

    </script>
    <body onload=initiate>
    <input id=btn1 type=button value="Text 1"
    title="Text Item 1" onclick=droptext>&nbsp;
    <input id=btn2 type=button value="Text 2"
    title="Text Item 2" onclick=droptext>&nbsp;
    <input id=btn3 type=button value="Text 3"
    title="Text Item 3" onclick=droptext><br>
    <textarea id=txtwdw cols=72 rows=20></textarea>
    </body>
    </html>
    _____________________
    Tom Lavedas

      My System SpecsSystem Spec

  3. #3


    tzuc Guest

    Re: Buttons to output strings to cursor focus

    OK Tom, thanks a lot for your time and help!!!

    > I believe it might be possible to wrap the example HTA around a frame
    > that displays the target web page. In that case, it might be possible
    > (if IE8 is not loaded) to then send the information from the buttons
    > into the web page at the previously referenced cursor location.
    > Unfortunately, I am moments away from leaving on vacation, so I can't
    > go any further with this, sorry. Maybe someone else will be
    > interested in taking up the challenge.
    > _____________________
    > Tom Lavedas

      My System SpecsSystem Spec

  4. #4


    mocha99 Guest

    Re: Buttons to output strings to cursor focus

    Hi,

    thanks a lot for the code. It doesnt exactly do what i need though...

    I'd need something that, while the cursor is blinking in any field in a
    web page (like in form) enables me to automatically fill in that field
    by pressing a button. The page where the curso is blinking is a web page
    that is not the same where the button is (it is a web page that I do not
    provide, i.e. a web page that I browse to on the internet).

    Can this be done?

    Thanks alot

    Tom Lavedas wrote:

    > On Sep 9, 7:15 pm, mocha99 <moch...@xxxxxx> wrote:

    >> Hi all
    >>
    >> I need to create a window or little dashboards with buttons, if I click
    >> on a button this should output a string of text (associated with that
    >> button) to wherever the cursor is blinking at the moment I click
    >> (without loosing the focus).

      My System SpecsSystem Spec

  5. #5


    Tom Lavedas Guest

    Re: Buttons to output strings to cursor focus

    On Sep 10, 10:37*am, mocha99 <moch...@xxxxxx> wrote:

    > Hi,
    >
    > thanks a lot for the code. It doesnt exactly do what i need though...
    >
    > I'd need something that, while the cursor is blinking in any field in a
    > web page (like in form) enables me to automatically fill in that field
    > by pressing a button. The page where the curso is blinking is a web page
    > that is not the same where the button is (it is a web page that I do not
    > provide, i.e. a web page that I browse to on the internet).
    >
    > Can this be done?
    >
    > Thanks alot
    >
    > Tom Lavedas wrote:

    > > On Sep 9, 7:15 pm, mocha99 <moch...@xxxxxx> wrote:

    > >> Hi all
    >

    > >> I need to create a window or little dashboards with buttons, if I click
    > >> on a button this should output a string of text (associated with that
    > >> button) to wherever the cursor is blinking at the moment I click
    > >> (without loosing the focus).
    The same technique "might" be made to work in that situation, IF (and
    it's a big if) some means of knowing which was the target window for
    the insertion. I don't know of a way to get that information -
    besides entering it into the application that contains the buttons.
    That is, in script, there is really no way to know where the mouse
    came from once the mouse leaves the target window and clicks on the
    app with the buttons (at least not AFAIK). This means, the button app
    doesn't know where to send its information.

    I believe it might be possible to wrap the example HTA around a frame
    that displays the target web page. In that case, it might be possible
    (if IE8 is not loaded) to then send the information from the buttons
    into the web page at the previously referenced cursor location.
    Unfortunately, I am moments away from leaving on vacation, so I can't
    go any further with this, sorry. Maybe someone else will be
    interested in taking up the challenge.
    _____________________
    Tom Lavedas

      My System SpecsSystem Spec

  6. #6


    Al Dunbar Guest

    Re: Buttons to output strings to cursor focus


    "Tom Lavedas" <tglbatch@xxxxxx> wrote in message
    news:69c070cc-1e7d-4d39-9648-90f86698a46c@xxxxxx

    > On Sep 9, 7:15 pm, mocha99 <moch...@xxxxxx> wrote:

    >> Hi all
    >>
    >> I need to create a window or little dashboards with buttons, if I click
    >> on a button this should output a string of text (associated with that
    >> button) to wherever the cursor is blinking at the moment I click
    >> (without loosing the focus).
    >>
    >> Is thta possible?
    >>
    >> Any example?
    >>
    >> Thanks
    >
    > I think this does what you want. Save it as an HTA (hypertext
    > application) file ...
    LOL, his answer was in his question: "is tHTA possible?"

    /Al

    > <html>
    > <script language="vbscript">
    > dim oWSHShell
    >
    > sub initiate
    > set oWSHShell = createobject("wscript.shell")
    > end sub
    >
    > sub droptext
    > txtwdw.focus
    > oWSHShell.Sendkeys window.event.srcElement.title
    > end sub
    >
    > </script>
    > <body onload=initiate>
    > <input id=btn1 type=button value="Text 1"
    > title="Text Item 1" onclick=droptext>&nbsp;
    > <input id=btn2 type=button value="Text 2"
    > title="Text Item 2" onclick=droptext>&nbsp;
    > <input id=btn3 type=button value="Text 3"
    > title="Text Item 3" onclick=droptext><br>
    > <textarea id=txtwdw cols=72 rows=20></textarea>
    > </body>
    > </html>
    > _____________________
    > Tom Lavedas



      My System SpecsSystem Spec

Buttons to output strings to cursor focus problems?

Similar Threads
Thread Thread Starter Forum Replies Last Post
controlling cursor position or other way to control placement of output to screen James PowerShell 0 31 Mar 2009
cursor keyboard touch pad very sensitive and cursor bounces around petro Vista General 2 19 May 2008
Mouse cursor freezes but focus moves on Vista Ultimate x64 Jan Wikholm Vista General 3 13 May 2008
crazy cursor - cursor keeps bouncing back form certain clickable a jordanly Vista performance & maintenance 0 10 May 2008
-f paramater in strings thomas lee PowerShell 4 02 Apr 2008