Postmessage发送“ctrl + N”。记事本不工作 [英] Postmessage send "ctrl + N" to notepad not work

查看:173
本文介绍了Postmessage发送“ctrl + N”。记事本不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

但无法发送Ctrl + N键

有谁能帮帮我?我需要无需关注发送密钥



我尝试过:



But can't send "Ctrl + N" key
Can anyone help me? I need to send the key without focus

What I have tried:

PostMessage (hwnd, WM_SYSKEYDOWN, Keys.F, 2 ^ 29) 'Working - Alt + F
PostMessage (hwnd, WM_CHAR, Keys.A, & H1C0001) 'Working - Shift + a = A
PostMessage(hwnd, WM_KEYDOWN, VK_CONTROL, vbNull) '4 Not working
PostMessage(hwnd, WM_KEYDOWN, Keys.N, vbNull)
PostMessage(hwnd, WM_KEYUP, Keys.N, vbNull)
PostMessage(hwnd, WM_KEYUP, VK_CONTROL, vbNull)

推荐答案

请参阅此处: c# - 将CTRL-S消息发送到窗口 - 堆栈溢出 [ ^ ]



我从接受的答案中理解,发送Ctrl& key消息(最有可能也是shift& key等等,你不能使用PostMessage。



因此,检查接受的答案,它看起来很有希望。



我希望它有所帮助。
See here: c# - Sending CTRL-S message to a window - Stack Overflow[^]

What I understand from the accepted answer is, to send "Ctrl&key" messages (and most probably also "shift&key" etc. you can not use PostMessage.

Therefore check accepted answer, it looks promising for you.

I hope it helps.


我不是这种编程的追随者...



我建议使用标准方法来读/写文本文件。请参阅:

从Visual Basic中的文件读取| Microsoft Docs [ ^ ]

在Visual Basic中写入文件Microsoft Docs [ ^ ]

使用.NET Framework方法操作文件(Visual Basic) Microsoft Docs [ ^ ]
I'm not a follower of such of programming...

I'd recommend to use standard methods to read/write text files. See:
Reading from Files in Visual Basic | Microsoft Docs[^]
Writing to Files in Visual Basic | Microsoft Docs[^]
Manipulating Files by Using .NET Framework Methods (Visual Basic) | Microsoft Docs[^]


这篇关于Postmessage发送“ctrl + N”。记事本不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆