security - Is HWND unique among a window station? -
assume created 2 desktops d1 , d2 in winsta0, , d2 has window b.
my question is:
can thread belonging d1 window b's caption text through getwindowtext(hwnd b, ....)?
the hierarchy session => window station => desktop => thread => window. session important when work service, run in isolated session 0. every session has @ least winsta0 interactive window station. session 0 has additional ones services.
a window station has multiple desktops, @ least default desktop interact , winlogon desktop, secure 1 that's used login , screen savers. plus additional ones create, d2 desktop.
a desktop has single desktop heap window objects stored. every hwnd unique in heap. you'll need getthreaddesktop() hop in hierarchy , go known thread desktop on creates windows. enumdesktopwindows() toplevel windows owned desktop.
getting thread id obstacle, you'll need @ least know process. can enumerate threads owned process with, say, createtoolhelp32snapshot().
that gets desktop handle. getwindowtext can work d1 handles, you'll need call setthreaddesktop() switch d2.
Comments
Post a Comment