Jump to content
psynegy

Interacting with other GUI but not run interactively...

Recommended Posts

Hello, this might be an impossible task, but we have a small utility that is provided in part of a software package, it has a very simple GUI, which we want to automate as part of a scheduled task, so, essentially not logged in.

I've been able to get it to work visible, but I'm beginning to wonder if it's going to be possible when not logged in, as I've not had any luck so far.

Any pointers? Thanks!

Share this post


Link to post
Share on other sites

The answer probably depends heavily on what exactly is done with that utility.

Does it need to be run in the user context to function? 
What exactly does it do?

Jos

Share this post


Link to post
Share on other sites

Hi Jos,

Other than operating only by way of GUI, no, it's basically a 4 field form with an OK button, it's for changing passwords on a database (a database that we're not allowed to touch via any other method than with their tools).

image.png.4810cca131465fd499ba13e1defe3638.png

It's very frustrating that they refuse to provide a command line interface for doing this, but, it is what it is unfortunately.

Thanks!

Share this post


Link to post
Share on other sites

Okay, fantastic, thank you, it seems to work now I'm not using anything 'Active'.

If I need to get the value of an alert message that presents itself, how do I do that? I've been trying to get _WinAPI_GetWindow($hWnd, $GW_CHILD) to give me the hWnd of the child window, but, I've not been having any success. I imagine I'm missing something really obvious.

image.png.aa821025bf0850031e112c6fa1595736.png

Thanks again!

Share this post


Link to post
Share on other sites

Finally figured that issue out; there's an undocumented option of $GW_ENABLEDPOPUP for _WinAPI_GetWindow which returns what I need.

I've run into a different problem now though. The software I'm running will not launch that popup when run non-interactively. Seems to be a built in 'MessageBox' feature:

if (!SystemInformation.UserInteractive && (options & (MessageBoxOptions.ServiceNotification | MessageBoxOptions.DefaultDesktopOnly)) == (MessageBoxOptions)0)
{
    throw new InvalidOperationException(SR.GetString("CantShowModalOnNonInteractive"));
}

Unfortunately, I really need the information in that popup. Is there any way I can falsify the SystemInformation.UserInteractive variable for that application?

Thanks

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

×
×
  • Create New...