/// <summary> /// Send a command to Winamp via SendMessage(), and receive a string result /// </summary> /// <param name="command">Command to send</param> /// <returns>Return value of command</returns> protected string SendIPCCommandString(IPCCommand command) { return(Marshal.PtrToStringAuto(Win32.SendMessage(_WinampWindow, WM_WA_IPC, 0, (Int32)command))); }
/// <summary> /// 从对应的browser 进程中消息过滤filter 处理 /// </summary> /// <param name="browser"></param> /// <param name="sourceProcess"></param> /// <param name="message"></param> /// <returns></returns> protected override bool OnProcessMessageReceived(CefBrowser browser, CefProcessId sourceProcess, CefProcessMessage message) { if (DumpProcessMessages) { Console.WriteLine("Render::OnProcessMessageReceived: SourceProcess={0}", sourceProcess); Console.WriteLine("Message Name={0} IsValid={1} IsReadOnly={2}", message.Name, message.IsValid, message.IsReadOnly); var arguments = message.Arguments; for (var i = 0; i < arguments.Count; i++) { var type = arguments.GetValueType(i); object value; switch (type) { case CefValueType.Null: value = null; break; case CefValueType.String: value = arguments.GetString(i); break; case CefValueType.Int: value = arguments.GetInt(i); break; case CefValueType.Double: value = arguments.GetDouble(i); break; case CefValueType.Bool: value = arguments.GetBool(i); break; default: value = null; break; } Console.WriteLine(" [{0}] ({1}) = {2}", i, type, value); } } var handled = MessageRouter.OnProcessMessageReceived(browser, sourceProcess, message); if (handled) { return(true); } //if (message.Name == "myMessage2") return true; //var message2 = CefProcessMessage.Create("myMessage2"); //var success = browser.SendProcessMessage(CefProcessId.Renderer, message2); //Console.WriteLine("Sending myMessage2 to renderer process = {0}", success); //var message3 = CefProcessMessage.Create("myMessage3"); //var success2 = browser.SendProcessMessage(CefProcessId.Browser, message3); //Console.WriteLine("Sending myMessage3 to browser process = {0}", success); if (message.Name.Equals(IPCCommand.CommandType.GET_COOKIE_FROM_BROWSER_PROCESS.ToString())) { var argumentsInMsg = message.Arguments; string domainName = argumentsInMsg.GetString(0); string message_cookies = argumentsInMsg.GetString(1); if (!string.IsNullOrEmpty(domainName)) { //todo call back if (!string.IsNullOrEmpty(message_cookies)) { var lstCookies = JsonConvert.DeserializeObject <List <CefCookie> >(message_cookies); IPCCommand.OnGetCookieFromBrowserProcess(domainName, lstCookies); } } } return(true); }
/// <summary> /// Send a command to Winamp via SendMessage() /// </summary> /// <param name="command">Command to send</param> /// <returns>Return value of command</returns> protected IntPtr SendIPCCommand(IPCCommand command) { //return SendMessage(_WinampWindow, WM_WA_IPC, (Int32) command, 0); return(Win32.SendMessage(_WinampWindow, WM_WA_IPC, 0, (Int32)command)); }
/// <summary> /// Send an IPC command to Winamp via SendMessage(), and return an int result /// </summary> /// <param name="command">Command to send</param> /// <returns>Return value of command</returns> protected int SendIPCCommandInt(IPCCommand command) { return(Win32.SendMessage(_WinampWindow, WM_WA_IPC, 0, (Int32)command).ToInt32()); }
/// <summary> /// Send an IPC command to Winamp via SendMessage(), and return an int result /// </summary> /// <param name="command">Command to send</param> /// <returns>Return value of command</returns> protected int SendIPCCommandInt(IPCCommand command) { return Win32.SendMessage(_WinampWindow, WM_WA_IPC, 0, (Int32)command).ToInt32(); }
/// <summary> /// Send a command to Winamp via SendMessage(), and receive a string result /// </summary> /// <param name="command">Command to send</param> /// <returns>Return value of command</returns> protected string SendIPCCommandString(IPCCommand command) { return Marshal.PtrToStringAuto(Win32.SendMessage(_WinampWindow, WM_WA_IPC, 0, (Int32)command)); }
/// <summary> /// Send a command to Winamp via SendMessage(), and receive a string result. /// </summary> /// <param name="command">Command to send</param> /// <returns>Return value of command</returns> protected string SendIPCCommandString(IPCCommand command) { return(Marshal.PtrToStringAuto(Win32.SendMessage(WinampHwnd, WM_WA_IPC, IntPtr.Zero, (Int32)command))); }
/// <summary> /// Send a command to Winamp via SendMessage() /// </summary> /// <param name="command">Command to send</param> /// <returns>Return value of command</returns> protected IntPtr SendIPCCommand(IPCCommand command) { //return SendMessage(_WinampWindow, WM_WA_IPC, (Int32) command, 0); return Win32.SendMessage(_WinampWindow, WM_WA_IPC, 0, (Int32)command); }
/// <summary> /// Send an IPC command to Winamp via SendMessage(), and return an int result. /// </summary> /// <param name="command">Command to send</param> /// <returns>Return value of command</returns> protected int SendIPCCommandInt(IPCCommand command) { return(Win32.SendMessage(WinampHwnd, WM_WA_IPC, 0, (int)command)); }
static extern void pcsx2ipc_write(IntPtr v, UInt32 address, UInt64 val, IPCCommand msg, bool batch);
static extern UInt64 pcsx2ipc_read(IntPtr v, UInt32 address, IPCCommand msg, bool batch);
public static void Write(IntPtr v, uint address, ulong val, IPCCommand msg, bool batch = false) { pcsx2ipc_write(v, address, val, msg, batch); }
public static ulong Read(IntPtr v, uint address, IPCCommand msg, bool batch = false) { return(pcsx2ipc_read(v, address, msg, batch)); }