Jump to content

Can't find Autoit Container


Recommended Posts

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

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

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.
 

Link to comment
Share on other sites

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

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

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.

Link to comment
Share on other sites

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

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...