ExtTextOut problems

May 3, 2010 at 4:40 PM

Hi,

I have a few problems :) plz help

When using extTextOut i get the string scrambled and the lines get mixed together What am i doing wrong?

I hooked extTextOut using EasyHook like this:

try
            {                
                CreateFileHook = LocalHook.Create(
                    LocalHook.GetProcAddress("gdi32.dll", "ExtTextOutW"),
                    new DExtTextOutW(ExtTextOutW_Hooked),
                   this);

                CreateFileHook.ThreadACL.SetExclusiveACL(new Int32[1]);

            }


my extTextOut is like this:
[DllImport("gdi32.dll", CharSet = CharSet.Auto, SetLastError = true, CallingConvention = CallingConvention.StdCall)]
static extern bool ExtTextOutW(IntPtr hdc,
int X,
int Y,
uint fuOptions,
[In] ref RECT lprc,
string lpString,
uint cbCount,
[In] IntPtr lpDx);

static bool ExtTextOutW_Hooked(
IntPtr hdc,
int X,
int Y,
uint fuOptions,
[In] ref RECT lprc,
string lpString,
uint cbCount,
[In] IntPtr lpDx)
{


try { DemoInjection This = (DemoInjection)HookRuntimeInfo.Callback; lock (This.Queue)
{
This.Queue.Push(lpString);

}
}
catch { } return ExtTextOutW(
hdc,
X,
Y,
fuOptions,
ref lprc,
lpString,
cbCount,
lpDx
);

}

And another question if i may. How can i constantly monitor a window which is out of focus or minimized(using this approach it does not work properly)

Thanks a lot!

May 5, 2010 at 12:28 AM

See http://easyhook.codeplex.com/Thread/View.aspx?ThreadId=45607