Sign in to follow this  
Followers 0

Controlling actions in a GUI

2 posts in this topic

Posted · Report post

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.

Share this post


Link to post
Share on other sites



Posted · Report post

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:

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.