Da hab ich was. Benutzt einen Maushook und viel Magie...ähm, Code von Assarbad und Luckie
Der Maushook (aufs nötigste reduziert):
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38:
| function MouseProc(nCode: Integer; wParam: WPARAM; lParam: LPARAM): LRESULT; stdcall; var lpView: PDLLData; buffer:PChar; begin result := CallNextHookEx(HookHandle, nCode, WParam, LParam); if nCode<0 then exit else begin desk := getwindow(getwindow(findwindow('ProgMan', nil), gw_child), gw_child); if (WParam = WM_MOUSEMOVE) then begin SendMsgHome(NOTIFY_MOVE,PMOUSEHOOKSTRUCT(LParam)^.hwnd); if PMOUSEHOOKSTRUCT(LParam)^.hwnd = desk then begin tst.pt := PMOUSEHOOKSTRUCT(LParam)^.pt; if ListView_HitTest(desk,tst)>=0 then begin SendMsgHome(NOTIFY_ITEM,tst.iItem); lpView:= OpenAndMapMMF; if Assigned(lpView) then try lpView^.wnd := desk; lpView^.MousePos:= tst.pt; Buffer:= StrAlloc(254); try ListView_GetItemText(desk,tst.iItem,0,buffer, strBufSize(buffer)); lpView^.ItemText:= StrPas(buffer); finally StrDispose(buffer); end; SendMsgHome(NOTIFY_TEXTAVAIL,0); finally CloseAndUnmapMMF(lpView); end; end else SendMsgHome(NOTIFY_ITEM,-1); end; end; end; end; |
SendMsgHome ist ein Broadcast mit per MemMappedFile mitgeteilter Privater MsgId. Die beiden Parameter landen in WPAram und LParam. Nix kompliziertes
Die Hauptanwendung hat dann neben dem Hook-Gedöns noch eine WndProc:
Delphi-Quelltext
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17:
| procedure TForm1.WndProc(var Message: TMessage); var Typ,Value:integer; begin Typ:= Message.WParam; Value:= Message.LParam; if not Visible and Assigned(lpview) and (Message.Msg = lpview^.WM_MOUSE_HOOK) then case typ of NOTIFY_ITEM : if Value<0 then WaitTimer.Enabled:= false; NOTIFY_TEXTAVAIL : begin WaitTimer.Enabled:= true; FFolderName:= lpView^.ItemText; end; end else inherited; end; |
Hoffe das hilft. Ist nicht vollständig, sollte aber recht gut weiter helfen

"The phoenix's price isn't inevitable. It's not part of some deep balance built into the universe. It's just the parts of the game where you haven't figured out yet how to cheat."