Sign in to follow this  
Followers 0
BruceCopperField

Listing Windows Created By Other Users

2 posts in this topic

I am not quite familiar with Windows security. If I started a few processes under another user id using RunAs in Windows menu, would I be still able to see the Windows created by them and send keystroke/mouseclick to them? Would the security model be the same for XP and Vista?

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

IIRC, you can't send keystrokes to windows belonging to processes running with higher privileges than your script's. That will almost never happen in XP since pretty much everything runs with admin. access. The same does not happen if you have UAC enable in Vista/7.

Obs: Just tested it with two simple scripts in Windows 7, and it works like that: the window is visible, can be activated, but does not accept keystrokes from lower-privileged processes. They're completely ignored.

#RequireAdmin
#include <GUIConstantsEx.au3>

GUICreate("AU3-RUNAS-HIGH",500,500)
GUICtrlCreateEdit("",4,4,492,492)
GUISetState(@SW_SHOW)

While GUIGetMsg() <> $GUI_EVENT_CLOSE
WEnd

;#RequireAdmin
Global $hWnd = WinWait("AU3-RUNAS-HIGH")
If $hWnd Then
    WinActivate($hWnd)
    Send("asdw")
EndIf
Edited by danielkza

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0