soth3d Posted October 20, 2010 Posted October 20, 2010 Hi, It is my first post on the forum, hello everyone! I want to modify my simple script: $var = 1 Do WinWaitActive("Remote Desktop Connection") Send("{ENTER}") Until $var = 0 I am using it to close annoying message at the end of every remote desktop connection - that the computer will just get disconnected not switched off (I have Windows 2008 R2 and its still there ) The problem that I am having is that when I AM WAITING for the connection to remote computer the window (lets call it: please wait window) have exact same name as this window that I want get rid of at the end of the connection. So very often script is closing the window even before I am getting connected... and that is very frustrating. I had idea that I will change simple Send("{ENTER}" to something like /press OK/... but I am unable to work out how to do it. This is all info about requester that I want to get rid of: expandcollapse popup>>>> Window <<<< Title: Remote Desktop Connection Class: #32770 Position: 545, 397 Size: 417, 152 Style: 0x94C803C5 ExStyle: 0x00010101 Handle: 0x00000000000A00DA >>>> Control <<<< Class: Button Instance: 1 ClassnameNN: Button1 Name: Advanced (Class): [CLASS:Button; INSTANCE:1] ID: 1 Text: OK Position: 245, 94 Size: 75, 23 ControlClick Coords: 36, 9 Style: 0x50030000 ExStyle: 0x00000004 Handle: 0x00000000000A00E4 >>>> Mouse <<<< Position: 829, 522 Cursor ID: 0 Color: 0x292C73 >>>> StatusBar <<<< >>>> ToolsBar <<<< >>>> Visible Text <<<< OK Cancel This will disconnect your Remote Desktop Services session. Your programs will continue to run while you are disconnected. You can reconnect to this session later by logging on again. >>>> Hidden Text <<<< And here window that I want to left untouched (please wait for the connection window): expandcollapse popup>>>> Window <<<< Title: Remote Desktop Connection Class: #32770 Position: 508, 381 Size: 423, 137 Style: 0x94C800C4 ExStyle: 0x00010101 Handle: 0x0000000000270756 >>>> Control <<<< Class: Button Instance: 1 ClassnameNN: Button1 Name: Advanced (Class): [CLASS:Button; INSTANCE:1] ID: 5020 Text: Cancel Position: 330, 49 Size: 75, 23 ControlClick Coords: 25, 14 Style: 0x50010000 ExStyle: 0x00000004 Handle: 0x00000000000B0132 >>>> Mouse <<<< Position: 866, 466 Cursor ID: 0 Color: 0x000000 >>>> StatusBar <<<< >>>> ToolsBar <<<< >>>> Visible Text <<<< Connecting to: 192.168.137.101:3389 Cancel Configuring remote session... >>>> Hidden Text <<<< Thank you in advance Tomek
bogQ Posted October 20, 2010 Posted October 20, 2010 (edited) WinList func will return all windows names and window handles, you noticed that you have different winsize on that two wins, or diffrent text. so take WinGetPos or WinGetText with handles parametar to determine what win should you close. After that controlsend or controlclick with winactivate shud work Edit: or involve text parameter in your control command Edited October 21, 2010 by bogQ TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now