1
0
Fork 0

DBG+GUI: improved window proc query code

This commit is contained in:
mrexodia 2017-04-22 04:17:05 +02:00
parent b45f19da5e
commit 5aaa585c96
No known key found for this signature in database
GPG Key ID: FC89E0AAA0C1AAD8
3 changed files with 3 additions and 9 deletions

View File

@ -101,7 +101,7 @@ typedef struct
DWORD threadId;
DWORD style;
DWORD styleEx;
duint wndProc;//not used yet
duint wndProc;
bool enabled;
RECT position;
char windowTitle[MAX_COMMENT_SIZE];

View File

@ -180,6 +180,7 @@ static WINDOW_INFO getWindowInfo(HWND hWnd)
GetWindowRect(hWnd, &info.position); //Get Window Rect
info.style = GetWindowLong(hWnd, GWL_STYLE); //Get Window Style
info.styleEx = GetWindowLong(hWnd, GWL_EXSTYLE); //Get Window Stye ex
info.wndProc = (IsWindowUnicode(hWnd) ? GetClassLongPtrW : GetClassLongPtrA)(hWnd, GCLP_WNDPROC); //Get Window Proc (thanks to ThunderCls!)
info.enabled = IsWindowEnabled(hWnd) == TRUE;
info.parent = (duint)GetParent(hWnd); //Get Parent Window
info.threadId = GetWindowThreadProcessId(hWnd, nullptr); //Get Window Thread Id

View File

@ -326,14 +326,7 @@ void HandlesView::enumWindows()
for(auto i = 0; i < count; i++)
{
mWindowsTable->setCellContent(i, 0, ToHexString(windows[i].handle));
auto hwnd = HWND(windows[i].handle);
duint classproc;
//Thanks to ThunderCls!
if(IsWindowUnicode(hwnd))
classproc = GetClassLongW(hwnd, GCL_WNDPROC);
else
classproc = GetClassLongA(hwnd, GCL_WNDPROC);
mWindowsTable->setCellContent(i, 1, ToPtrString(classproc));
mWindowsTable->setCellContent(i, 1, ToPtrString(windows[i].wndProc));
mWindowsTable->setCellContent(i, 2, QString(windows[i].windowTitle));
mWindowsTable->setCellContent(i, 3, QString(windows[i].windowClass));
char threadname[MAX_THREAD_NAME_SIZE];