PDA

View Full Version : how to get the status of an application called from another app.



jthacker
17th March 2010, 08:40
hi all,

i'm working on a simple gui design project.
in this i have made main project which shows 9 app icon in grid view like in mobile.

now when i click the miidle icon , i'm calling an application like eBook reader using QProcess, by giving the path of ebook reader to QProcess object.
with this object i can get the information that the ebook reader is running or not.

but my main target is to design a taskbar button to make ebook reader minimise and maximize (like in windows or linux).
so how can i get the information that ebookreader is minimized or maximized.

note:- i'm calling seperate executable file of ebook reader.
i'm using Qt Creator 1.3.1 based on Qt 4.6.2 in linux operating system.

thanks.
Jigar Thacker

aamer4yu
17th March 2010, 09:35
I dont think there is a cross platform solution to this. You will need either handle or id of the ebook reader app, and then send event to the OS to minimize / maximize that window.

And if ebook reader is a qt dialog or window, then probably you have its object. Then in this case you can use the object to maximize or minimize the ebook reader.

jthacker
17th March 2010, 09:52
Thanx for your reply "aamer4yu"

i made a mistake that i'm using unix but it's linux.

and ebook reader is not qt dialog or window but its a seperate qt application and i want to use that for raeding books in my project.

you told that i'll need id of the ebookreader process and hve to send event to OS for minimize/maximize but i don't know how to send events to OS for min./max.

does Qt have any class which can help me in this.

or

can you help me in this....?

wysota
17th March 2010, 11:07
Qt has no classes that influence other applications directly. I think the easiest way to do what you want is to rebuild this other application with dbus or shared memory facilities that will inform its environment that the state of the application has just changed. You will have to code both sides of this mechanism though. An alternative is to use XEmbed to embed the window of the ebook reader into your application (then you will know when it is minimized or maximized) or to hook into X11 event system and intercept appropriate messages sent by the window manager to the application in question.

jthacker
17th March 2010, 13:57
can you help to learn to send events to OS.
as "aamer4yu" told.

jthacker
17th March 2010, 14:38
can anybody help?

wysota
17th March 2010, 15:38
Search the Web for X11+events.

jthacker
20th March 2010, 07:05
hey wysota ,
i've dropped the idea of sending events to the OS but i liked to continue with shared memory.
i think it will be better, isn't it?

thanks.!