Article View: be.comp.programming
Article #5508Re: Api SetWindowsText
From: KLinZ
Date: Tue, 22 Apr 2003 18:00
Date: Tue, 22 Apr 2003 18:00
36 lines
2285 bytes
2285 bytes
Cofke wrote:
> Met de API SetWindowsText kan ik de caption van windows en buttons
> aanpassen in andere programma's.
> Bestaat er ook een API die de text in een textvak kan aanpassen.
> Ik krijg de handle van een textbox wel opgevraagd door er als
> parameter de inhoud van de textbox aan mee te geven en schijnbaar
> aangepast ook (met enumchilds is de naam verandert), alleen de inhoud
> van de textbox zelf verandert niet mee.
De documentatie van SetWindowText() maakt melding van een kleine feature;
"SetWindowText cannot change the text of a control in another application."
en:
"If the target window is owned by the current process, SetWindowText causes
a WM_SETTEXT message to be sent to the specified window or control"
Om die controle te omzeilen kun je doen wat SetWindowText doet:
var
str: PChar;
begin
str := 'kl0nt';
SendMessage(WindowHandleGevondenMetEnumChilds, WM_SETTEXT, Lenght(str),
longint(str));
end;
Als dit niet mocht werken is er nog wel een andere oplossing, maar die voert
technisch erg ver en is bovendien niet echt betrouwbaar (code injection).
--
www.zenobits.com
Technical Details
Message-ID:
<uqfpa.2933$KF1.86438@amstwist00>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!news.maxwell.syr.edu!skynet.be!skynet.be!213.51.129.3.MISMATCH!newshub1.home.nl!home.nl!amsnews01.chello.com!amstwist00.POSTED!not-for-mailReferences:
<Xns9365999A4EADEcofke@195.130.132.68>Show Full Headers
Complete Article Headers
X-Google-Language: DUTCH,ASCII-7-bit X-Google-Thread: fcea4,2329ec1b170e6455 X-Google-Attributes: gidfcea4,public X-Google-ArrivalTime: 2003-04-22 11:00:07 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!news.maxwell.syr.edu!skynet.be!skynet.be!213.51.129.3.MISMATCH!newshub1.home.nl!home.nl!amsnews01.chello.com!amstwist00.POSTED!not-for-mail From: "KLinZ" <klinz@NOSPAMMERTSzenobits.com> Newsgroups: be.comp.programming References: <Xns9365999A4EADEcofke@195.130.132.68> Subject: Re: Api SetWindowsText Lines: 37 MIME-Version: 1.0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Message-ID: <uqfpa.2933$KF1.86438@amstwist00> Date: Tue, 22 Apr 2003 20:00:02 +0200 NNTP-Posting-Host: 212.187.71.152 X-Complaints-To: abuse@chello.nl X-Trace: amstwist00 1051034394 212.187.71.152 (Tue, 22 Apr 2003 19:59:54 MET DST) NNTP-Posting-Date: Tue, 22 Apr 2003 19:59:54 MET DST