Hi,
the button id number and the panel pointer are passed as parameters to the button function:

Code:
function fncButton ( var button, PANEL *panel )



Salud!