|
<看雪论坛精华>杀毒软件报有病毒
什么软件?能解压CHM? |
|
如何使用sendmessage方法向notepad窗口发送组合键ctrl-a
前天我自己写了个对话框程序,上面放了个EDIT,运行后执行CTRL+A没有全选的效果.看记事本里的一段代码: /* 01002ECD |.^\0F85 32FDFFFF JNZ notepad.01002C05 01002ED3 |. FF35 30980001 PUSH DWORD PTR DS:[1009830] ; /hWnd = 000F03E2 ('无标题 - 记事本',class='Notepad'); Case 19 of switch 01002BBE 01002ED9 |. FF15 64120001 CALL DWORD PTR DS:[<&USER32.GetMenu>] ; \GetMenu 01002EDF |. 8B3D 40120001 MOV EDI,DWORD PTR DS:[<&USER32.SendMessa>; USER32.SendMessageW 01002EE5 |. 56 PUSH ESI ; /lParam 01002EE6 |. 56 PUSH ESI ; |wParam 01002EE7 |. 6A 0E PUSH 0E ; |Message = WM_GETTEXTLENGTH 01002EE9 |. FF35 38980001 PUSH DWORD PTR DS:[1009838] ; |hWnd = 1403EA 01002EEF |. 8BD8 MOV EBX,EAX ; | 01002EF1 |. FFD7 CALL EDI ; \SendMessageW 01002EF3 |. 50 PUSH EAX ; /lParam 01002EF4 |. 56 PUSH ESI ; |wParam 01002EF5 |. 68 B1000000 PUSH 0B1 ; |Message = EM_SETSEL 01002EFA |. FF35 38980001 PUSH DWORD PTR DS:[1009838] ; |hWnd = 1403EA 01002F00 |. FFD7 CALL EDI ; \SendMessageW */ 当按下CTRL+A的时候: hWnd = 000F03E2 ('无标题 - 记事本',class='Notepad'); Case 19 of switch 01002BBE 然后向EDIT里发送EM_SETSEL消息. 后悔没系统的学习WIN编程... |
|
如何使用sendmessage方法向notepad窗口发送组合键ctrl-a
EDIT控件不响应CTRL+A,记事本里的是主窗口响应,然后发消息EM_SETSEL给EDIT控件. 另:你传上来的那段代码不是记事本里的吧. |
|
如何使用sendmessage方法向notepad窗口发送组合键ctrl-a
LZ不会是穷举注册码吧? 有个变通的方法,可以控制究竟谁能响应CTRL+A,还不是很完美,继续研究中…… #include <windows.h> int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { HWND hwnd=NULL; hwnd=FindWindow("Notepad",0); hwnd=FindWindowEx(hwnd,0,"Edit",0); if (hwnd) { keybd_event(VK_CONTROL,0,0,0); PostMessage(hwnd,WM_KEYDOWN,65,0); PostMessage(hwnd,WM_KEYUP,65,0); keybd_event(VK_CONTROL,0,KEYEVENTF_KEYUP,0); } else MessageBox(NULL,"[Notepad] 未发现!","错误!",NULL); CloseHandle(hwnd); return 0; } |
|
|
|
如何使用sendmessage方法向notepad窗口发送组合键ctrl-a
/* * Send CTRL+A Message To Edit Control * 版权所有 (C) 2007 天津 赵春生 * 2007.02.11 16:22 * http://timw.yeah.net * http://timw.126.com * 本程序适用于:WinXP+SP2[Notepad] * 代码在WinXP+SP2 + VC6+SP6测试通过 */ #include <windows.h> int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { HWND hwnd=NULL; hwnd=FindWindow("Notepad",0); hwnd=FindWindowEx(hwnd,0,"Edit",0); if (hwnd) { SendMessage(hwnd,EM_SETSEL,0,-1);//从开始到文本末尾 } else MessageBox(NULL,"[Notepad] 未发现!","错误!",NULL); CloseHandle(hwnd); return 0; } |
|
|
|
|
|
[讨论]怎样将程序挂起?
搜索 DEBUGAPI |
|
[求助]98下writeprocessmemory系统蓝屏
用SI在98下写蓝屏吗? |
|
[求助]关于浮点型数据
http://bbs.pediy.com/showthread.php?threadid=6835 |
操作理由
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 }}
勋章
兑换勋章
证书
证书查询 >
能力值