Article View: be.comp.programming
Article #5424Re: Api SetWindowsText
From: KLinZ
Date: Wed, 23 Apr 2003 23:22
Date: Wed, 23 Apr 2003 23:22
44 lines
3022 bytes
3022 bytes
Cofke wrote: > Ik had men licht nog eens opgestoken bij www.allapi.net. > Mijn test-projectje schrijft gewoon met de ene form text in de > textbox van de andere form.(2 verschillende projecten). > > Bij de zender ga je ;-opvragen de handle van het windowchild > (textbox) waar je naar wil schrijven. > -sendmessage(handle etc..) uMsg=2000 > > Bij de ontvanger -CallWindowProc > ********************************** > Public Sub HookForm(F As Form) > PrevProc = SetWindowLong(F.hwnd, GWL_WNDPROC, AddressOf WindowProc) > End Sub > > Public Sub UnHookForm(F As Form) > SetWindowLong F.hwnd, GWL_WNDPROC, PrevProc > End Sub > > Public Function WindowProc(ByVal hwnd As Long, ByVal uMsg As Long, > ByVal wParam As Long, ByVal lParam As Long) As Long > WindowProc = CallWindowProc(PrevProc, hwnd, uMsg, wParam, lParam) > If uMsg = 2000 Then > Form1.Text1 = Form1.Text1 & Str(uMsg) & vbCrLf & Str(lParam) > End If > End Function > ************************************ > > Als wilt stuur ik de 2 projecten wel eens door. Nee, dat hoeft niet. Ik ben wel met subclassing e.d. bekend. Ik vroeg me alleen af waarom je godsnaam subclassing zou gebruiken om zoiets op te lossen :-) Ik was eerst in de veronderstelling dat je geen toegang tot de broncode van de applicatie waarvan je de caption wilde wijzigen. In dat geval zou je namelijk wel van de SendMessage(hWnd, WM_SETTEXT, ... , ...) constructie gebruik moeten maken. In jouw geval levert dat weinig voordeel op omdat je toch op de 1/andere manier die handle moet doorgeven danwel op moet vragen. En dan maakt het niet veel meer uit of dat je dat met subclassing of op een andere manier doet. -- www.zenobits.com
Technical Details
Message-ID:
<CeFpa.3139$KF1.86807@amstwist00>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-09!supernews.com!diablo.theplanet.net!newsfeed.icl.net!newsfeed.fjserv.net!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> <uqfpa.2933$KF1.86438@amstwist00> <Xns9365ECC3D80C1cofke@195.130.132.68> <g8zpa.3070$KF1.86722@amstwist00> <Xns9366E0A80832cofke@195.130.132.69>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-23 16:24:01 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-03!sn-xit-06!sn-xit-09!supernews.com!diablo.theplanet.net!newsfeed.icl.net!newsfeed.fjserv.net!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> <uqfpa.2933$KF1.86438@amstwist00> <Xns9365ECC3D80C1cofke@195.130.132.68> <g8zpa.3070$KF1.86722@amstwist00> <Xns9366E0A80832cofke@195.130.132.69> Subject: Re: Api SetWindowsText Lines: 45 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: <CeFpa.3139$KF1.86807@amstwist00> Date: Thu, 24 Apr 2003 01:22:20 +0200 NNTP-Posting-Host: 212.187.71.152 X-Complaints-To: abuse@chello.nl X-Trace: amstwist00 1051140130 212.187.71.152 (Thu, 24 Apr 2003 01:22:10 MET DST) NNTP-Posting-Date: Thu, 24 Apr 2003 01:22:10 MET DST