t_window

OllyDbg Plugin API

t_window

Type of window descriptor - structure describing window or control created by debugged application.

typedef struct t_window { // Description of window

ulong hwnd; // Window's handle

ulong dummy; // Must be 1

ulong type; // Type of window, TY_xxx

ulong parenthw; // Handle of parent or 0

ulong winproc; // Address of WinProc or 0

ulong threadid; // ID of the owning thread

ulong exstyle; // Extended window style

ulong style; // Window style

ulong id; // Identifier or menu handle

ulong classproc; // Address of default (class) WinProc

int child; // Index of next child

int level; // Level in genealogy (0: topmost)

int sibling; // Index of next sibling

int byparent; // Index when sorted by parent

char title[TEXTLEN]; // Window's title

char classname[TEXTLEN]; // Class name

char tree[MAXNEST]; // For internal use by OllyDbg

} t_window;

Members:

hwnd - handle of window (control) created by debugged application, cast to HWND to use as a handle in calls to Windows API routines;

dummy - ust be 1 to obey the rules of sorted data;

type - type of window. The only important flag here is TY_NEW;

parenthw - handle of parent window or NULL. In some case this may be the handle of desktop (obtainable by call to GetDesktopWindow();

winproc - address of window procedure associated with window in memory context of debugged application. On NT-based systems, GetWindowLong(hwnd,GWL_WNDPROC) returns 0 and OllyDbg uses code injection to obtain this address;

threadid - identifier of thread that owns window;

exstyle - extended style of window, set of WS_EX_xxx and similar flags;

style - style of window, set of WS_xxx and similar flags;

id - control's identifier;

classproc - address of window's class procedure. If classproc differs from winproc, window is subclassed;

title - ASCII string with window's title or text;

classname - ASCII string with window's class name.