Sophie

Sophie

distrib > Mandriva > 2008.1 > i586 > by-pkgid > 703d980c580707c382b4e43e25965bc5 > files > 12108

php-manual-pt_BR-5.2.4-1mdv2008.1.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML
><HEAD
><TITLE
>Funções da W32api</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
REL="HOME"
TITLE="Manual do PHP"
HREF="index.html"><LINK
REL="UP"
TITLE="Referência das Funções"
HREF="funcref.html"><LINK
REL="PREVIOUS"
TITLE="vpopmail_set_user_quota"
HREF="function.vpopmail-set-user-quota.html"><LINK
REL="NEXT"
TITLE="w32api_deftype"
HREF="function.w32api-deftype.html"><META
HTTP-EQUIV="Content-type"
CONTENT="text/html; charset=UTF-8"></HEAD
><BODY
CLASS="reference"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>Manual do PHP</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="function.vpopmail-set-user-quota.html"
ACCESSKEY="P"
>Anterior</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="function.w32api-deftype.html"
ACCESSKEY="N"
>Próxima</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="reference"
><A
NAME="ref.w32api"
></A
><DIV
CLASS="TITLEPAGE"
><H1
CLASS="title"
>CLXXIII. Funções da W32api</H1
><DIV
CLASS="PARTINTRO"
><A
NAME="AEN231402"
></A
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="w32api.intro"
>Introdução</A
></H1
><P
>&#13;     Essa extensão é uma API genérica de extensão para DLLs. Ela era originalmente
     escrita para permitir acesso à API Win32 a partir do PHP, embora você pode também
     acessar outras funções exportadas via outras DLLs.
    </P
><P
>&#13;     Os tipos atualmente suportados são tipos genéticos do PHP (strings, booleans, floats,
     inteiros e nulls) e tipos que você define com a função <A
HREF="function.w32api-deftype.html"
><B
CLASS="function"
>w32api_deftype()</B
></A
>.
    </P
><DIV
CLASS="note"
><BLOCKQUOTE
CLASS="note"
><P
><B
>Nota: </B
>
         Esta extensão foi movida para o repositório <A
HREF="http://pecl.php.net"
TARGET="_top"
>PECL</A
> e não é mais distribuida em conjunto com o
 PHP a partir do PHP 5.1.0.
     </P
></BLOCKQUOTE
></DIV
><DIV
CLASS="warning"
><P
></P
><TABLE
CLASS="warning"
BORDER="1"
WIDTH="100%"
><TR
><TD
ALIGN="CENTER"
><B
>Atenção</B
></TD
></TR
><TR
><TD
ALIGN="LEFT"
><P
>Este módulo é
 <SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>EXPERIMENTAL</I
></SPAN
>. Isso quer dizer que o comportamento neste módulo ---
 incluindo suas funções e seus nomes, e TUDO mais que está documentado
 sobre esse módulo --- poderá mudar em futuras versões do PHP, SEM QUALQUER NOTIFICAÇÃO.
 Esteja avisado, e use este módulo por sua própria conta e risco.</P
></TD
></TR
></TABLE
></DIV
></DIV
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="w32api.requirements"
>Dependências</A
></H1
><P
>&#13;     Essa extensão só funciona em sistemas Windows.
    </P
></DIV
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="w32api.installation"
>Instalação</A
></H1
><P
>Não há nenhuma instalação necessária para utilizar estas
 funções, elas fazem parte do núcleo do PHP.</P
></DIV
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="w32api.configuration"
>Configurações em execução</A
></H1
><P
>Esta extensão não define nenhum parâmetro de configuração no <TT
CLASS="filename"
>php.ini</TT
>.</P
></DIV
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="w32api.resources"
>Tipos Resource</A
></H1
><P
>&#13;     Essa extensão define um tipo de recurso, usado por tipo definidos pelo usuário.
     O nome desse recurso é <TT
CLASS="literal"
>"dynaparm"</TT
>.
    </P
></DIV
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="w32api.constants"
>Constantes pré-definidas</A
></H1
><P
>&#13;As contantes abaixo são definidas por esta extensão e somente
 estarão disponíveis quando a extensão foi compilada com o PHP
 ou carregada dinamicamente durante a execução.
</P
><P
></P
><DIV
CLASS="variablelist"
><DL
><DT
><TT
CLASS="constant"
><B
>DC_MICROSOFT</B
></TT
> 
    (inteiro)</DT
><DD
><P
>&#13;     
    </P
></DD
><DT
><TT
CLASS="constant"
><B
>DC_BORLAND</B
></TT
> 
    (inteiro)</DT
><DD
><P
>&#13;     
    </P
></DD
><DT
><TT
CLASS="constant"
><B
>DC_CALL_CDECL</B
></TT
> 
    (inteiro)</DT
><DD
><P
>&#13;     
    </P
></DD
><DT
><TT
CLASS="constant"
><B
>DC_CALL_STD</B
></TT
> 
    (inteiro)</DT
><DD
><P
>&#13;     
    </P
></DD
><DT
><TT
CLASS="constant"
><B
>DC_RETVAL_MATH4</B
></TT
> 
    (inteiro)</DT
><DD
><P
>&#13;     
    </P
></DD
><DT
><TT
CLASS="constant"
><B
>DC_RETVAL_MATH8</B
></TT
> 
    (inteiro)</DT
><DD
><P
>&#13;     
    </P
></DD
><DT
><TT
CLASS="constant"
><B
>DC_CALL_STD_BO</B
></TT
> 
    (inteiro)</DT
><DD
><P
>&#13;     
    </P
></DD
><DT
><TT
CLASS="constant"
><B
>DC_CALL_STD_MS</B
></TT
> 
    (inteiro)</DT
><DD
><P
>&#13;     
    </P
></DD
><DT
><TT
CLASS="constant"
><B
>DC_CALL_STD_M8</B
></TT
> 
    (inteiro)</DT
><DD
><P
>&#13;     
    </P
></DD
><DT
><TT
CLASS="constant"
><B
>DC_FLAG_ARGPTR</B
></TT
> 
    (inteiro)</DT
><DD
><P
>&#13;     
    </P
></DD
></DL
></DIV
></DIV
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="w32api.examples"
>Exemplos</A
></H1
><P
>&#13;     Esse exemplo pega a quantidade de tempo que o sistema está executando e
     mostra em uma caixa de mensagem.
    </P
><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
CLASS="EXAMPLE"
><TR
><TD
><DIV
CLASS="example"
><A
NAME="AEN231495"
></A
><P
><B
>Exemplo 1. Pega o uptime e mostra em uma caixa de mensagem</B
></P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
CELLPADDING="5"
><TR
><TD
><code><font color="#000000">
<font color="#0000BB">&lt;?php<br /></font><font color="#FF8000">// Define constantes necessárias, pegas do arquivo<br />// Visual Studio/Tools/Winapi/WIN32API.txt<br /></font><font color="#0000BB">define</font><font color="#007700">(</font><font color="#DD0000">"MB_OK"</font><font color="#007700">, </font><font color="#0000BB">0</font><font color="#007700">);<br /><br /></font><font color="#FF8000">// Carrega a extensão<br /></font><font color="#0000BB">dl</font><font color="#007700">(</font><font color="#DD0000">"php_w32api.dll"</font><font color="#007700">);<br /><br /></font><font color="#FF8000">// Registra a função GetTickCount de kernel32.dll<br /></font><font color="#0000BB">w32api_register_function</font><font color="#007700">(</font><font color="#DD0000">"kernel32.dll"</font><font color="#007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#DD0000">"GetTickCount"</font><font color="#007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#DD0000">"long"</font><font color="#007700">);<br /><br /></font><font color="#FF8000">// Registra a função MessageBoxA de User32.dll<br /></font><font color="#0000BB">w32api_register_function</font><font color="#007700">(</font><font color="#DD0000">"User32.dll"</font><font color="#007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#DD0000">"MessageBoxA"</font><font color="#007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#DD0000">"long"</font><font color="#007700">);<br /><br /></font><font color="#FF8000">// Pega a informação do uptime<br /></font><font color="#0000BB">$ticks </font><font color="#007700">= </font><font color="#0000BB">GetTickCount</font><font color="#007700">();<br /><br /></font><font color="#FF8000">// Converte a informação para um formato de gente<br /></font><font color="#0000BB">$secs&nbsp;&nbsp;</font><font color="#007700">= </font><font color="#0000BB">floor</font><font color="#007700">(</font><font color="#0000BB">$ticks </font><font color="#007700">/ </font><font color="#0000BB">1000</font><font color="#007700">);<br /></font><font color="#0000BB">$mins&nbsp;&nbsp;</font><font color="#007700">= </font><font color="#0000BB">floor</font><font color="#007700">(</font><font color="#0000BB">$secs </font><font color="#007700">/ </font><font color="#0000BB">60</font><font color="#007700">);<br /></font><font color="#0000BB">$hours </font><font color="#007700">= </font><font color="#0000BB">floor</font><font color="#007700">(</font><font color="#0000BB">$mins </font><font color="#007700">/ </font><font color="#0000BB">60</font><font color="#007700">);<br /><br /></font><font color="#0000BB">$str </font><font color="#007700">= </font><font color="#0000BB">sprintf</font><font color="#007700">(</font><font color="#DD0000">"You have been using your computer for:" </font><font color="#007700">.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#DD0000">"\r\n %d Milliseconds, or \r\n %d Seconds" </font><font color="#007700">.<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#DD0000">"or \r\n %d mins or\r\n %d hours %d mins."</font><font color="#007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$ticks</font><font color="#007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$secs</font><font color="#007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$mins</font><font color="#007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$hours</font><font color="#007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$mins </font><font color="#007700">- (</font><font color="#0000BB">$hours</font><font color="#007700">*</font><font color="#0000BB">60</font><font color="#007700">));<br /><br /></font><font color="#FF8000">// Mostra uma caixa de mensagem com só um botão de OK e o texto de uptime<br /></font><font color="#0000BB">MessageBoxA</font><font color="#007700">(</font><font color="#0000BB">NULL</font><font color="#007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">$str</font><font color="#007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#DD0000">"Uptime Information"</font><font color="#007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#0000BB">MB_OK</font><font color="#007700">);<br /></font><font color="#0000BB">?&gt;</font>
</font>
</code></TD
></TR
></TABLE
></DIV
></TD
></TR
></TABLE
></DIV
></DIV
><DIV
CLASS="TOC"
><DL
><DT
><B
>Índice</B
></DT
><DT
><A
HREF="function.w32api-deftype.html"
>w32api_deftype</A
>&nbsp;--&nbsp;Define um tipo para ser usado com outras funções da w32api_functions</DT
><DT
><A
HREF="function.w32api-init-dtype.html"
>w32api_init_dtype</A
>&nbsp;--&nbsp;
     Cria uma instância do tipo de dado typename e atribui ao mesmo os valores passados
    </DT
><DT
><A
HREF="function.w32api-invoke-function.html"
>w32api_invoke_function</A
>&nbsp;--&nbsp;Invoca a função funcname com os argumentos passados após o nome da função</DT
><DT
><A
HREF="function.w32api-register-function.html"
>w32api_register_function</A
>&nbsp;--&nbsp;Registra função function_name da biblioteca com o PHP</DT
><DT
><A
HREF="function.w32api-set-call-method.html"
>w32api_set_call_method</A
>&nbsp;--&nbsp;Edita a chamada de método usada</DT
></DL
></DIV
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="function.vpopmail-set-user-quota.html"
ACCESSKEY="P"
>Anterior</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>Principal</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="function.w32api-deftype.html"
ACCESSKEY="N"
>Próxima</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>vpopmail_set_user_quota</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="funcref.html"
ACCESSKEY="U"
>Acima</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>w32api_deftype</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>