internal class OpenMainForm
{
public const int HWND_BROADCAST = 0xffff;
public static readonly int WM_SHOWME = RegisterWindowMessage("WM_SHOWME");
[DllImport("user32")]
public static extern bool PostMessage(IntPtr hwnd, int msg, IntPtr wparam, IntPtr lparam);//here
[DllImport("user32")]
public static extern int RegisterWindowMessage([MarshalAs(UnmanagedType.BStr)] string message);//here
}
Warnings: Since the method is a P/Invoke method, 'Open Main Form.PostMessage (IntPtr, int, IntPtr, IntPtr)' must be defined in a class named NativeMethods, SafeNativeMethods, Or UnsafeNativeMethods.