CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Feb 2004
    Location
    India
    Posts
    4

    Question Hook Windows Status Bar Text

    How can I copy (get) text from a Windows Status Bar?

    I want to make a DLL (program), which will Hook a 3rd Party Window and then get the text that is written in that windows Status Bar.
    But I don't know how my program can hook 3rd Party Window and get the control of the Status Bar.
    If I use SetWindowsHookEx hook function in the DLL then what would be the idHook for the Status Bar control.

    Please help.

  2. #2
    Join Date
    Aug 1999
    Location
    <Classified>
    Posts
    6,882
    You will need to hook SetWindowText API.
    Regards,
    Ramkrishna Pawar

  3. #3
    Join Date
    Feb 2004
    Location
    India
    Posts
    4
    Hi Krishna,

    You have asked me to hook SetWindowText API.

    But SetWindowText is used to change the text of a window or control. Please correct me if I am wrong.

    But my intention is to first hook a 3rd Party Window and then READ the text present in its Status Bar.

    I need the text of the Status Bar to use it for some other process. My intention is not to change the text.

    Another concern: Can SetWindowText or GetWindowText APIs be used as a Hook Id to be installed.

    Thanks in advance

    Rgds
    Tripti

  4. #4
    Join Date
    Apr 2003
    Location
    UK
    Posts
    83
    Pardon me for butting in, but I think what Krishnaa means is that if you hook WH_GETMESSAGE, and the WM_SETTEXT message, then you will be able to detect when the application sets the text of the status bar, and therefore read what the text is in the WM_SETTEXT message.

  5. #5
    Join Date
    Aug 1999
    Location
    <Classified>
    Posts
    6,882
    astanley is right.
    You have many options like hook the API or hook Window Proc using SetWindowsHookEx.
    To identify perticular window you can use FindWindow function.
    Spy++ will help you finding the class and name of that window.
    Regards,
    Ramkrishna Pawar

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured