[Lazarus] ShellExecute

Manuel Galeote info at redbarcelona.com
Fri Dec 18 20:25:45 CET 2009


Yes, it works. Thank you.

-----Mensaje original-----
De: cobines [mailto:cobines at gmail.com] 
Enviado el: viernes, 18 de diciembre de 2009 20:16
Para: Lazarus mailing list
Asunto: Re: [Lazarus] ShellExecute

2009/12/18 Manuel Galeote <info at redbarcelona.com>:
> In windows 7 I’m trying to open a word document with the uses windows and
> shellExecute (lazarus 0.29 fpc 2.5.1)
>
>
>
> That work:
>
> ShellExecute(0, nil, PChar('C: \abc.doc'),nil,nil,SW_SHOWNORMAL);
>
>
>
> But that not work:
>
> ShellExecute(0, nil, PChar('C: \abcó.doc'),nil,nil,SW_SHOWNORMAL); (take a
> look at the final ó)
>
>
>
> Anybody knows why and/or how can I execute that?
>

You should use ShellExecuteW():

ShellExecuteW(0, nil, UTF8toUTF16('C:\abcó.doc'),nil,nil,SW_SHOWNORMAL)

I assume your string is in utf8. If not convert it to UTF16 somehow.

--
cobines

--
_______________________________________________
Lazarus mailing list
Lazarus at lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus






More information about the Lazarus mailing list