PDA

View Full Version : Enable/Disable controls.


HARRY01
11-24-2006, 06:10 PM
I cannot find an equivalent for Control_Hide to enable or disable a control.

So I tried it as follows:

#declare EnableWindow user32.dll EnableWindow 2 1

local r$;

r$=EnableWindow (int(BUTTON107$),int(true));
r$=EnableWindow (int(BUTTON108$),int(true));

it returns 0, meaning error.

Is does'n't work. Does somebody know why not?

Harry

kornalius
11-24-2006, 07:06 PM
It's

#declare EnableWindow apidll EnableWindow 2 1

You will see the declaration in Windows.ppl library but it is wrong, change the last number from 0 to 1.

I will add the function and the SWAPI functions too for 1.1.

You can add them yourself now (swapi.ppl):

proc Control_Enable(control$)
EnableWindow(control$, True);
end;

proc Control_Disable(control$)
EnableWindow(control$, False);
end;

func Control_Enabled(control$)
return(IsWindowEnabled(control$));
end;