Hooking ExtTextOutW and the string parameter

Discussion in 'MFC' started by testerkia, Jul 14, 2010.

  1. testerkia

    testerkia New Member

    Joined:
    Jul 14, 2010
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    Dear All,

    I am developing an app that will hook on to the ExtTextOutW and capture the text to be displayed on the screen and log it to a file.

    I am doing this on Windows XP and VC++ 2008.

    I have managed to do the above for a notepad app. I have used the Detour library and created a dll and and exported a function called Mine_ExtTextOutW which logs the string to a file and then calls the ExtTextOutW.

    The probelm arises when I use the applications other than notepad for example Internet Explorer.

    The hooking happens, ie my custom function Mine_ExtTextOutW is being called and the text is logged to a file. The problem is with the string that is logged. It displays some funny characters.

    I was trying to read some docs and looking for some pointers on the internet as to why it is happening. I found out that it was something to do with glyphs, fonts and unicode characters.

    Only English will be used in notepad and IE.(so no need to worry about other languages and unicode support for them)

    So how do I find out the exact contents of the string that is passed to ExtTextOutW, so that I can log English text and not some string filled with funny characters.

    Any help or pointers will be appreciated.

    Thanks.

    mich
     
  2. testerkia

    testerkia New Member

    Joined:
    Jul 14, 2010
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    EDIT : It is FireFox not IE
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice