T
Hi.
Ich habe mich mal versucht und ExtTextOut gedetoured (?).
Funktioniert auch wunderbar, bis auf das der String immer leer ist und der Längen Parameter immer 0 ist. Ich weiß aber nicht wieso. Jeder andere Parameter scheint valid ausgefüllt zu sein. HDC ist valid, die Punkte (RECT) auch.
Hier ist mal eine kurze Zusammenfassung des Detours:
DETOUR_TRAMPOLINE(int __stdcall ExtTextOutTrampoline(HDC, int, int, UINT, const RECT*, LPCTSTR, UINT, const int*), ExtTextOutA);
CHistory::CHistory(void)
{
DetourFunctionWithTrampoline((PBYTE)ExtTextOutTrampoline, (PBYTE)CHistory::ExtTextOut);
}
CHistory::~CHistory(void)
{
DetourRemove((PBYTE)ExtTextOutTrampoline, (PBYTE)CHistory::ExtTextOut);
}
int __stdcall CHistory::ExtTextOut(HDC hdc, int X, int Y, UINT fuOptions, const RECT* lprc, LPCTSTR lpString, UINT cbCount, const int* lpDx)
{
m_pHistory->log("[x=%i, y=%i, w=%i, h=%i, l=%i] %s", lprc->left, lprc->top, lprc->right - lprc->left, lprc->bottom - lprc->top, cbCount, const_cast<char*>(lpString));
return ExtTextOutTrampoline(hdc, X, Y, fuOptions, lprc, lpString, cbCount, lpDx);
}
Hier ein kleiner Auszug der Logdatei:
[00:04:29] [x=0, y=0, w=482, h=361, l=0] (null)
[00:04:29] [x=10, y=133, w=462, h=145, l=0] (null)
[00:04:29] [x=317, y=55, w=155, h=22, l=0] (null)
[00:04:29] [x=10, y=87, w=462, h=36, l=0] (null)
[00:04:29] [x=10, y=288, w=383, h=42, l=0] (null)
[00:04:29] [x=0, y=0, w=21, h=21, l=0] (null)
[00:04:29] [x=4, y=4, w=13, h=12, l=0] (null)
[00:04:29] [x=0, y=126, w=21, h=21, l=0] (null)
[00:04:29] [x=4, y=130, w=13, h=12, l=0] (null)
[00:04:29] [x=0, y=0, w=21, h=106, l=0] (null)
[00:04:29] [x=4, y=44, w=13, h=60, l=0] (null)
[00:04:29] [x=300, y=7, w=155, h=22, l=0] (null)
[00:04:29] [x=0, y=0, w=299, h=50, l=0] (null)
[00:04:29] [x=0, y=0, w=482, h=1, l=0] (null)
Ich bin dankbar für alle Antworten.
Gruß
EDIT: TextOut und DrawText werden leider nicht aufgerufen, kann also nicht prüfen ob der String dort ausgefüllt wäre.