![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | 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 Specs![]() |
| | #2 (permalink) |
| | Re: Buttons to output strings to cursor focus On Sep 9, 7:15*pm, mocha99 <moch...@xxxxxx> wrote: Quote: > 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 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> <input id=btn2 type=button value="Text 2" title="Text Item 2" onclick=droptext> <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 Specs![]() |
| | #3 (permalink) |
| | Re: Buttons to output strings to cursor focus OK Tom, thanks a lot for your time and help!!! Quote: > 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 Specs![]() |
| | #4 (permalink) |
| | 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: Quote: > On Sep 9, 7:15 pm, mocha99 <moch...@xxxxxx> wrote: Quote: >> 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 Specs![]() |
| | #5 (permalink) |
| | Re: Buttons to output strings to cursor focus On Sep 10, 10:37*am, mocha99 <moch...@xxxxxx> wrote: Quote: > 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: Quote: > > On Sep 9, 7:15 pm, mocha99 <moch...@xxxxxx> wrote: Quote: > >> Hi all Quote: Quote: > >> 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). 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 Specs![]() |
| | #6 (permalink) |
| | Re: Buttons to output strings to cursor focus "Tom Lavedas" <tglbatch@xxxxxx> wrote in message news:69c070cc-1e7d-4d39-9648-90f86698a46c@xxxxxx Quote: > On Sep 9, 7:15 pm, mocha99 <moch...@xxxxxx> wrote: Quote: >> 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 ... /Al Quote: > <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> > <input id=btn2 type=button value="Text 2" > title="Text Item 2" onclick=droptext> > <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 Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| controlling cursor position or other way to control placement of output to screen | PowerShell | |||
| cursor keyboard touch pad very sensitive and cursor bounces around | Vista General | |||
| Mouse cursor freezes but focus moves on Vista Ultimate x64 | Vista General | |||
| crazy cursor - cursor keeps bouncing back form certain clickable a | Vista performance & maintenance | |||
| working with strings | PowerShell | |||