1: static LRESULT CALLBACK msghook(UINT nCode, WPARAM wParam, LPARAM lParam)
2: {
3: if(nCode < 0)
4: {
5: CallNextHookEx(hook,nCode,wParam,lParam);
6: return 0;
7: }
8: LPCWPRETSTRUCT msg = (LPCWPRETSTRUCT) lParam;
9: if(msg->message == LVM_EDITLABELA || msg->message == LVM_EDITLABELW)
10: {
11: GetClassName(msg->hwnd,className,255);
12: GetWindowText(msg->hwnd,wndName,255);
13: if(0==_tcscmp(className,_TEXT("SysListView32")))
14: {
15: if(0==_tcscmp(wndName,_TEXT("FolderView")))
16: {
17: hEditWnd = (HWND)msg->lResult;
18: GetWindowText(hEditWnd,className,255);//暂时放入className
19: SendMessage(hEditWnd,EM_SETSEL,0,findDot(className));
20: }
21: }
22: }
23: return CallNextHookEx(hook,nCode,wParam,lParam);
24: }