我有一个WinForms,Application.Run之前(新Form1的())我发送消息给其他应用程序WinForms:有没有办法在Application.Run(新的Form1())之前获得窗口句柄?
[DllImport("user32.dll")]
public static extern long SendMessage(IntPtr Handle, int Msg, int wParam, int lParam);
,但我不能让窗口的句柄,我想:
IntPtr Handle = Process.GetCurrentProcess().Handle;
但有时它会返回错误的句柄。
我该怎么做?非常感谢你!