NassauSky,
Here is how I might go about coding a solution:
AutoItSetOption ( "MustDeclareVars", 1)
Opt("GUIOnEventMode", 1)
HotKeySet("{ESC}", "_Exit")
Global $getCustomName = "Button"
Global $hGUI = GUICreate("myHelper")
Global $hExportList = GUICtrlCreateButton("Export List",200,25,80,25) ;x,y,w,h
GUICtrlSetOnEvent(-1, "myFunction")
GUISetState()
myFunction_Direct("Direct")
While 1
Sleep(10)
WEnd
Func myFunction_Direct($Param = True)
$getCustomName = $Param
myFunction()
$getCustomName = "Button"
EndFunc
Func myFunction(); Handle both a button press in EventMode and a call to the function
If $getCustomName = "Button" Then
MsgBox(0,"Custom Name","Called through button press")
Else
MsgBox(0,"Custom Name","Called through function call with param: " & $getCustomName)
EndIf
EndFunc
Func _Exit()
Exit
EndFunc
M23