f



window Controls handing problem

Hi,
I have launched an application, it has 1 text box and 1 button now i want to enter some data in text box and then click the button. how can i do that using their controls??? i am trying it using TWAPI package but unable to do that.
Thanks
0
10/30/2012 2:40:00 AM
comp.lang.tcl 23428 articles. 2 followers. Post Follow

10 Replies
473 Views

Similar Articles

[PageSpeed] 51

On Tuesday, October 30, 2012 8:10:00 AM UTC+5:30, Bal Govind wrote:
> Hi,
> 
> I have launched an application, it has 1 text box and 1 button now i want to enter some data in text box and then click the button. how can i do that using their controls??? i am trying it using TWAPI package but unable to do that.
> 
> Thanks

let me clarify a bit more. I have created a window application in .net
I launched it using twapi. It has a button and a text box. Now i want to enter some data in textbox and to click the button. how can i achieve that using their controls???
0
10/30/2012 6:42:53 AM
Am 30.10.12 03:40, schrieb Bal Govind:
> Hi, I have launched an application, it has 1 text box and 1 button
> now i want to enter some data in text box and then click the button.
> how can i do that using their controls??? i am trying it using TWAPI
> package but unable to do that. Thanks


Is this a TK question, isn't it? It's not entirely clear what you are 
trying to do. Does a script like the following help you?

package require Tk
pack [ttk::entry .e -textvariable yourtext] -expand yes -fill x
pack [ttk::button .b -command Doit -text "Press"]

proc Doit {} {
   variable yourtext
   tk_messageBox -message "You pressed, text is $yourtext"
}



	Christian
0
auriocus1 (391)
10/30/2012 6:46:11 AM
On Tuesday, October 30, 2012 12:16:11 PM UTC+5:30, Christian Gollwitzer wrote:
> Am 30.10.12 03:40, schrieb Bal Govind:
> 
> > Hi, I have launched an application, it has 1 text box and 1 button
> 
> > now i want to enter some data in text box and then click the button.
> 
> > how can i do that using their controls??? i am trying it using TWAPI
> 
> > package but unable to do that. Thanks
> 
> This is not a TK question. I have created the window application using .net.
Now i want to handle this window application using TCL.
> 
> 
> 
> Is this a TK question, isn't it? It's not entirely clear what you are 
> 
> trying to do. Does a script like the following help you?
> 
> 
> 
> package require Tk
> 
> pack [ttk::entry .e -textvariable yourtext] -expand yes -fill x
> 
> pack [ttk::button .b -command Doit -text "Press"]
> 
> 
> 
> proc Doit {} {
> 
>    variable yourtext
> 
>    tk_messageBox -message "You pressed, text is $yourtext"
> 
> }
> 
> 
> 
> 
> 
> 
> 
> 	Christian

0
10/30/2012 6:47:55 AM
Am 30.10.12 07:47, schrieb Bal Govind:
> On Tuesday, October 30, 2012 12:16:11 PM UTC+5:30, Christian Gollwitzer wrote:
>> Am 30.10.12 03:40, schrieb Bal Govind:
>>
>>> Hi, I have launched an application, it has 1 text box and 1 button
>>
>>> now i want to enter some data in text box and then click the button.
>>
>>> how can i do that using their controls??? i am trying it using TWAPI
>>
>>> package but unable to do that. Thanks
>>
>> This is not a TK question. I have created the window application using .net.
> Now i want to handle this window application using TCL.


Sorry for the confusion. It became clear to me right after posting. You 
are looking for a way to automate a windows application from Tcl. I can 
only point you to this wiki site:

	http://wiki.tcl.tk/8813

It seems you have control over your application (you stated you created 
it .NET) In this case, the best way would be to convert your programm 
into an ActiveX control. I don't know, how this is done, but it should 
be farly easy in .NET. Then you can use twapi::comobj to create and 
drive an instance from Tcl. Plus, any windows scripting tool can make 
use of it, too.

	Christian
0
auriocus1 (391)
10/30/2012 7:17:29 AM
On Tuesday, October 30, 2012 12:47:30 PM UTC+5:30, Christian Gollwitzer wrote:
> Am 30.10.12 07:47, schrieb Bal Govind:
> 
> > On Tuesday, October 30, 2012 12:16:11 PM UTC+5:30, Christian Gollwitzer wrote:
> 
> >> Am 30.10.12 03:40, schrieb Bal Govind:
> 
> >>
> 
> >>> Hi, I have launched an application, it has 1 text box and 1 button
> 
> >>
> 
> >>> now i want to enter some data in text box and then click the button.
> 
> >>
> 
> >>> how can i do that using their controls??? i am trying it using TWAPI
> 
> >>
> 
> >>> package but unable to do that. Thanks
> 
> >>
> 
> >> This is not a TK question. I have created the window application using .net.
> 
> > Now i want to handle this window application using TCL.
> 
> 
> 
> 
> 
> Sorry for the confusion. It became clear to me right after posting. You 
> 
> are looking for a way to automate a windows application from Tcl. I can 
> 
> only point you to this wiki site:
> 
> 
> 
> 	http://wiki.tcl.tk/8813
> 
> 
> 
> It seems you have control over your application (you stated you created 
> 
> it .NET) In this case, the best way would be to convert your programm 
> 
> into an ActiveX control. I don't know, how this is done, but it should 
> 
> be farly easy in .NET. Then you can use twapi::comobj to create and 
> 
> drive an instance from Tcl. Plus, any windows scripting tool can make 
> 
> use of it, too.
> 
> 
> 
> 	Christian

Hi, 
Thanks for information. Is there any other way to achieve the same as this would be a bit costly approach.
0
10/30/2012 7:44:59 AM
Am 30.10.12 08:44, schrieb Bal Govind:
>> It seems you have control over your application (you stated you created
>> it .NET) In this case, the best way would be to convert your programm
>> into an ActiveX control. I don't know, how this is done, but it should
>> be farly easy in .NET. Then you can use twapi::comobj to create and
>> drive an instance from Tcl. Plus, any windows scripting tool can make
>> use of it, too.
 >
> Thanks for information. Is there any other way to achieve the same as this would be a bit costly approach.
>

I'd avoid to try driving the application via GUI events, because this is 
error prone. You should provide an API which gives access to the 
underlying functionality, that can be used from Tcl. Can you open a 
socket and listen for commands in .NET? Then it would also be very from 
almost any scripting language.

	Christian
0
auriocus1 (391)
10/30/2012 8:33:16 AM
See http://wiki.tcl.tk/20231 for an example.

You need to locate the window using twapi::find_windows and then use 
send_input/send_keys/move_mouse.

As Christian said, this sort of thing is hard to get consistently right 
across screen resolutions, control dll versions etc.

/Ashok

On 10/30/2012 8:10 AM, Bal Govind wrote:
> Hi,
> I have launched an application, it has 1 text box and 1 button now i want to enter some data in text box and then click the button. how can i do that using their controls??? i am trying it using TWAPI package but unable to do that.
> Thanks
>

0
palmtcl (454)
10/30/2012 10:07:24 AM
On Tuesday, October 30, 2012 3:37:15 PM UTC+5:30, APN wrote:
> See http://wiki.tcl.tk/20231 for an example.
> 
> 
> 
> You need to locate the window using twapi::find_windows and then use 
> 
> send_input/send_keys/move_mouse.
> 
> 
> 
> As Christian said, this sort of thing is hard to get consistently right 
> 
> across screen resolutions, control dll versions etc.
> 
> 
> 
> /Ashok
> 
> 
> 
> On 10/30/2012 8:10 AM, Bal Govind wrote:
> 
> > Hi,
> 
> > I have launched an application, it has 1 text box and 1 button now i want to enter some data in text box and then click the button. how can i do that using their controls??? i am trying it using TWAPI package but unable to do that.
> 
> > Thanks
> 
> >

Hi,
Ashok, this will be image based processing. What if we do not know the location of buttons and text boxes??? how would you ensure that data is inserted in the desired textbox???? 
0
10/30/2012 11:26:54 AM
Not sure what exactly you mean by image based processing. If you mean 
you are actually displaying an image and have "hot spots" for buttons 
and such, then I don't know any way of doing that except by location.

If the button and text box is a real window, then you may be able to 
cobble together a solution as follows:
- use find_windows to get a handle to the text box or button. Use some 
combination of the -pids, -text, -class, -style to get the window handle 
you want
- use set_foreground_window or set_focus to that control
- use send_keys/send_input to send appropriate keys to the window. You 
may be able to use PostMessage as well

You'll have to play around and see. Not sure if it's all doable.

/Ashok

On 10/30/2012 4:56 PM, Bal Govind wrote:
>>
>
> Hi,
> Ashok, this will be image based processing. What if we do not know the location of buttons and text boxes??? how would you ensure that data is inserted in the desired textbox????
>

0
palmtcl (454)
10/30/2012 3:31:12 PM
On Tuesday, October 30, 2012 9:01:08 PM UTC+5:30, APN wrote:
> Not sure what exactly you mean by image based processing. If you mean 
> 
> you are actually displaying an image and have "hot spots" for buttons 
> 
> and such, then I don't know any way of doing that except by location.
> 
> 
> 
> If the button and text box is a real window, then you may be able to 
> 
> cobble together a solution as follows:
> 
> - use find_windows to get a handle to the text box or button. Use some 
> 
> combination of the -pids, -text, -class, -style to get the window handle 
> 
> you want
> 
> - use set_foreground_window or set_focus to that control
> 
> - use send_keys/send_input to send appropriate keys to the window. You 
> 
> may be able to use PostMessage as well
> 
> 
> 
> You'll have to play around and see. Not sure if it's all doable.
> 
> 
> 
> /Ashok
> 
> 
> 
> On 10/30/2012 4:56 PM, Bal Govind wrote:
> 
> >>
> 
> >
> 
> > Hi,
> 
> > Ashok, this will be image based processing. What if we do not know the location of buttons and text boxes??? how would you ensure that data is inserted in the desired textbox????
> 
> >

Exactly, i have done what you said but unable to do that.
let me know your mail id to send you the application and script created so that you can think of it in a better way. :)
0
10/31/2012 6:52:49 AM
Reply:

Similar Artilces:

Possible bug in Tcl or Windows or Tcl on Windows
Hi, There seems to be a bug in the way numbers are compared in Tcl. Consider the below script for calculating Pythagorean triplets. For hypotenuse upto a value of 100, there should have been 63 unique triplets. On Windows XP the script detects only 62. The script doesn't detect the case where c=99, b=20 ==> a=101. However running the same script under Tcl 8.4.1 in Cygwin detects 63 triplets. I don't have a Linux machine at hand to test it there. Following is the script and relevant output. Could anyone shed some light on the cause of this. Maybe it has something to do with how ...

windows and size control problem
Hello, I have a strange problem. A simple dialog window with several control. At runtime all the controls and the window size are downsized.. !! The dialog inherit from nothing, no postinit, no preinit... In debug, once the first control is created in the Init() method, the size is wrong. I have deleted the ressource definition and resave de dialalog, but still the same ! For example, in the resource I have: CONTROL "", W_WINBOOKS_SEND_DTDERFACT, "Edit", ES_AUTOHSCROLL| WS_TABSTOP|WS_CHILD|WS_BORDER, 91, 9, 50, 13, WS_EX_CLIENTEDGE In fact this control hav...

Problem with the edit window of a treeview control
I've subclassed a treeview to draw a bitmapped background, and I wanted to do the same with the edit box. The problem is, although WM_CTLCOLOREDIT is sent to the treeview, when I return a brush it just paints the edit window in black... any ideas? that's a bit tricky, don't forget to set and the background transparent and react on the WM_erase-message! try case WM_CTLCOLORLISTBOX: SetBkMode((HDC)wParam, TRANSPARENT); if (fShowBackgroundImage) return (LRESULT)hbrAppBackground; else return NULL; in you window-procedure and POINT p; RECT r, rect; if ...

Windows XP / Win32 Control from TCL
Hello: We have deployed a TCL COM object to launch a third party product using their COM interface. We have run into some issues, not due to TCL but due to the third party product itself. We get into situations where we have to use Windows to kill the process associated with the COM Object. However we would like to this in an automated fashion. So here are our questions: 1) Is it possible to query a Windows process ID from TCL? 2) Is it possible to kill the windows process using the ID from TCL ? 3) Is it possible to query a COM object for its process ID? Is this built into the COM ob...

windows service control manager problem
Hi. I am wondering if anyone here can help me with a problem I am having. I have written an XMLRPCServer to run on WinXP. When I register and run the server, I cant get it to listen to a port. But if I just execute the server portion of the code, it does. Any idea why it doesnt work after registering it with the service control manager? ...

Windows 7 and Eudora 7.1: problems, problems and problems.
Hi, 3 days ago I have replaced Win XP with Windows 7 and since first day I have problem with Eudora 7.1. My problems are when Eudora downloads emails. I have 6 account, Eudora downloads 3 accunts regularly, then gets stuck on 3� account for 1 minute or more and then it goes again regularly. Therefore I have deleted the 3� account then I have done the download. Eudora downloads 3 account regularly again then it gets stuck again. Always the same problem. Then ..... I have unistalled Eudora and deleted every trace on registry then I have installed it again but now I have the same probl...

Retrozone USB Controller under VICE Windows Problems
I'm having a problem with my authentic Retrozone commodore USB joystick under VICE for Windows. VICE Sees the joystick fine, but the problem is each AXIS on the joystick counts as BOTH an axis move AND a button push. So buttons 1 thru 4 are the AXIS buttons. And button 5 is the actual fire button. Well VICE for windows assumes that the fire button is any button that is pressed. So whenever I push my joystick in any direciton, VICE also treats it as if I pressed the button. Needless to say that this makes it impossible to use. Anyone know if VICE will ever support specifying which butto...

Problem with Control-IDs of Windows (c++ and TestComplete)
Hi! I'm trying to write a testscript for TestComplete for dynamically testing the GUI of my (unmanaged) c++ program. The Problem is, I can't access the Windows (and Controls) in a matter which is stable between different rebuilds, but only using Classname, Caption and ZOrder. Now I wrote a script using name mapping which maps the Classname, Caption and ZOrder-Pair to their Control-IDs. This is working rather fine, but the Control-ID for my Windows (CWindow, CDialog) always changed between different runs. Is there an (easy) way to use stable names to access the controls, like it is ...

[News] [Rival] Problem with Windows Vista Listed, Man Threatens to Sue over Windows XP Problems
5 Mistakes Microsoft made with Windows Vista ,----[ Quote ] | Let me outline those 5 mistakes Microsoft made with the Windows Vista launch | and talk about how Microsoft might be able to keep Windows Vista from being a | sequel to Windows ME. `---- http://www.neowin.net/index.php?act=view&id=41979 Customer wants to sue the inventor of Windows XP. ,----[ Quote ] | When I worked for a Norwegian ISP I got my hands on a really funny email from | an angry customer who doesn’t know too much about computers. `---- http://greenshinobi.wordpress.com/2007/08/15/customer-wants-to-sue-the-i...

Problem with Control-IDs of Windows (c++ and TestComplete)
Hi! I'm trying to write a testscript for TestComplete for dynamically testing the GUI of my (unmanaged) c++ program. The Problem is, I can't access the Windows (and Controls) in a matter which is stable between different rebuilds, but only using Classname, Caption and ZOrder. Now I wrote a script using name mapping which maps the Classname, Caption and ZOrder-Pair to their Control-IDs. This is working rather fine, but the Control-ID for my Windows (CWindow, CDialog) always changed between different runs. Is there an (easy) way to use stable names to access the controls...

No window control in an Application Window
Hi, After following a JFACE eclipse example, i created a new class that extends ApplicationWindow that create a nice window with tool bar, menu bar and status bar. That's great.... but my window doesn't have window controls to minimize or iconify it, only the quit element (the cross)! Does anybody know which attribute i have to set to have window controls? Thx 0o. ...

control windows screen active event with TCL
Hi everyone I want to record user's action trace even control his action , for example 1.take a snapshot on selected area (by mouse) into to image file 2.record user's mouse click location and action in first time , next time I can use it automatic, it not only record some exe file in order also record some input var and mouse trace! ----> it's effect like online game auto training program record screen's location and some control point! Do any one give me some advice or some sample code to develop it? BR Rolance rolance wrote: > Hi ever...

Problems with the port of a linux tcl program under windows.
Hi, Under linux: I have write a tcl program with some new tcl commands write in C. I compil theses C programs in a new wish call "my_wish" and run my_tcl.tcl program with the first line : #!./my_wish All is OK with linux. Under Windows: I had install cygwin and tcl (ActiveTcl8.5). and I compil my C commands with cygwin and creat "my_wish" program. But when I run my_tcl.tcl program I have an error : "invalid command name C_xxx" because "my_wish" program is not used and I don't know how run it. Thanks for any ideas. JPM ...

problems problems problems
(The short(?) summary) I've got an Access MDB file and a DAO connect with it.. Problem 1 of 2 The below gives me a runtime error 91 Object variable or With block variable not set. I've got the db stuff after the form.show (to make sure all the objects on the form are loaded before attempting to utilize/manipulate them) But it doesn't like it when I use the data object in the form load anyway for some reason.. pffft. Private Sub Form_Load() frmTest1Project.Show datGallery.Recordset.MoveLast datGallery.Recordset.MoveFirst Call LockTextBoxes(frmTest...

Web resources about - window Controls handing problem - comp.lang.tcl

Control - Wikipedia, the free encyclopedia
Text is available under the Creative Commons Attribution-ShareAlike License ;additional terms may apply. By using this site, you agree to the ...

WA fires: Wedge Island settlement fire burning out-of-control
A bushfire is bearing down on the Wedge Island settlement north of Perth on Wednesday afternoon.

WA fires: Lives, homes threatened by out-of-control bushfire near Wedge Island
Lives and homes in the Mid West coastal settlement of Grey remain potentially under threat from an out-of-control bushfire burning 60 kilometres ...

Megyn Kelly on Donald Trump: ‘He Doesn’t Get to Control the Media’
... again, he was told repeatedly our debate team is settled and then came that Instagram video he put out today.” “Trump is not used to not controlling ...

Be a Genius and take back control of your Safari browsing experience
Ever since Apple allowed the use of Safari content blockers in iOS 9 , a great many apps have been released to give users the ability to control ...

Comcast and Charter may soon control 70% of 25Mbps Internet subscriptions
... is allowed to buy cable rivals Time Warner Cable (TWC) and Bright House Networks (BHN), just two Internet service providers could control about ...

"Temporary" Capital Controls Coming to China?
... It still has about $3.3 trillion left according to estimates, but China cannot keep the current pace up forever. "Temporary" Capital Controls ...

This armband allows amputees to control their prosthetics in a futuristic new way
The Myo armband picks up subtle muscle gestures that can control prosthetics through Bluetooth. While the technology was developed for motion ...

“Partnership” Could Put Atlantic City Under State Control For 5 Years
The deal comes after a year-long consultant's study, results of which were submitted to Christie last week. Many of those recommendations are ...

Control your high health-care costs
Financial advisor Carolyn McClanahan offers five tips to help consumers with high deductibles control health expenses.

Resources last updated: 1/28/2016 9:16:24 PM