static void TransformProcessToForeground() { ProcessSerialNumber psn = new ProcessSerialNumber(); Debug.Print("Setting process to be foreground application."); API.GetCurrentProcess(ref psn); API.TransformProcessType(ref psn, ProcessApplicationTransformState.kProcessTransformToForegroundApplication); API.SetFrontProcess(ref psn); }
public static extern int GetCurrentProcess(ref ProcessSerialNumber psn);
public static extern int SetFrontProcess(ref ProcessSerialNumber psn);
public static extern int TransformProcessType(ref ProcessSerialNumber psn, ProcessApplicationTransformState type);