Article View: borland.public.cppbuilder.nativeapi
Article #11021Re: Push the button
From: Graham Reeds
Date: Thu, 04 Mar 2004 16:14
Date: Thu, 04 Mar 2004 16:14
24 lines
1670 bytes
1670 bytes
I managed to find away:
- Find the parent of the button. Using the desktop window doesn't work.
hWndMain = ::FindWindowEx(NULL, NULL, NULL, "Connection Parameters");
... error checking here...
- Now tunnel down looking for the button:
hWndButton = ::FindWindowEx(hWndMain, NULL, NULL, "Connect");
... error checking here...
- Now send a command to the button to push it:
int iCtrlId = ::GetDlgCtrlID(hWndButton);
::PostMessage(hWndMain, WM_COMMAND, MAKEWPARAM(iCtrlId, BN_CLICKED),
(LPARAM)GetDlgItem(hWndMain, iCtrlId));
- And there's the button pushed!
Now I am trying to find away of sending CTRL+R to the window...just a case
of finding the correct parameters to send to the PostMessage.
--
Graham Reeds,
grahamr@omnieng.co.uk | http://omnieng.co.uk
Technical Details
Message-ID:
<404755c6@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<40470629@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,2004dc726ced407e X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2004-03-04 08:40:40 PST From: "Graham Reeds" <grahamr@omnieng.co.uk> Newsgroups: borland.public.cppbuilder.nativeapi References: <40470629@newsgroups.borland.com> Subject: Re: Push the button Date: Thu, 4 Mar 2004 16:14:57 -0000 Lines: 26 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 NNTP-Posting-Host: 193.82.59.1 Message-ID: <404755c6@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1078416838 193.82.59.1 (4 Mar 2004 08:13:58 -0800) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail