Jump to content

ControlGetHandle not working propably


 Share

Recommended Posts

Hello everybody,

I do have a serious problem in getting the handle of a control.

Im using Windows VISTA and AutoIt3.

It seems that my script does get a handle of a certain control.

But each time I want to work with that handle my script crashes within this function.

So in fact I'm not able to work with this handle.

Here is my code snippet.

$hCtrl2 = ControlGetHandle($hCtrl1, "Test", "") ;control of SQL Server instance edit field

If IsHWnd($hCtrl2) Then

MsgBox(4096, "", "It's a valid HWND")

Else

MsgBox(4096, "", "It's not an HWND")

EndIf

MsgBox(4096, "", $hCtrl2)

ControlFocus($hCtrl2)

MsgBox(4096, "", "After") ; this line is not executed any more, the script crashes before.

What is wrong? The autoIt info Window shows all properties of that certain control in a fine manner.

Can anybody help me?

Thanks Thomas

Link to comment
Share on other sites

Hello everybody,

I do have a serious problem in getting the handle of a control.

Im using Windows VISTA and AutoIt3.

It seems that my script does get a handle of a certain control.

But each time I want to work with that handle my script crashes within this function.

So in fact I'm not able to work with this handle.

Here is my code snippet.

$hCtrl2 = ControlGetHandle($hCtrl1, "Test", "") ;control of SQL Server instance edit field

If IsHWnd($hCtrl2) Then

MsgBox(4096, "", "It's a valid HWND")

Else

MsgBox(4096, "", "It's not an HWND")

EndIf

MsgBox(4096, "", $hCtrl2)

ControlFocus($hCtrl2)

MsgBox(4096, "", "After") ; this line is not executed any more, the script crashes before.

What is wrong? The autoIt info Window shows all properties of that certain control in a fine manner.

Can anybody help me?

Thanks Thomas

Looks like it should be

ControlGetHandle("Test","",$hCtrl1)

What is $hCtrl1?

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.
Link to comment
Share on other sites

Hello everybody,

I do have a serious problem in getting the handle of a control.

Im using Windows VISTA and AutoIt3.

It seems that my script does get a handle of a certain control.

But each time I want to work with that handle my script crashes within this function.

So in fact I'm not able to work with this handle.

Here is my code snippet.

$hCtrl2 = ControlGetHandle($hCtrl1, "Test", "") ;control of SQL Server instance edit field

If IsHWnd($hCtrl2) Then

MsgBox(4096, "", "It's a valid HWND")

Else

MsgBox(4096, "", "It's not an HWND")

EndIf

MsgBox(4096, "", $hCtrl2)

ControlFocus($hCtrl2)

MsgBox(4096, "", "After") ; this line is not executed any more, the script crashes before.

What is wrong? The autoIt info Window shows all properties of that certain control in a fine manner.

Can anybody help me?

Thanks Thomas

You are providing the control handle where the Window title (or Window handle) belongs in the parameters for ControlFocus(). Look at ControlFocus parameters in the help file.

:P

Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
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...