Jump to content
ReachWgl

Can't find Autoit Container

Recommended Posts

ReachWgl

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.

Share this post


Link to post
Share on other sites
ReachWgl
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. 

 

 

Share this post


Link to post
Share on other sites
ReachWgl

 

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.

 

 

 

Share this post


Link to post
Share on other sites
ReachWgl

or i need a control id that will also help me..

Share this post


Link to post
Share on other sites
spudw2k

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.
 

Share this post


Link to post
Share on other sites
ReachWgl

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.

Share this post


Link to post
Share on other sites
ReachWgl
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)

Share this post


Link to post
Share on other sites
spudw2k
ReachWgl

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

Share this post


Link to post
Share on other sites
spudw2k

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.

Share this post


Link to post
Share on other sites
ReachWgl

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

 

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.