lod3n Posted January 8, 2007 Share Posted January 8, 2007 #include <GUIConstants.au3> $oRDP = ObjCreate("MsTscAx.MsTscAx") GUICreate("Embedded RDP control Test", 640, 480, -1 , -1, $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS) $GUIActiveX = GUICtrlCreateObj($oRDP, 10, 10, 620, 460) GUISetState() $oRDP.Server = "SERVERNAME" $oRDP.Domain = "DOMAIN" $oRDP.UserName = "USERNAME" $oRDP.Connect() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect WEnd GUIDelete() Exit Check out the TypeInfo of IDispatch for Microsoft RDP Client Control in OLEView for additional methods. [font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font] Link to comment Share on other sites More sharing options...
Rickbert Posted January 8, 2007 Share Posted January 8, 2007 This is great! I would like to make a GUI that has several TABs each having an RDP connection to a different server. However, as soon as I put the "GUICtrlCreateObj" within a TabItem, my GUI Locks up, and I can't type in the RDP window, nor can I close the GUI without cancelling the process. Any clues? Link to comment Share on other sites More sharing options...
lod3n Posted January 8, 2007 Author Share Posted January 8, 2007 Yes, it's a clipping problem, try adding $WS_CLIPCHILDREN to the window style. Not sure if that will work though, but I've seen solutions to similar problems posted before. [font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font] Link to comment Share on other sites More sharing options...
ptrex Posted January 9, 2007 Share Posted January 9, 2007 (edited) @lod3n This will solve the resizing problem. #include <GUIConstants.au3> $oRDP = ObjCreate("MsTscAx.MsTscAx") GUICreate("Embedded RDP control Test", 640, 480, -1 , -1, $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS) $GUIActiveX = GUICtrlCreateObj($oRDP, 10, 10, 620, 460) GUICtrlSetStyle ( $GUIActiveX, $WS_VISIBLE ) GUICtrlSetResizing ($GUIActiveX,$GUI_DOCKAUTO) GUISetState() $oRDP.Server = "server" $oRDP.Domain = "domain" $oRDP.UserName = "administrator" $oRDP.Connect() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect WEnd GUIDelete() Exit Enjoy !! ptrex Edited January 9, 2007 by ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New Link to comment Share on other sites More sharing options...
lod3n Posted January 9, 2007 Author Share Posted January 9, 2007 Nifty, thanks! You know, if i had more time, I'd combine this with the VNC active x control I helped with earlier, and make an all in one remote session admin thingy... [font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font] Link to comment Share on other sites More sharing options...
jaenster Posted January 14, 2007 Share Posted January 14, 2007 Wow , greate! -jaenster Link to comment Share on other sites More sharing options...
Krol Posted January 25, 2007 Share Posted January 25, 2007 How made autologin? Link to comment Share on other sites More sharing options...
ptrex Posted January 25, 2007 Share Posted January 25, 2007 @KrolHere you find all details you needRDP Methods & PropertiesEnjoy!!ptrex Contributions :Firewall Log Analyzer for XP - Creating COM objects without a need of DLL's - UPnP support in AU3Crystal Reports Viewer - PDFCreator in AutoIT - Duplicate File FinderSQLite3 Database functionality - USB Monitoring - Reading Excel using SQLRun Au3 as a Windows Service - File Monitor - Embedded Flash PlayerDynamic Functions - Control Panel Applets - Digital Signing Code - Excel Grid In AutoIT - Constants for Special Folders in WindowsRead data from Any Windows Edit Control - SOAP and Web Services in AutoIT - Barcode Printing Using PS - AU3 on LightTD WebserverMS LogParser SQL Engine in AutoIT - ImageMagick Image Processing - Converter @ Dec - Hex - Bin -Email Address Encoder - MSI Editor - SNMP - MIB ProtocolFinancial Functions UDF - Set ACL Permissions - Syntax HighLighter for AU3ADOR.RecordSet approach - Real OCR - HTTP Disk - PDF Reader Personal Worldclock - MS Indexing Engine - Printing ControlsGuiListView - Navigation (break the 4000 Limit barrier) - Registration Free COM DLL Distribution - Update - WinRM SMART Analysis - COM Object Browser - Excel PivotTable Object - VLC Media Player - Windows LogOnOff Gui -Extract Data from Outlook to Word & Excel - Analyze Event ID 4226 - DotNet Compiler Wrapper - Powershell_COM - New Link to comment Share on other sites More sharing options...
Krol Posted January 25, 2007 Share Posted January 25, 2007 2 ptrex 10x so much Link to comment Share on other sites More sharing options...
Krol Posted January 29, 2007 Share Posted January 29, 2007 I try: $oRDP.Server = "server" $oRDP.Domain = "domain" $oRDP.UserName = "administrator" $oRDP.PortablePassword ="BLAHBLAH" $oRDP.Connect() but error: The requested action with this object has failed. I have found only these parameters of the password, but I can not use not one propterty PortablePassword propterty PortableSalt propterty BinaryPassword property BinarySalt Method ResetPassword How? Can you help, please? Link to comment Share on other sites More sharing options...
nfwu Posted January 29, 2007 Share Posted January 29, 2007 @Krol: You'll find more help in the Support Forum.#) TwitterOut of date stuff:Scripts: Sudoku Solver | Webserver | 3D library (Pure AutoIt) | Wood's GadgetsUDFs: _WoodUniqueID() | _DialogEditIni() | _Console*() | _GetIPConfigData() | _URLEncode/Decode() Link to comment Share on other sites More sharing options...
AndyDLD Posted June 28, 2007 Share Posted June 28, 2007 Hi there,i tried your code but i have the same problem described here:Redraw/Clippinghttp://www.autoitscript.com/forum/index.ph...mp;#entry364827Anyone have an idea or solutions for this ?Greets,Andy Link to comment Share on other sites More sharing options...
lod3n Posted June 28, 2007 Author Share Posted June 28, 2007 (edited) Redraw problem fixed! expandcollapse popup#include <GUIConstants.au3> $oRDP = ObjCreate("MsTscAx.MsTscAx") $GUI = GUICreate("Embedded RDP control Test", 640, 480, 0, -1, $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS) $GUIActiveX = GUICtrlCreateObj($oRDP, 10, 10, 620, 460) GUICtrlSetResizing ($GUIActiveX,$GUI_DOCKAUTO) GUISetState() ;START - fixing the styles of the controls and the GUI to prevent clipping $hUIContainerClass = ControlGetHandle($GUI, "", "UIContainerClass1") $hUIMainClass = ControlGetHandle($GUI, "", "UIMainClass1") $hATL = ControlGetHandle($GUI, "", "ATL:46F016981") Const $WS_EX_NOPARENTNOTIFY = 0x4 Const $WS_EX_NOINHERITLAYOUT = 0x100000 $hUIContainerClassStyle = BitOR($WS_CHILD, $WS_CLIPCHILDREN, $WS_CLIPSIBLINGS, $WS_VISIBLE) ; 0x56000000 $hUIContainerClassStyleEx = BitOR($WS_EX_NOINHERITLAYOUT, $WS_EX_NOPARENTNOTIFY) ; 0x00100004 $hUIMainClassStyle = BitOR($WS_CHILD, $WS_CLIPCHILDREN, $WS_CLIPSIBLINGS, $WS_SYSMENU, $WS_VISIBLE) ; 0x56080000 $hUIMainClassStyleEx = 0x0 $hATLStyle = BitOR($WS_CHILD, $WS_CLIPCHILDREN, $WS_CLIPSIBLINGS, $WS_VISIBLE) ; 0x56000000 $hATLStyleEx = 0x0 $guiStyle = BitOR($WS_BORDER, $WS_CAPTION, $WS_CLIPCHILDREN, $WS_CLIPSIBLINGS, $WS_DLGFRAME, $WS_GROUP, $WS_MAXIMIZE, $WS_MAXIMIZEBOX, $WS_MINIMIZEBOX, $WS_SYSMENU, $WS_TABSTOP, $WS_THICKFRAME, $WS_VISIBLE) ; 0x17CF0100 $guiStyleEx = $WS_EX_WINDOWEDGE ; 0x00000100 _SetStyle($hUIContainerClass,$hUIContainerClassStyle,$hUIContainerClassStyleEx) _SetStyle($hUIMainClass,$hUIMainClassStyle,$hUIMainClassStyleEx) _SetStyle($hATL,$hATLStyle,$hATLStyleEx) _SetStyle($gui,$guiStyle,$guiStyleEx) Func _SetStyle($hwnd,$style,$exstyle) DllCall("user32.dll", "long", "SetWindowLong", "hwnd", $hwnd, "int", -16, "long", $style) DllCall("user32.dll", "long", "SetWindowLong", "hwnd", $hwnd, "int", -20, "long", $exstyle) EndFunc ;END - fixing the styles of the controls and the GUI to prevent clipping ;[EDIT] I went ahead and found out what hex values of the styles I originally posted here represented. ; $WS_EX_NOPARENTNOTIFY and $WS_EX_NOINHERITLAYOUT seem to be fairly important ; This may still be important for other projects with similar problems. $oRDP.Server = "server" $oRDP.Domain = "domain" $oRDP.UserName = "administrator" $oRDP.Connect() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect WEnd GUIDelete() Exit Edited June 29, 2007 by lod3n [font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font] Link to comment Share on other sites More sharing options...
AndyDLD Posted June 29, 2007 Share Posted June 29, 2007 Hi lod3n, thanks for youre code. I've tested it, but still nothing changes, i still have the problem. Link to comment Share on other sites More sharing options...
lod3n Posted June 29, 2007 Author Share Posted June 29, 2007 Are you running the latest version of AutoIt? [font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font] Link to comment Share on other sites More sharing options...
AndyDLD Posted June 29, 2007 Share Posted June 29, 2007 AutoIt v3.2.4.9 - Zipped Version, yes the latest current version so far. I've tried it again on a other machine with the same result. Link to comment Share on other sites More sharing options...
lod3n Posted June 29, 2007 Author Share Posted June 29, 2007 I don't know what to tell you. Without the fix, I get the same clipping problems you've described. With the fix, the clipping problems go away. I can cover and uncover the window, minimize and restore it, and it doesn't miss a beat. It may be possible that the class names on my version of the RDP control are somehow different from yours. See what this version reports in the Scite console: expandcollapse popup#include <GUIConstants.au3> $oRDP = ObjCreate("MsTscAx.MsTscAx") $GUI = GUICreate("Embedded RDP control Test", 640, 480, 0, -1, $WS_OVERLAPPEDWINDOW + $WS_VISIBLE + $WS_CLIPSIBLINGS) $GUIActiveX = GUICtrlCreateObj($oRDP, 10, 10, 620, 460) GUICtrlSetResizing ($GUIActiveX,$GUI_DOCKAUTO) GUISetState() ;START - fixing the styles of the controls and the GUI to prevent clipping $hUIContainerClass = ControlGetHandle($GUI, "", "UIContainerClass1") $hUIMainClass = ControlGetHandle($GUI, "", "UIMainClass1") $hATL = ControlGetHandle($GUI, "", "ATL:46F016981") ConsoleWrite("$hUIContainerClass (should not be 0 or blank):" & $hUIContainerClass & @crlf) ConsoleWrite("$hUIMainClass (should not be 0 or blank):" & $hUIMainClass & @crlf) ConsoleWrite("$hATL (should not be 0 or blank):" & $hATL & @crlf) Const $WS_EX_NOPARENTNOTIFY = 0x4 Const $WS_EX_NOINHERITLAYOUT = 0x100000 $hUIContainerClassStyle = BitOR($WS_CHILD, $WS_CLIPCHILDREN, $WS_CLIPSIBLINGS, $WS_VISIBLE) ; 0x56000000 $hUIContainerClassStyleEx = BitOR($WS_EX_NOINHERITLAYOUT, $WS_EX_NOPARENTNOTIFY) ; 0x00100004 $hUIMainClassStyle = BitOR($WS_CHILD, $WS_CLIPCHILDREN, $WS_CLIPSIBLINGS, $WS_SYSMENU, $WS_VISIBLE) ; 0x56080000 $hUIMainClassStyleEx = 0x0 $hATLStyle = BitOR($WS_CHILD, $WS_CLIPCHILDREN, $WS_CLIPSIBLINGS, $WS_VISIBLE) ; 0x56000000 $hATLStyleEx = 0x0 $guiStyle = BitOR($WS_BORDER, $WS_CAPTION, $WS_CLIPCHILDREN, $WS_CLIPSIBLINGS, $WS_DLGFRAME, $WS_GROUP, $WS_MAXIMIZE, $WS_MAXIMIZEBOX, $WS_MINIMIZEBOX, $WS_SYSMENU, $WS_TABSTOP, $WS_THICKFRAME, $WS_VISIBLE) ; 0x17CF0100 $guiStyleEx = $WS_EX_WINDOWEDGE ; 0x00000100 _SetStyle($hUIContainerClass,$hUIContainerClassStyle,$hUIContainerClassStyleEx) _SetStyle($hUIMainClass,$hUIMainClassStyle,$hUIMainClassStyleEx) _SetStyle($hATL,$hATLStyle,$hATLStyleEx) _SetStyle($gui,$guiStyle,$guiStyleEx) Func _SetStyle($hwnd,$style,$exstyle) DllCall("user32.dll", "long", "SetWindowLong", "hwnd", $hwnd, "int", -16, "long", $style) DllCall("user32.dll", "long", "SetWindowLong", "hwnd", $hwnd, "int", -20, "long", $exstyle) EndFunc ;END - fixing the styles of the controls and the GUI to prevent clipping ;[EDIT] I went ahead and found out what hex values of the styles I originally posted here represented. ; $WS_EX_NOPARENTNOTIFY and $WS_EX_NOINHERITLAYOUT seem to be fairly important ; This may still be important for other projects with similar problems. $oRDP.Server = "server" $oRDP.Domain = "domain" $oRDP.UserName = "administrator" $oRDP.Connect() While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect WEnd GUIDelete() Exit [font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font] Link to comment Share on other sites More sharing options...
AndyDLD Posted June 29, 2007 Share Posted June 29, 2007 Scite Output shows this: $hUIContainerClass (should not be 0 or blank): $hUIMainClass (should not be 0 or blank): $hATL (should not be 0 or blank): My msrdp.ocx has the version 5.1.2600.2180. My mstscax.dll has the version 5.1.2600.2180. A short time i had the RDP 6.0 Client installed. Could it be, that the install / uninstall of RDP 6 are importent ? Link to comment Share on other sites More sharing options...
lod3n Posted June 29, 2007 Author Share Posted June 29, 2007 (edited) My msrdp.ocx has the version 5.1.2600.2180My mstscax.dll has the version 6.0.6000.16386That must be the problem. The class names are different between the two different ActiveX control versions. Why did you downgrade?In any case, there must be a way to solve this. Could you add this:Opt("WinSearchChildren", 1) ;0=no, 1=search children also ConsoleWrite(WinGetClassList($GUI,"")to the script just before the message loop, and report back what your controls are called? Hopefully that will pull all of the nested child controls that I originally discovered with Spy++ to build the fix. Edited June 29, 2007 by lod3n [font="Fixedsys"][list][*]All of my AutoIt Example Scripts[*]http://saneasylum.com[/list][/font] Link to comment Share on other sites More sharing options...
AndyDLD Posted July 19, 2007 Share Posted July 19, 2007 hi lod3n, sorry for the long time since i answer. We downgrade, because, we had/have some problems with the rdp 6 client (saved rdp-files, server hangs up when be accesed with rdp 6 and so on ...). Here's the output from Scite with the latest codelines: $hUIContainerClass (should not be 0 or blank): $hUIMainClass (should not be 0 or blank): $hATL (should not be 0 or blank): ATL:6A688220 UIMainClass UIContainerClass IHWindowClass OPWindowClass But im tested the latest code on a machine with rdp 6, but the same clipping problem. Here's the scite output: $hUIContainerClass (should not be 0 or blank): $hUIMainClass (should not be 0 or blank): $hATL (should not be 0 or blank): ATL:46BF1698 UIMainClass UIContainerClass IHWindowClass OPWindowClass OPWindowClass Hope, this could help to solve this. Greets, Andy Link to comment Share on other sites More sharing options...
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