I have a DBGrid on a form and I have made multiple selections, I now need to send the selected cells (they are email addresses) to the "TO Box" of Outlook how can I do this, I will appreciate any help ( Delphi5) Thanks in advance
相关问题
- Is there a Delphi 5 component that can handle .png
- Is there a way to install Delphi 2010 on Windows 2
- Is TWebBrowser dependant on IE version?
- iOS objective-c object: When to use release and wh
- DBGrid - How to set an individual background color
相关文章
- Best way to implement MVVM bindings (View <-> V
- Windows EventLog: How fast are operations with it?
- How to force Delphi compiler to display all hints
- Coloring cell background on firemonkey stringgrid
- HelpInsight documentation in Delphi 2007
- Can RTTI interrogate types from project code at de
- What specifically causes EPrivilege to be raised?
- Equivalent to designer guidelines in code
Every (almost) control in Windows is a window itself. It has got its class and instance name. Since the construction of every MailTo window in each mail client remains the same, after gaining knowledge how to find appropriate control a solution can be built.
This is where Spy++ from Visual Studio comes in handy (if you do not have it, try to find some similar tool, there is a freeware version at http://msdn.microsoft.com/pl-pl/magazine/cc163617(en-us).aspx but it lacks cool searching tool).
So, After starting Spy++ and mail program, we hit “New mail” and mailing window will appear. Refresh in Spy++, and use “Find window” tool – click on your TO list, and you will se how it is built.
I started with Outlook Express. The mail window is of class ATH_Note, then inside address area is a window of class OE_Envelope and inside this window there are several windows, some of them are of class RichEdit20W. The “To” field is the first one.
Note: FindWindowEx when second param is 0 will always search for FIRST in the row – so, but if you will do sth like this:
The text will be put in a SECOND edit field. See msdn for FindWindowEx.
So, this is good for OE (XP SP3 IE7). But what with MS Outlook? I checked it with Spy++ at work and “To” Field is a second in a row “RichEdit20WPT” class (note T on the end), parent class is “#32770 (Dialog)”, parent of this is “AfxWndW” and once again parent class is “AfxWndW” (this is some kind MS-style TPanel in TPanel) and – tadam! – mail window is of a class “rctrl_renwnd32”. So the pseudocode for this will be:
Probably you will want to use WM_GETTEXT to extract current text and update new text accordingly, but this is beyond the scope of getting into edit field.
BTW: This code strongly depends of outlook version, so try to check your version with Spy++ before).
To get list of selected E-Mails you can use this procedure. For outlook you might want to use shellexec and mailto: or use API if there's any.
smok1: have you checked if your solution is actually working? Try to click Send button. OE says there is no address antered although it is in text box. Or click the icon on the left of text box. OE doesn't see address enterered using WM_SETTEXT. You have to manually type it.