C# SendMessage发送右键事件时,无法弹出菜单栏,如何解决
如题:
代码
[DllImport("user32.dll", EntryPoint = "SendMessage", SetLastError = true, CharSet = CharSet.Unicode)]
public static extern IntPtr SendMessage(IntPtr hWnd, uint wMsg, int wParam, string lParam);
public const int WM_RBUTTONDOWN = 0x204;
public const int WM_RBUTTONUP = 0x205;
IntPtr msg = new IntPtr(0x209FA);
SetForegroundWindow(msg);
SendMessage(msg, WM_RBUTTONDOWN, 0, (45 << 16) + 50);
SendMessage(msg, WM_RBUTTONUP, 0, (45 << 16) + 50);
无法响应右键菜单?