|
|
|
如何使用sendmessage方法向notepad窗口发送组合键ctrl-a
最初由 Vegeta 发布 不是记事本的代码。 我觉得应该是 EDIT控件相应的。 我按照dwing说的,按住ctrl键,然后向notepad的Edit控件发postmessage(key_down ,'A')就能够实现全选。 |
|
如何使用sendmessage方法向notepad窗口发送组合键ctrl-a
终于弄了个笨办法搞定了:直接修改目标程序,把检测ctrl的地方干掉,把ctrl-c的检测部分改为检测单字符F11,刚好F11这个键目标程序本身没有用到。 这个办法可以达到操控我的这个程序在后台运行了,但是实现方法不佳,通用性不强。个人认为好的办法还是应该inject & hook api。 hookapi的办法通用性比较强,向后台窗口发送组合键应该没有问题,有时间了一定要学一下。 |
|
WinMount 中文版出来了
想法不错! |
|
如何使用sendmessage方法向notepad窗口发送组合键ctrl-a
最初由 Vegeta 发布 当然不会去穷举注册码了。 使用keybd_event可能会影响前台程序的操作。比如word输入时,突然ctrl键被莫名按下。 |
|
如何使用sendmessage方法向notepad窗口发送组合键ctrl-a
dwing说的对,看代码: CODE:0070936A cmp word ptr [esi], 63h ; 按下的是'c'键吗? CODE:0070936E jz short loc_709376 CODE:0070936E CODE:00709370 cmp word ptr [esi], 43h ; 按下的是'C'键吗? CODE:00709374 jnz short loc_7093A7 CODE:00709374 CODE:00709376 CODE:00709376 loc_709376: ; CODE XREF: Ctrl_C_press+16j CODE:00709376 test [esp+8+var_8], 4 ; Ctrl键被按住了吗? CODE:0070937A jz short loc_7093A7 ; 如果ctrl没有被按住,跳开 CODE:0070937A CODE:0070937C call sub_433690 ;开始处理 ctrl-c 的 CODE:0070937C CODE:00709381 call sub_432F98 CODE:00709381 CODE:00709386 mov eax, [ebp+218h] CODE:0070938C call sub_404354 CODE:0070938C CODE:00709391 push eax CODE:00709392 call sub_433690 CODE:00709392 CODE:00709397 pop edx CODE:00709398 call sub_433184 CODE:00709398 CODE:0070939D mov eax, offset s_NX ; ;ctrl-c 事件处理完毕 CODE:007093A2 call sub_464B9C CODE:007093A2 CODE:007093A7 |
|
如何使用sendmessage方法向notepad窗口发送组合键ctrl-a
最初由 dwing 发布 看来只能用api hook,把GetKeyStat,GetKeyboardState,GetAsyncKeyState挂住,返回ctrl被按下的假相。 hook api对我来说,难度太大了,看起来是一个不可能完成的任务。 我的本意是操控一个软件在后台完成一系列的功能(全部操作完成可能需数小时)。如果使用keybd_event,的确可以完成模拟组合键,但是这样,操控过程就必须在前台完成,这时候我就不能用计算机搞别的事情了。 |
|
如何使用sendmessage方法向notepad窗口发送组合键ctrl-a
最初由 dwing 发布 不是这样。我把ctrl按住不放,然后发送一个A的WM_KEYDOWN消息过去,没有效果。 |
|
如何使用sendmessage方法向notepad窗口发送组合键ctrl-a
在网上搜了几天,没能搞定。发现网上问这个问题的人还比较多,似乎还没有好的解决方案。最恰当的问法是: 如何用SendMessage向另一程序的非焦点的窗口发送组合键? |
|
如何使用sendmessage方法向notepad窗口发送组合键ctrl-a
先感谢Vegeta的指导。 上述代码的确可以实现ctrl-a的功能。但是确不是我所需要的。 上述代码是通过发送select all消息过去,而不是发送ctrl-a消息。如果notepad把ctrl-a的功能改成完成其他某特定功能,而这个特定功能不能通过发送 EM_类的消息代替的。我现在想实现的是发送ctrl-a消息过去,让程序自己去处理。 (换个问题:如何发送 ctrl-p或ctrl-f按键?) |
|
|
|
如何使用sendmessage方法向notepad窗口发送组合键ctrl-a
void CCalcsylDlg::OnTestNotepad() { // TODO: Add your control notification handler code here HWND w1; w1=::FindWindow("Notepad",NULL); w1=::FindWindowEx(w1,NULL,"Edit",NULL); ::SendMessage(w1,WM_CHAR,'A',0); /* 可以成功的模拟字符A */ ::SendMessage(w1,WM_KEYDOWN,VK_CONTROL,0); ::SendMessage(w1,WM_KEYDOWN,'A',0); ::SendMessage(w1,WM_KEYUP,'A',0); ::SendMessage(w1,WM_KEYUP,VK_CONTROL,0); } 使用spy++看了一下,就是两个KEYDOWN,两个KEYUP消息,但上述代码不能模拟按键ctrl-a |
|
[ZT]tiny hexer v 1.7.1.8
看介绍和winhex差不多啊! |
|
[原创]Aspr2.XX_unpacker_v1.0
这个东东真牛!!!!!! |
|
|
操作理由
RANk
{{ user_info.golds == '' ? 0 : user_info.golds }}
雪币
{{ experience }}
课程经验
{{ score }}
学习收益
{{study_duration_fmt}}
学习时长
基本信息
荣誉称号:
{{ honorary_title }}
能力排名:
No.{{ rank_num }}
等 级:
LV{{ rank_lv-100 }}
活跃值:
在线值:
浏览人数:{{ visits }}
最近活跃:{{ last_active_time }}
注册时间:{{ user_info.create_date_jsonfmt }}
勋章
兑换勋章
证书
证书查询 >
能力值