postmessage

window.addEventListener on a message emitted from an iframe

不问归期 提交于 2021-02-11 14:02:27
问题 I have two html files. The first is called post.html and it registers an event listener on the window and posts a message to the window: <html> <head> <script> window.addEventListener("message", function(event) { console.log("found event in post!", event) }); window.postMessage({ 'data': ["some data"] },"*"); </script> </head> <body> </body> </html> I have a second html file called listner.html that just listens for a message from the window and loads post.html as an iframe: <html> <head>

C# Click and drag or Mouse Wheel with PostMessage / SendMessage

China☆狼群 提交于 2021-02-05 09:42:40
问题 I am creating a CONSOLE application , I need to scroll a certain part of the window from positions (x = 350, y = 240) to (x = 350, y = 120) (vertical scroll), I tried different ways but I couldn't. I was also unable to use the WM_MOUSEWHEEL option. Follow the code I use for clicks that work perfectly, I just need to adapt it to click and drag or determine a Y point on the window and use the mouse scroll. Could you please help me? Sorry for bad English, I used a translator. public class Win32

SendKeys to inactive application

爷,独闯天下 提交于 2021-02-04 18:24:11
问题 I am trying to figure out how I can make my C# application to send keys to another application window, without focusing on it. I have a list of words and 3 notepads files. Imagine I have all 3 notepad windows opened in order, and my program would take the first word in the listbox and write it in the first Notepad window. The second word in the second Notepad window and third one in the third Notepad window. Then start over and continue. So I want it to post 1 word in each and continue like

Set Delta in a WM_MOUSEWHEEL message to send with PostMessage

廉价感情. 提交于 2020-12-08 00:51:35
问题 How can I set the Delta parameter of the WM_MOUSEWHEEL message and send the message to a Windows using PostMessage ? My code: [DllImport("user32.dll")] static extern bool PostMessage(IntPtr hWnd, uint Msg, int wParam, int lParam); const uint WM_MOUSEWHEEL = 0x020A; private int MAKELPARAM(int p, int p_2) { return ((p_2 << 16) | (p & 0xFFFF)); } Now I'm using it like this: IntPtr hwnd1; hwnd1 = FindWindow(null, "NoxPlayer"); Point location = new Point(1205,411); PostMessage(hwnd1, WM_MOUSEWHEEL

Set Delta in a WM_MOUSEWHEEL message to send with PostMessage

烂漫一生 提交于 2020-12-08 00:51:22
问题 How can I set the Delta parameter of the WM_MOUSEWHEEL message and send the message to a Windows using PostMessage ? My code: [DllImport("user32.dll")] static extern bool PostMessage(IntPtr hWnd, uint Msg, int wParam, int lParam); const uint WM_MOUSEWHEEL = 0x020A; private int MAKELPARAM(int p, int p_2) { return ((p_2 << 16) | (p & 0xFFFF)); } Now I'm using it like this: IntPtr hwnd1; hwnd1 = FindWindow(null, "NoxPlayer"); Point location = new Point(1205,411); PostMessage(hwnd1, WM_MOUSEWHEEL

Set Delta in a WM_MOUSEWHEEL message to send with PostMessage

て烟熏妆下的殇ゞ 提交于 2020-12-08 00:43:27
问题 How can I set the Delta parameter of the WM_MOUSEWHEEL message and send the message to a Windows using PostMessage ? My code: [DllImport("user32.dll")] static extern bool PostMessage(IntPtr hWnd, uint Msg, int wParam, int lParam); const uint WM_MOUSEWHEEL = 0x020A; private int MAKELPARAM(int p, int p_2) { return ((p_2 << 16) | (p & 0xFFFF)); } Now I'm using it like this: IntPtr hwnd1; hwnd1 = FindWindow(null, "NoxPlayer"); Point location = new Point(1205,411); PostMessage(hwnd1, WM_MOUSEWHEEL

How to send WM_INPUTLANGCHANGEREQUEST to app with modal window?

百般思念 提交于 2020-05-13 05:35:26
问题 I wrote a keyboard switcher, which works well, but fails if current application has modal window opened. On keyboard switch I do the following hwnd = GetForegroundWindow(); PostMessage(hwnd, WM_INPUTLANGCHANGEREQUEST, IntPtr.Zero, handle); where [DllImport("User32.dll", EntryPoint = "PostMessage")] private static extern int PostMessage(IntPtr hWnd, int Msg, IntPtr wParam, IntPtr lParam); [DllImport("user32.dll")] static extern IntPtr GetForegroundWindow(); but the language does not change.

How to send WM_INPUTLANGCHANGEREQUEST to app with modal window?

人走茶凉 提交于 2020-05-13 05:33:46
问题 I wrote a keyboard switcher, which works well, but fails if current application has modal window opened. On keyboard switch I do the following hwnd = GetForegroundWindow(); PostMessage(hwnd, WM_INPUTLANGCHANGEREQUEST, IntPtr.Zero, handle); where [DllImport("User32.dll", EntryPoint = "PostMessage")] private static extern int PostMessage(IntPtr hWnd, int Msg, IntPtr wParam, IntPtr lParam); [DllImport("user32.dll")] static extern IntPtr GetForegroundWindow(); but the language does not change.

前端爬坑日记之vue内嵌iframe并跨域通信

会有一股神秘感。 提交于 2020-04-06 02:03:22
由于该项目是基于原本的安卓app,做的微信h5,所以原来的使用webview的页面现在需要在vue中实现,那就是使用iframe 查看了很多很多文档,其中这一篇是很有价值的 https://gist.github.com/pboji... 点击预览 下面将3天的爬坑最终以问答的方式总结如下: 1、Vue组件中如何引入iframe? 2、vue如何获取iframe对象以及iframe内的window对象? 3、vue如何向iframe内传送信息? 4、iframe内如何向外部vue发送信息? 1、Vue组件中如何引入iframe? < template > < div class = "act-form" > < iframe :src = "src" > </ iframe > </ div > </ template > < script > export default { data () { return { src : '你的src' } } } </ script > 如上,直接通过添加iframe标签,src属性绑定 data 中的src,第一步引入就完成了 2、vue如何获取iframe对象以及iframe内的window对象? 在vue中,dom操作比不上jquery的$( '#id' )来的方便,但是也有办法,就是通过 ref < template > < div