If this doesnt work, please supply more information.
Especially the panel defines.
If your using "pan_create" to create the panels,
there is no way (that I know of) to get their names.
Lets assume for now that your panel/s has a button calling function "hit_me"
Change "hit_me" to be like this.
(there is no changes required of the panel itself)
function hit_me(var button_num, PANEL* panel)
{
STRING* panel_name = str_create(panel->link.name);
... whatever was already here before
}
Hope this helps.