Form - Modificando caption de outras janelas |
Top Previous Next |
Mudando o caption de qualquer janela: basta saber seu handle: ============================================================= var S: string; H: THandle; begin H := FindWindow(nil, 'Calculadora');
Setlength(S, 78); GetWindowText(H, PChar(S), 78); if Pos('Junior', S) = 0 then begin S := Copy(S, 1, Pos(#0, S) - 1); SetWindowText(H, PChar(S + ' - Junior')); end; end;
Additional Info: * 78 é o tamanho máximo de um caption de janela ------------------------------------------------------------------------------------------ I got the window handle from hooking in WH_MOUSE, the info which it provides on the window being manipulated can be got like so:
function MouseHookProc(Code: integer; Msg: WParam; MouseHook: Pointer): LResult; stdcall; var pMouse: ^MOUSEHOOKSTRUCT; begin pMouse := MouseHook; |