Article View: borland.public.cppbuilder.nativeapi
Article #11583Re: FindWindow(), SendDlgItemMessage() and gaining access to external dialog at run-time....
From: Remy Lebeau (TeamB)
Date: Thu, 29 Jan 2004 22:53
Date: Thu, 29 Jan 2004 22:53
40 lines
2503 bytes
2503 bytes
"Mike Collins" <mikec@kr8.co.uk> wrote in message news:4019701c@newsgroups.borland.com... > 1) At design-time run a program like ExeScope or ResHacker > to examine the DLL's resource section in order to look at the > resource script for the dialog box get the ID's of the controls > that I need to access. You could also use WinSight or Spy++ at runtime for that. > 2) At run-time call FindWindow() to get a Handle to the dialog. That will only work if the Caption of the dialog does not change at runtime. > 2) Since I have a handle to the dialog and the ID of the control I > should be able to use SendDlgItemMessage() to 'issue' command > to the various controls? Yes. > If it is as I think, any pointers on which messages to send to > enable / disable buttons, set text in buttons and edit box's, > based on the fact that it's all been written in VC++. The fact that it is written in VC++ is irrelevant. Controls in dialogs are normal controls like any other, they are still created using CreateWindow/Ex(). The Win32 API documentation has tons of sections regarding messages for normal buttons, edits, etc. > Finally, is there anyway to 're-direct' what happens when a > certain control is accessed i.e. I want to re-direct one of the > buttons on this dialog so when the user clicks on it, my own > code is executed instead of the DLL's code. You need to subclass the dialog's window procedure, or alternatively use amessage hook via SetWindowsHookEx(). Gambit
Technical Details
Message-ID:
<40198d61$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<4019701c@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,4eefc5cc424422c6 X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2004-01-29 15:10:00 PST From: "Remy Lebeau \(TeamB\)" <gambit47.no.spam@no.spam.yahoo.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <4019701c@newsgroups.borland.com> Subject: Re: FindWindow(), SendDlgItemMessage() and gaining access to external dialog at run-time.... Date: Thu, 29 Jan 2004 14:53:54 -0800 Lines: 42 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: 67.22.138.253 Message-ID: <40198d61$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1075416417 67.22.138.253 (29 Jan 2004 14:46:57 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail