API Calls - Check if a Button is Enabled/Disabled
Afternoon All,
Probably a simple answer but I cannot seem to find it 8-(
I want to check if a button on a dialog is Enabled or Disabled, I'm nearly There...
I've located the Dialog Window, found the handle for the button and I can simulate the button click all using API. But I need to check whether the btton is Enabled before I simulate the button click.
Does anybody know how to check the buttons enabled property in API once you have the handle ?
Cheers
Ken
Re: API Calls - Check if a Button is Enabled/Disabled
Its ok I found it !
Private Declare Function IsWindowEnabled Lib "user32.dll" (ByVal hwnd As Long) As Long
:)
Re: API Calls - Check if a Button is Enabled/Disabled
EnableWindow should do the enabling for you, and IsWindowEnabled can check if the button is enabled or not. Both are members of User32.
HTH :wave:
1 Attachment(s)
Re: API Calls - Check if a Button is Enabled/Disabled
'****
As not said: tested again - iswindowenabled worked
just fine!!
'****
Or you can try with GetwindowLong
but you might have to find out if the byte I test
for Vb CommandButton is the same for the control
of the software you are looking at - as it might not
be the same...
Let us know if any solution works (I tried the
IsWindowEnabled but it does not seem to work...)