Out of my head this would be done in VCL with something like

function ActivateApp(lparam, wparam : Integer) : Integer message WM_ACTIVATEAPP;