別のアプリケーションを右クリックし、コンテキスト メニュー (右クリック後に開いたもの) を取得し、そこから項目を選択する必要があります。
他のアプリケーション ハンドルで postMessage を使用できます。その結果、要求されたコンテキスト メニューが表示されましたが、そこから選択する方法がわかりません。
public const int WM_RBUTTONDOWN = 0x0204;
public const int WM_RBUTTONUP = 0x0205;
[System.Runtime.InteropServices.DllImport("user32.dll", EntryPoint = "SendMessage", CharSet = System.Runtime.InteropServices.CharSet.Auto)]
public static extern void SendMessage(IntPtr hWnd, int msg, int wParam, int lParam);
[System.Runtime.InteropServices.DllImport("user32.dll", EntryPoint = "PostMessage", CharSet = System.Runtime.InteropServices.CharSet.Auto)]
public static extern void PostMessage(IntPtr hWnd, int msg, int wParam, int lParam);
Point p = Cursor.Position;
PostMessage((IntPtr)123456, WM_RBUTTONDOWN, 0, 0);
PostMessage((IntPtr)123456, WM_RBUTTONUP, 0, 0);
次に何をすればよいですか (コンテキスト メニューが開いています)。
ありがとう、トーマー。