Results 1 to 10 of 10

Thread: New dialog/windows creation hook

  1. #1
    Join Date
    Oct 2010
    Posts
    48
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default New dialog/windows creation hook

    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

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: New dialog/windows creation hook

    When a widget is shown, a ShowEvent is delivered to it.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Oct 2010
    Posts
    48
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: New dialog/windows creation hook

    but how can I know that this widget was created?

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: New dialog/windows creation hook

    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.
    Last edited by wysota; 28th March 2011 at 17:09.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Oct 2010
    Posts
    48
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: New dialog/windows creation hook

    "Can't" is not a word in programming world... especially in windows

    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

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: New dialog/windows creation hook

    Quote Originally Posted by gilamran View Post
    "Can't" is not a word in programming world... especially in windows
    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?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. #7
    Join Date
    Oct 2010
    Posts
    48
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: New dialog/windows creation hook

    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

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: New dialog/windows creation hook

    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.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  9. #9
    Join Date
    Oct 2010
    Posts
    48
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: New dialog/windows creation hook

    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

  10. #10
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: New dialog/windows creation hook

    Quote Originally Posted by gilamran View Post
    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.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. WM_LBUTTONDBLCLK message and global mouse hook
    By rittchat in forum Qt Programming
    Replies: 18
    Last Post: 10th December 2010, 05:58
  2. Replies: 2
    Last Post: 19th September 2009, 07:18
  3. hook resizeEvent
    By prashant in forum Qt Programming
    Replies: 6
    Last Post: 7th September 2009, 12:35
  4. QT Keyboard Hook
    By MarcSchubert in forum Qt Programming
    Replies: 1
    Last Post: 6th May 2007, 12:28
  5. hook
    By incapacitant in forum Newbie
    Replies: 3
    Last Post: 29th August 2006, 20:53

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.