ReachWgl Posted June 6, 2016 Share Posted June 6, 2016 I need a code for autoit container, which can get class object reference and pass it to function. I am calling a dll function with that object reference. Like example: say we have a Button on GUI Form , and label on GUI Form like that i want to get that object class reference. example control for group $Group = GUICtrlCreateGroup("Dummy Controll",60,110,372,175,-1,-1) GUICtrlCreateGroup("", -99, -99, 1, 1) I need a $Group Class object reference. Link to comment Share on other sites More sharing options...
ReachWgl Posted June 6, 2016 Author Share Posted June 6, 2016 10 minutes ago, ReachWgl said: I need a code for autoit container, which can get class object reference and pass it to function. I am calling a dll function with that object reference. Like example: say we have a Button on GUI Form , and label on GUI Form like that i want to get that object class reference. example control for group $Group = GUICtrlCreateGroup("Dummy Controll",60,110,372,175,-1,-1) GUICtrlCreateGroup("", -99, -99, 1, 1) I need a $Group Class object reference. Sorry forgot add dll function and it's parameters Show(Control control, Int32 x, Int32 y, Int32 width, Int32 height, resizeMode) i ant to pass Class Object as control. how to do that in AutoIt. Seems challenging in AutoIt to me. Link to comment Share on other sites More sharing options...
ReachWgl Posted June 6, 2016 Author Share Posted June 6, 2016 i have tried to get using ControlGetHandle i don't know is it a right way or wrong it returns 0 and i am getting error while running code Parameter is incorrect System.NullReferenceException: Object reference not set to an instance of an object. Link to comment Share on other sites More sharing options...
ReachWgl Posted June 6, 2016 Author Share Posted June 6, 2016 or i need a control id that will also help me.. Link to comment Share on other sites More sharing options...
spudw2k Posted June 6, 2016 Share Posted June 6, 2016 Well, the GUICtrlCreateGroup function returns the AutoIt Control ID, but I'm assuming that's not what you are talking about. Check out the WinGetClassList function. This link is to an example script where I use WinGetClassList to check if the mouse is hovering over any controls. Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX BuilderMisc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retreive SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose ArrayProjects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalcCool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
ReachWgl Posted June 6, 2016 Author Share Posted June 6, 2016 Well i am sending control in function args Show(Control control, Int32 x, Int32 y, Int32 width, Int32 height, resizeMode) I need to send Control Object to function. All i Know is We have Hwnd or Window and Control Id of control. Dll Function needs Control reference to run the code. Link to comment Share on other sites More sharing options...
ReachWgl Posted June 6, 2016 Author Share Posted June 6, 2016 1 hour ago, spudw2k said: Well, the GUICtrlCreateGroup function returns the AutoIt Control ID, but I'm assuming that's not what you are talking about. Check out the WinGetClassList function. This link is to an example script where I use WinGetClassList to check if the mouse is hovering over any controls. We can get controller id using _WinAPI_GetDlgItem($hWnd, $ctrlid) I Want to reference of that control to pass it on ( to .net Function) Link to comment Share on other sites More sharing options...
spudw2k Posted June 6, 2016 Share Posted June 6, 2016 Did you look at the WinGetClassList function? It produces a list of controls that can be referenced by name. Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX BuilderMisc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retreive SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose ArrayProjects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalcCool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
ReachWgl Posted June 6, 2016 Author Share Posted June 6, 2016 It gives class names, i need a reference of class object of control, which i have created in autoit application. thanks for replying me. still waiting for solution Link to comment Share on other sites More sharing options...
spudw2k Posted June 7, 2016 Share Posted June 7, 2016 I'm not sure what kind of reference you are looking for. Considering you already have means to collect the control class and handle (hWnd): Class names WinGetClassList Control Handle For AutoIt GUI/Controls - GUICtrlGetHandle For External (non-AutoIt) GUI Controls - ControlGetHandle I would have to imagine one of those is the type of reference you need (probably handle). Is there some documentation on the Show DLL function you are trying to use? I'm surprised the DLL function doesn't also need the GUI handle as a parameter. Spoiler Things I've Made: Always On Top Tool ◊ AU History ◊ Deck of Cards ◊ HideIt ◊ ICU ◊ Icon Freezer ◊ Ipod Ejector ◊ Junos Configuration Explorer ◊ Link Downloader ◊ MD5 Folder Enumerator ◊ PassGen ◊ Ping Tool ◊ Quick NIC ◊ Read OCR ◊ RemoteIT ◊ SchTasksGui ◊ SpyCam ◊ System Scan Report Tool ◊ System UpTime ◊ Transparency Machine ◊ VMWare ESX BuilderMisc Code Snippets: ADODB Example ◊ CheckHover ◊ Detect SafeMode ◊ DynEnumArray ◊ GetNetStatData ◊ HashArray ◊ IsBetweenDates ◊ Local Admins ◊ Make Choice ◊ Recursive File List ◊ Remove Sizebox Style ◊ Retrieve PNPDeviceID ◊ Retreive SysListView32 Contents ◊ Set IE Homepage ◊ Tickle Expired Password ◊ Transpose ArrayProjects: Drive Space Usage GUI ◊ LEDkIT ◊ Plasma_kIt ◊ Scan Engine Builder ◊ SpeeDBurner ◊ SubnetCalcCool Stuff: AutoItObject UDF ◊ Extract Icon From Proc ◊ GuiCtrlFontRotate ◊ Hex Edit Funcs ◊ Run binary ◊ Service_UDF Link to comment Share on other sites More sharing options...
ReachWgl Posted June 7, 2016 Author Share Posted June 7, 2016 Here is the Function which i am calling ComObj.Show(Control control, Int32 x, Int32 y, Int32 width, Int32 height, resizeMode) And another Way with out Function Just Passing Control Object Reference after creating com object ComObj.m_Ctrl = <Control Object Reference> ; Like Text Box, Button, Label, GroupBox, etc... it is declared as below in .net class Private m_Ctrl As Control just i want to pass GroupBox Control Reference ( It may be group box or button or may be textbox...) System.Windows.Forms.Control Public Class Control Inherits Component Implements IOleControl, IOleObject, IOleInPlaceObject, IOleInPlaceActiveObject, IOleWindow, IViewObject, IViewObject2, IPersist, IPersistStreamInit, IPersistPropertyBag, IPersistStorage, IQuickActivate, ISupportOleDropSource, IDropTarget, ISynchronizeInvoke, IWin32Window, IArrangedElement, IBindableComponent, IComponent, IDisposable 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