Jump to content

This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies. Find out more here. X
X


Photo

Controlling actions in a GUI


  • Please log in to reply
1 reply to this topic

#1 Polska

Polska

    Seeker

  • New Members
  • 3 posts

Posted 14 July 2010 - 05:55 PM

I've been working on a project to make my life easier at work where I've created a simple GUI to automate the tedious process of entering and filling out tickets in another application we'll call "Ticketer".

So a lot of how this works is that I fill out various fields in my GUI, and then press a "Create Ticket" button. This shifts over to the Ticketer, and fills out various fields and pushes various buttons by a combination of sending data to controls directly, using the clipboard and even some SendKey() calls.

The problem lies in that Ticketer talks to a SQL Server and at times its reaction can be slower than others, sometimes causing the actions kicked off by "Create Ticket" to lose synchronization and start to send data to controls that aren't visible or to the wrong fields. I want a way to just hit the "Create Ticket" button again to stop this action when this occurs, but since this is a single-process, single-threaded application I can't do anything until the function returns.

I did some searching on threading and came up with a couple posts from back in 2006 with less than elegant solutions, and a lot of other things where interprocess communication happens via sockets or temporary files.

For simplicities sake I am trying to keep this all within a single executable that I can distribute, which is why I investigated threading first. I am however open to any ideas that allow me to pass parameters to a thread/subprocess, communicate with it in real time, and receive a return value when it is completed.

I don't know if things have changed in the last 4 years or if most IPC is still done through sockets and files, but I am open to any suggestions of possible routes to take by those more experienced.







#2 PsaltyDS

PsaltyDS

    Most Venerable Penguin

  • MVPs
  • 13,279 posts

Posted 14 July 2010 - 08:43 PM

SendKey()? ;)

Are you using Send()?

You should be verifying the appropriate window and conditions are there before using ControlSend() to fill in your form. You can test that the control exists and is enabled before putting data in it, and other such checks to verify the script is in sync with the state of the GUI you are working with.

:blink:
Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users