PostMessage(hwnd,WM_KEYDOWN,(WPARAM)VK_ESCAPE,0);
如果发送CTRL+A怎么发呢
Alt+Enter,Alt+1,那,望各位高手指教
最好详细介绍后两个参数,先谢了,回答后就给分
如果发送CTRL+A怎么发呢
Alt+Enter,Alt+1,那,望各位高手指教
最好详细介绍后两个参数,先谢了,回答后就给分
解决方案 »
- 请教一个关于UDP编程的问题
- 有用过 CStaticRectangle类的么。。。
- 怎样获得IE网页中弹出的MESSAGEBOX的句柄???
- 如何实现QQ中的若干效果?
- WM_NOTIFY 和 WM_NOTIFY_REFLECT 有什么区别?
- 哪儿有单选按钮(对话框控件)的详细使用方法?
- 如何使视类的标题栏右端的"X"失效(即单击时不关闭)!请出招!
- 在线急等 ,dependency 右上部分的函数变红是什么意思?
- 想修改成多线程的,想了几天了,还没改出来。。。高手帮忙
- 这是不是一个宏?
- 关于隐藏显示MDI中菜单,工具栏,切分窗口的问题!!!
- 向DirectDraw表面写数据??急呀,帮我一下。
The WM_SYSKEYDOWN message is posted to the window with the keyboard focus when the user presses the F10 key (which activates the menu bar) or holds down the ALT key and then presses another key. It also occurs when no window currently has the keyboard focus; in this case, the WM_SYSKEYDOWN message is sent to the active window. The window that receives the message can distinguish between these two contexts by checking the context code in the lParam parameter. A window receives this message through its WindowProc function. LRESULT CALLBACK WindowProc(
HWND hwnd, // handle to window
UINT uMsg, // WM_SYSKEYDOWN
WPARAM wParam, // virtual-key code
LPARAM lParam // key data
);
应该发送WM_SYSKEYDOWN消息就可以吧。
lParam
lParam
Specifies the repeat count, scan code, extended-key flag, context code, previous key-state flag, and transition-state flag, as shown in the following table. Bit Description
0–15 Specifies the repeat count for the current message. The value is the number of times the keystroke is autorepeated as a result of the user holding down the key. If the keystroke is held long enough, multiple messages are sent. However, the repeat count is not cumulative.
16–23 Specifies the scan code. The value depends on the original equipment manufacturer (OEM).
24 Specifies whether the key is an extended key, such as the right-hand ALT and CTRL keys that appear on an enhanced 101- or 102-key keyboard. The value is 1 if it is an extended key; otherwise, it is 0.
25–28 Reserved; do not use.
29 Specifies the context code. The value is always 0 for a WM_KEYDOWN message.
30 Specifies the previous key state. The value is 1 if the key is down before the message is sent, or it is zero if the key is up.
31 Specifies the transition state. The value is always zero for a WM_KEYDOWN message.
ALT+ENTER 是不是直接发送Enter的WM_SYSKEYDOWN消息?没有试过
郁闷救命啊!
keydown 00000011(VK_CTRL) 001d001
keydown 00000031(VK_1) 0002001
keydown 00000031(VK_1) 00020001PostMessage(hwnd,WM_KEYDOWN,(WPARAM)VK_CONTROL,(LPARAM)0x1d01);
PostMessage(hwnd,WM_KEYDOWN,(WPARAM)0x31,(LPARAM)0x201);
//PostMessage(hwnd,WM_KEYUP,(WPARAM)0x31,(LPARAM)0x201);
//PostMessage(hwnd,WM_KEYUP,(WPARAM)VK_CONTROL,(LPARAM)0x1d01);
发不发WM_KEYUP一样,且Windows Media Player确实是在WM_KEYDOWN消息后就响应的
PostMessage(hwnd,WM_KEYDOWN,(WPARAM)VK_SPACE,(LPARAM)0);
可以控制它的播放和暂停,
怎样发送组合键哪?如Ctrl+1,Alt+Enter,各位大虾救命,这是我今天的任务,就是控制这该死的微软的Windows Media Player!可恶……
看样子,我的分你是拿定了。
good luck , 周末愉快 ,希望你不用加班加到太晚。
PostMessage(hwnd,WM_KEYDOWN,(WPARAM)VK_CONTROL,(LPARAM)0x1d0001);
PostMessage(hwnd,WM_KEYDOWN,(WPARAM)0x31,(LPARAM)0x20001);
error
用spy++跟踪Windows Media Player消息,组合键Ctrl+1被解释成了菜单消息(不知能否这样说)
发送PostMessage(hwnd,WM_COMMAND,(WPARAM)0xBE4,(LPARAM)0);就搞定啦!
明天结贴,啊!欢迎继续讨论