GtaSpider Posted June 22, 2008 Share Posted June 22, 2008 Hi allIs it possible to access to System.Windows.Forms? It's a kind of Net.Framework.I want to command the System.Windows.Forms.Application Object like in Delphi (Application.COMMAND, e.g. Application.Run)I tried it with ObjCreate("System.Windows.Forms") but this will return error code 1 Here i found two links, but they dont help me: Here and Here.Can anybody help me? Or is there a other way to makes this with AutoIt?:Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(true); Application.Run(new GlassForm());This is Delphi.Mfg / BEst Regards Spider www.AutoIt.de - Moderator of the German AutoIt Forum Link to comment Share on other sites More sharing options...
Richard Robertson Posted June 22, 2008 Share Posted June 22, 2008 I have never tried calling .Net through COM. You have to load mscorlib first though, and call other assemblies through that, if I recall. You could also just write your own assembly that has a COM object exposed, register it, put it in the GAC and all that. Then call your own COM object because it was written differently. Link to comment Share on other sites More sharing options...
GtaSpider Posted June 22, 2008 Author Share Posted June 22, 2008 And how to write my own COM obj? If it would possible i dont wanna have extra files.. www.AutoIt.de - Moderator of the German AutoIt Forum Link to comment Share on other sites More sharing options...
Richard Robertson Posted June 23, 2008 Share Posted June 23, 2008 If you know .Net, and you know how to use the MSDN, then you can write a .Net COM object. If you don't know .Net, then you shouldn't be trying to use it through COM. Link to comment Share on other sites More sharing options...
GtaSpider Posted June 23, 2008 Author Share Posted June 23, 2008 Ah well, i see, thank you for your .. uhm.. constructive post Anyone know how to acces the function "SetCompatibleTextRenderingDefault"? What i want to do with this? Maybe you know DWM (Vista's destopmanager). I want to blur professional things. I need this function, so the windowtext would be showed I hope somebody can help me. Thanks, your Spider www.AutoIt.de - Moderator of the German AutoIt Forum Link to comment Share on other sites More sharing options...
weaponx Posted June 23, 2008 Share Posted June 23, 2008 You can work with certain .NET objects: $DataList = ObjCreate("System.Collections.ArrayList") $DataList.Add("B") $DataList.Add("C") $DataList.Add("E") $DataList.Add("D") $DataList.Add("A") $DataList.Sort() $DataList.Reverse() For $strItem in $DataList ConsoleWrite( $strItem & @CRLF) Next Link to comment Share on other sites More sharing options...
GtaSpider Posted June 23, 2008 Author Share Posted June 23, 2008 Hi Thank you for you comment, but this wont work for System.Windows.Forms I also tried the same: $oNET = ObjCreate("System.Windows.Forms") ; <<--- This return an error $oNet.Application.SetCompatibleTextRenderingDefault(true) Your Spider www.AutoIt.de - Moderator of the German AutoIt Forum Link to comment Share on other sites More sharing options...
weaponx Posted June 23, 2008 Share Posted June 23, 2008 This script will show you the accessible classes:#321230On my system, it doesn't list any System.Windows classes. Link to comment Share on other sites More sharing options...
GtaSpider Posted June 23, 2008 Author Share Posted June 23, 2008 This script will show you the accessible classes:#321230On my system, it doesn't list any System.Windows classes.Do you use XP or Vista? On my XP there is also not this group, but on Vista it is.Here is a link wich says that there is a NET obj that calls on "System.Windows.Forms": http://msdn.microsoft.com/en-us/library/sy...dows.forms.aspxWait, i will boot now Vista, and tell you what the script u linked to said to me, thank you Your Spider www.AutoIt.de - Moderator of the German AutoIt Forum Link to comment Share on other sites More sharing options...
ProgAndy Posted June 23, 2008 Share Posted June 23, 2008 Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(true); Application.Run(new GlassForm()); I read something about it and I don't think, it will work with AutoIt. This command sets the Drawing Mode from .NET to GDI+ (instead of GDI32), but AutoIt uses it's own Function to draw. So this should only work for .NET-forms, not for native win32 / AutoIt-Forms I think. *GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes Link to comment Share on other sites More sharing options...
GtaSpider Posted June 23, 2008 Author Share Posted June 23, 2008 HiOh, on Vista there is also not a Regkey called "System.Windows.Forms" Is there no any other idea to call SetCompatibleTextRenderingDefault?Spider www.AutoIt.de - Moderator of the German AutoIt Forum Link to comment Share on other sites More sharing options...
Richard Robertson Posted June 23, 2008 Share Posted June 23, 2008 Ok. This goes back to my post on you knowing or not knowing .Net. "System.Windows.Forms" is a namespace. "System.Windows.Forms.Form" is the class. Stop trying to create an object of type namespace. Link to comment Share on other sites More sharing options...
GtaSpider Posted June 23, 2008 Author Share Posted June 23, 2008 Thanks for comment. I dont know .Net, but i want to create a script that will all help is in the forum. "$oNET = ObjCreate("System.Windows.Forms.Form")" also return an error. Spider www.AutoIt.de - Moderator of the German AutoIt Forum Link to comment Share on other sites More sharing options...
Richard Robertson Posted June 23, 2008 Share Posted June 23, 2008 (edited) Well, after looking a bit, the Form object doesn't appear to be promoted to a COM object. Edited June 23, 2008 by Richard Robertson Link to comment Share on other sites More sharing options...
GtaSpider Posted June 23, 2008 Author Share Posted June 23, 2008 Ok.. Is there any other possibility to access to the function? www.AutoIt.de - Moderator of the German AutoIt Forum Link to comment Share on other sites More sharing options...
Richard Robertson Posted June 23, 2008 Share Posted June 23, 2008 Why do you need to call it when it only applies to your own application's .Net controls? If you try calling it to make changes to your AutoIt GUI, it won't make any bit of difference. Link to comment Share on other sites More sharing options...
GtaSpider Posted June 23, 2008 Author Share Posted June 23, 2008 HiI need it, because i want to make this DWM working with AutoIt. It works perfect, but text wont shows correctly. There are two posibilitys to fix this. The firstone is with SetWindowLayered. I tried a lot, but this wont work. (i know the function.. but autoit can't do this)So i try it to make it like this way (near Fig. 10): http://msdn.microsoft.com/en-us/magazine/cc163435.aspxSpider www.AutoIt.de - Moderator of the German AutoIt Forum Link to comment Share on other sites More sharing options...
Richard Robertson Posted June 23, 2008 Share Posted June 23, 2008 Well the .Net function you are trying to call only makes changes to .Net objects. Sorry but unless you are also creating .Net forms, this function does you no good to call. Link to comment Share on other sites More sharing options...
weaponx Posted June 23, 2008 Share Posted June 23, 2008 You should have said that in the first place. I'm not running Vista so I won't be much help. Link to comment Share on other sites More sharing options...
GtaSpider Posted June 24, 2008 Author Share Posted June 24, 2008 Hi Ok, but is there a other possibility to access "Application" On VB it looks like this: Dim defaultValue As Boolean Application.SetCompatibleTextRenderingDefault(defaultValue) On C#: public static void SetCompatibleTextRenderingDefault ( bool defaultValue ) defaultValue = True or False (boolean) Thanks, your Spider www.AutoIt.de - Moderator of the German AutoIt Forum 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