<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
color:black;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"HTML con formato previo Car";
margin:0cm;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";
color:black;}
span.EstiloCorreo17
{mso-style-type:personal;
font-family:"Calibri","sans-serif";
color:windowtext;}
span.HTMLconformatoprevioCar
{mso-style-name:"HTML con formato previo Car";
mso-style-priority:99;
mso-style-link:"HTML con formato previo";
font-family:Consolas;
color:black;}
span.EstiloCorreo20
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
span.shorttext
{mso-style-name:short_text;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page Section1
{size:612.0pt 792.0pt;
margin:70.85pt 3.0cm 70.85pt 3.0cm;}
div.Section1
{page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body bgcolor=white lang=ES link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><span lang=EN-US style='color:#1F497D'>The language of my
operating system is Spanish (accent, ñ,…) and in fact, the following:<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='color:#1F497D'>..<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Archivo= AnsiToUtf8(Directory)
+ AnsiToUtf8(SearchRec.Name); //This is from a routine that runs through a
directory looking for files.<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Works perfectly with
this.<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='color:#1F497D'>ShellExecuteW(0, nil,
PWideChar(UTF8toUTF16(‘archivo’)),nil,nil,SW_SHOWNORMAL) //works
with any character<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Or<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='color:#1F497D'>ShellExecuteW(0,
'open', PWideChar(UTF8toUTF16(archivo)),nil,nil,SW_SHOWNORMAL) //works with any
character too<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='color:#1F497D'>..<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='color:#1F497D'>Thanks.<o:p></o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span lang=EN-US style='color:#1F497D'><o:p> </o:p></span></p>
<div>
<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'>
<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";
color:windowtext'>De:</span></b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif";
color:windowtext'> bobby [mailto:spasic@gmail.com] <br>
<b>Enviado el:</b> viernes, 18 de diciembre de 2009 22:47<br>
<b>Para:</b> Lazarus mailing list<br>
<b>Asunto:</b> Re: [Lazarus] ShellExecute<o:p></o:p></span></p>
</div>
</div>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal>Manuel Galeote wrote: <o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US>In windows 7 I’m trying to open a
word document with the uses windows and shellExecute (lazarus 0.29 fpc 2.5.1)</span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US> </span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US>That work:</span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US>ShellExecute(0, nil, PChar('C:
\abc.doc'),nil,nil,SW_SHOWNORMAL);</span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US> </span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US>But that not work:</span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US>ShellExecute(0, nil, PChar('C:
\abcó.doc'),nil,nil,SW_SHOWNORMAL); (take a look at the final ó)</span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US> </span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US>Anybody knows why and/or how can I execute
that?</span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US> </span><o:p></o:p></p>
<p class=MsoNormal><span lang=EN-US>Thanks</span><o:p></o:p></p>
<pre><o:p> </o:p></pre><pre style='text-align:center'>
<hr size=4 width="90%" align=center>
</pre><pre><o:p> </o:p></pre><pre>--<o:p></o:p></pre><pre>_______________________________________________<o:p></o:p></pre><pre>Lazarus mailing list<o:p></o:p></pre><pre><a
href="mailto:Lazarus@lists.lazarus.freepascal.org">Lazarus@lists.lazarus.freepascal.org</a><o:p></o:p></pre><pre><a
href="http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus">http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus</a><o:p></o:p></pre><pre> <o:p></o:p></pre>
<p class=MsoNormal><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'>Hi,<br>
<br>
try ShellExecuteW with PWideChar</span><span lang=EN-US style='font-size:
12.0pt;font-family:"Times New Roman","serif"'>('C: \abcó.doc')<br>
<br>
regards<br>
bobby</span><span style='font-size:12.0pt;font-family:"Times New Roman","serif"'><o:p></o:p></span></p>
</div>
</body>
</html>