An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20150521/89eb1e1a/attachment.html>
Mailing lists / lazarus / 2015-05
ShellExecute and german umlauts
3 messages · 2 people ·
- JJohn Landmesser 2
- HHenry Vermaak 1
Reply by email Subscribe to this list Your subscription
Read-only archive. Use j and k to move between messages.
John Landmesser wrote 15 lines
i want to send a mail on windows using shellexecute with german
Umlauts ( ?,?,? .. ) in the body of the mail.
This Code doesn't work:
var s: string;
s := '??????'
shellexecute(Application.Mainform.handle, 'open',PChar('mailto:' +
' + '?subject=' + 'ARJ-ChapterArchiv: ' +
'&body=' + UTF8ToAnsi(s)),nil, nil, sw_normal);
?Good tipps are welcome! ? I don't want to use Indy or synapse!
I use something like this:
if Win32MajorVersion < 5 then
Ret := ShellExecute(0, 'open', PChar(UTF8ToSys(AProg)), nil, nil, SW_SHOWNORMAL)
else
Ret := ShellExecuteW(0, 'open', PWideChar(UTF8Decode(AProg)), nil, nil, SW_SHOWNORMAL);
Result := Ret > 32;Henry
Henry Vermaak wrote 32 lines
On Thu, May 21, 2015 at 10:06:28AM +0200, John Landmesser wrote:
> i want to send a mail on windows using shellexecute with german
> Umlauts ( ?,?,? .. ) in the body of the mail.
>
> This Code doesn't work:
>
> var s: string;
>
> s := '??????'
>
>
> shellexecute(Application.Mainform.handle, 'open',PChar('mailto:' +
> ' + '?subject=' + 'ARJ-ChapterArchiv: ' +
> '&body=' + UTF8ToAnsi(s)),nil, nil, sw_normal);
>
> Good tipps are welcome! I don't want to use Indy or synapse!
I use something like this:
if Win32MajorVersion < 5 then
Ret := ShellExecute(0, 'open', PChar(UTF8ToSys(AProg)), nil, nil, SW_SHOWNORMAL)
else
Ret := ShellExecuteW(0, 'open', PWideChar(UTF8Decode(AProg)), nil, nil, SW_SHOWNORMAL);
Result := Ret > 32;
Henry
--
_______________________________________________
Lazarus mailing list
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
thanks Henry!
found a solution that is ok with umlauts in body:
var list : TStringList; // body
s : string; // for body without LFN and spaces
(* LFN replace: *)
for x := 0 to list.Count -1 do
s := s + '%0D%0A' + List[x];
(* replace Spaces : *)
s := StringReplace(s,' ','%20',[rfReplaceAll, rfIgnoreCase]);
cmdLine := 'mailto:?subject=ARJ-ChapterArchiv:
' + ArchName + '&body=' + s;
if not Openurl(cmdLine) thenthat works, but i don't know why, Perhaps your
PChar(UTF8ToSys(AProg))
and
PWideChar(UTF8Decode(AProg))
is the trick?
