PDA

View Full Version : Interacting with a dialog started with a QProcess



craven
30th September 2009, 18:58
Good Morning,

The problem is as follows, I am writing a batch converter that uses external programs to convert the files. Converting office binary files to the office xml files. I am converting a lot of excel files that have illegal formulas in them. This causes an assertion dialog to pop up. The assert dialog contains debug information and is modeless.

I want to be able get my program to automatically press/activate the ignore button.


I start the program using qprocess. I have tried the Write(), putChar(), and they successfully send the data, but this doesn't affect the assert dialog.

Any help or direction would be great.

Thanks!

wysota
30th September 2009, 19:48
Good Morning,
Morning? It's 7pm here :)


I want to be able get my program to automatically press/activate the ignore button.
I start the program using qprocess. I have tried the Write(), putChar(), and they successfully send the data, but this doesn't affect the assert dialog.

Any help or direction would be great.

The only solution I can think of and only on Windows is to use the native WinAPI calls - FindWindow() and PostMessage().

craven
30th September 2009, 20:01
Morning? It's 7pm here :)

Just about noon here. :-) The land of Canada.


The only solution I can think of and only on Windows is to use the native WinAPI calls - FindWindow() and PostMessage().

Don't have access to those. all I have is the QT tool kits.

It is a bit of a pain. Thanks though.

wysota
30th September 2009, 20:27
You don't have access to WinAPI on Windows? Hmm... how come?

craven
30th September 2009, 20:49
Rather, I haven't installed it. I am good with QT on linux, but this is my first foray into programming on a windows platform.

I am not even sure how I would go about getting them include.

May fortune favour the foolish.

wysota
30th September 2009, 21:00
You don't have to install WinAPI... It's the native programming environment on Windows. Qt uses it as well.

craven
30th September 2009, 22:16
Thanks, I think I got it figured out. I managed to get the findwindow and postmessage to work. we shall see how this all works.

I have to run the test, but it should work now.

Craven.