NvrBst Posted June 9, 2006 Share Posted June 9, 2006 Hello! Well, sorry if this is a silly question but maybe someone can help me anyway. I want to use a single AutoItX function (ToolTip). I can't add the dll as a reference (when I go to "Reference > Add Reference > Browse > Select the DLL" it says "could not be added. Please make sure that the file is a valid assembly or COM component." This is because I don't have AutoIt installed on my computer... I have 3 computer I work on (laptop/desktop/work) and I don't really want to install AutoIt just to use the tooltip function on all 3. Anyway my sob story behind, Could someone tell me if its possible to add a reference to my C# program (using the AutoItX.dll) without installing AutoIt? And still have it work on computer without AutoIt installed. Right now this is what I do (for future ref though I'd like to know how to reference without installing because this doesn't work too well if I want to do the entire class). [system.Runtime.InteropServices.DllImport("AutoItX3.dll", EntryPoint="AU3_ToolTip")] public static extern void ToolTip(string szTip, long nX, long nY); Is using "string szTip" okay? In the C++ it says "char* szTip". I ask this because I ran into some problems... the tooltip (after viewing) dissapears on its own after about 30 mins. I think it has to do with the garbage cleaner. I tried wrapping it in "unsafe" and such but it still dissapears after a while. Could someone possible give me the C# repersentation for that line? if it uses "char* szTip" do I need an "out" or "ref" or something? Lastly I'm not sure if this is possible but is there anyway to see how AutoIt functions work internally (a webpage, or if they are open sourced someplace)? I can't find what Windows API it uses to create the tool tip, and if possible I'd just like to pInvoke and create it myself so I don't have to transfer the AutoIt dll with my application (my application is like 50KBs, and the DLL is 92KBs ). Thanks, NvrBst Link to comment Share on other sites More sharing options...
Valik Posted June 9, 2006 Share Posted June 9, 2006 Did it occur to you to look at MSDN for a .NET Tooltip class? Link to comment Share on other sites More sharing options...
NvrBst Posted June 9, 2006 Author Share Posted June 9, 2006 (edited) Did it occur to you to look at MSDN for a .NET Tooltip class?Hello Aye, I tried that before I restored to the AutoIt DLL... The problem I had with the .NET ToolTip Class is that I must provide a control for the tooltip to be displayed. I'm using tooltip to display information in a video game using hotkeys (IE I press the ctrl-t key and then the tooltip pop's up at (0,0) and displays the current time, and keeps updating every 500ms untill I press ctrl-t again and it goes away). As a result I don't own the control and ran into some troubles.I would love to use that though... I have the handle and everything to the window I want to display the tooltip in, is there a way to convert that handle to a control (I tried a bunch of stuff but couldn't get it to work)? Or some generic control which will just display the tooltip anywhere on the screen like the AutoIt version does (or just make it so it wont take a control)?Sorry to be a bother ThanksNvrBstEDIT: Typo Edited June 9, 2006 by NvrBst Link to comment Share on other sites More sharing options...
Valik Posted June 10, 2006 Share Posted June 10, 2006 I don't use .NET so I can't help you if the Tooltip class doesn't do what you want. As far as AutoIt's Tooltip function, the code is in the last publicly available source release for AutoIt so you can see how it is done there. There should be a link to the source in the Developer's forum. Link to comment Share on other sites More sharing options...
NvrBst Posted June 10, 2006 Author Share Posted June 10, 2006 (edited) Ahh thank you kindly. I remember looking at the archive when looking for the source but I only went into the AutoItX folder which was empty I should of looked a bit harder. I see how its done now... You create a window using CreateWindowEx and just display tooltips onto that. I didn't realize you could create windows using topmost that would go infront of fullscreen applications (which i thought maintained topmost even if you tried to create windows infront of it)... but I guess I was wrong. Which means I can probably use the .NET ToolTip class, and just use the NativeWindow Class to create a window so I own the control to the window for the tooltips... If not I can just do it the way in the source Thanks so much, I'll go play with it some. NvrBst Also just for future reference, is there a way to reference an entire dll (like AutoItX) in C# which would allow you to just transport the dll with the application, and have it so you can run the exe from any folder (as long as the dll is with the exe), and on computer which don't have AutoIt installed? Basically the way DllImport works except referencing it (using it) like a COM Import? Edited June 10, 2006 by NvrBst Link to comment Share on other sites More sharing options...
Valik Posted June 10, 2006 Share Posted June 10, 2006 Hmm, no, that's not quite how the code works. I'm not creating any Windows and putting a tooltip on it, I'm just creating the tooltip directly and using it from there. Link to comment Share on other sites More sharing options...
Richard Robertson Posted June 11, 2006 Share Posted June 11, 2006 No, in order to create a reference to a DLL, it must be a COM dll. Even .Net assemblies are registered as COM I think. You will have to invoke functions through extern linkage. The .Net ToolTip class is very limited. Most of the time, it is more work than it is bonus. Loading unmanaged controls is very weird and I would suggest against it. Link to comment Share on other sites More sharing options...
rahoolm Posted February 3, 2014 Share Posted February 3, 2014 Hi, is this question answered? I am into same situation where in I want to show a tooltip on screen. Now, AutoItX is coming with .NET dll directly, can we create a tooltip at a particular location on screen or say in IE window. I am automation browser with WatiN .NET framework. Now I aim to show tooltip where on IE, I am clicking. Please post your solution if already done. Thanks a lot! Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 3, 2014 Moderators Share Posted February 3, 2014 rahoolm,This thread is over 7 years old - please do not necro-post again, just open a new thread. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area 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