PDA

View Full Version : New dialog/windows creation hook



gilamran
28th March 2011, 16:07
Hi,
I'm injecting a DLL into a QT application.
I want to "know" (Maybe Events) about any new dialog/window that was opened...
is this possible with QT to "know" when a dialog opens?

Thanks

wysota
28th March 2011, 16:54
When a widget is shown, a ShowEvent is delivered to it.

gilamran
28th March 2011, 16:55
but how can I know that this widget was created?

wysota
28th March 2011, 16:57
In a general case you can't. If it has a parent then the parent will receive a ChildAdded event but windows usually don't have a parent so such information is not available. Only when a window is shown you can intercept its show event.

gilamran
28th March 2011, 17:06
"Can't" is not a word in programming world... especially in windows :D

Maybe I can check it say every 100mili sec. and see if there are new children to the main application...
Is THIS possible? if so, how?

Thanks

wysota
28th March 2011, 17:11
"Can't" is not a word in programming world... especially in windows :D
I would say that your statement applies to "works" more than to "can't".


Maybe I can check it say every 100mili sec. and see if there are new children to the main application...
And what do you intend to check exactly? Even if you access QApplication::topLevelWidgets() then doing that every 100ms might not be the wisest idea and you'll probably be getting a lot of false positives. Could you explain what you need this functionality for?

gilamran
28th March 2011, 19:23
My injected DLL is injected into FullTiltPoker and it will report the open table's data to some listener
My utility is intended for providing statistical information for the poker player about the other players in the open tables.

(there are many software with the same idea, but mine is intended to improve your game while playing)

Anyone with some information in this area?

Thanks

wysota
28th March 2011, 19:44
I still don't see how knowing about widgets being created might help you in any way. Please explain what you need this mechanism for.

gilamran
28th March 2011, 23:48
I want to report (From the injected DLL) to my listener ALL the open table's data...
There might be few tables open (dialogs) and my DLL should send ALL this data to the listener.

so, I want to know when a new table (dialog/widget) was opened/shown/closed

Thanks

wysota
29th March 2011, 01:01
so, I want to know when a new table (dialog/widget) was opened/shown/closed
So why are you asking about detecting creation of widgets? I have already told how how to detect when a window gets shown on the screen. If you don't understand what I suggested then say so instead of asking irrelevant questions.