Article View: borland.public.cppbuilder.nativeapi
Article #16596Re: Click a button on another application
From: Dubhglas
Date: Thu, 08 May 2003 14:53
Date: Thu, 08 May 2003 14:53
50 lines
2516 bytes
2516 bytes
Well, as a matter of fact, I found HAD to resort to EnumChildWindows() because the button's ID appears to change every time the program is run... Anyway, it works! Thanks again! "Dubhglas" <info_remove@pixel-gc.com> wrote in message news:3eb783a9@newsgroups.borland.com... > > Excellent! It works perfectly! > I used GetDlgItem because I am not very familiar with EnumChildWindows. > > Thank you so much for your help! > > > > > > "Remy Lebeau (TeamB)" <gambit47@yahoo.com> wrote in message > news:3eb6927d$1@newsgroups.borland.com... > > > > "Timothy H. Buchman" <tbuchmanPLEASE(at sign)REMOVEcitycenter.org> wrote > in > > message news:3eb64fa0$1@newsgroups.borland.com... > > > > > Here's a fine comprehensive answer by Gambit: > > > > Not quite as conprehensive as needed - it doesn't explain how to obtain > the > > HWND for the button in the first place. You have to do that first before > > you can do anything else with it. Use FindWindow() to get the HWND for > the > > main window of the application, and then either EnumChildWindows() or > > GetDlgItem() to get the HWND of the particular button on that window. In > > the case of GetDlgItem(), however, you need to know the button's ID first, > > which you can obtain beforehand using spy tools likw Borland's WinSight or > > Microsoft's Spy++ utilities, and then hard-code that ID into your code. > > > > > > Gambit > > > > > >
Technical Details
Message-ID:
<3eba6f5b@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-08!supernews.com!priapus.visi.com!news-out.visi.com!petbe.visi.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mailReferences:
<3eb633b0$1@newsgroups.borland.com> <3eb64fa0$1@newsgroups.borland.com> <3eb6927d$1@newsgroups.borland.com> <3eb783a9@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,d9604e51f8dfe8bf X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-05-08 07:59:54 PST From: "Dubhglas" <info_remove@pixel-gc.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <3eb633b0$1@newsgroups.borland.com> <3eb64fa0$1@newsgroups.borland.com> <3eb6927d$1@newsgroups.borland.com> <3eb783a9@newsgroups.borland.com> Subject: Re: Click a button on another application Date: Thu, 8 May 2003 16:53:10 +0200 Lines: 52 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 NNTP-Posting-Host: 80.105.70.126 Message-ID: <3eba6f5b@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1052405595 80.105.70.126 (8 May 2003 07:53:15 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-08!supernews.com!priapus.visi.com!news-out.visi.com!petbe.visi.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail