PC SOFT

FOROS PROFESIONALES
WINDEVWEBDEV y WINDEV Mobile

Inicio → WINDEV 2024 → [WD20] Is it possible to add parameters to a default process block?
[WD20] Is it possible to add parameters to a default process block?
Iniciado por guest, 10,ago. 2015 19:37 - 2 respuestas
Publicado el 10,agosto 2015 - 19:37
I want to parameterize Closing WIN_Main. The code below works, but I can't figure out how to call the process with a parameter. I would like to be able to know if the program is being closed by a window button or by the system tray icon.

PROCEDURE ClosingWIN_Main(nType is int = 0)
Publicado el 10,agosto 2015 - 21:04
Hi Curtis,

You should be able to identify this from within the code itself using introspection with dbgInfo() or add it as a default parameter.
Something like:
PROCEDURE ClosingWIN_Main(nType is int = 0, pCallingProcess is string = dbginfo(dbgElement, dbgCallingProcess)) SWITCH pCallingProcess CASE ~= "WindowX.BtnY": do something OTHER CASE: do something else END
Cheers,

Peter Holemans
Publicado el 10,agosto 2015 - 21:55
DbgInfo() returns 'WIN_Main' wether I click on the the X or I select an option from the system tray popup menu.

EDIT: Nevermind. I got dbgInfo(dbgElement,dbgCallingProcess) to give me the name of the menu option when using the system tray icon to close. Thanks.