⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 getfullpathname.htm

📁 常用windows API函数
💻 HTM
字号:
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">
<style><!--
body,table {font-family:"宋体"; font-size: 9pt; line-height:11pt;}
a {text-decoration:none} a:hover {color:red;text-decoration:underline}
--></style>
<title>GetFullPathName</title>
</head>

<body link="#FF0000" vlink="#FF0000" alink="#FF0000" bgcolor="#FFC8C8">
<div align="center"><center>

<table border="0" width="100%" height="22" cellspacing="0" cellpadding="0">
  <tr>
    <td width="100%" height="16"><a name="GetFullPathName">GetFullPathName</a></td>
  </tr>
</table>
</center></div><div align="center"><center>

<table border="1" width="100%" bordercolorlight="#808080" cellspacing="0"
bordercolordark="#FFFFFF">
  <tr>
    <td width="100%" colspan="2">VB声明</td>
  </tr>
  <tr>
    <td width="100%" colspan="2">Declare Function GetFullPathName&amp; Lib 
    &quot;kernel32&quot; Alias &quot;GetFullPathNameA&quot; (ByVal lpFileName As String, ByVal 
    nBufferLength As Long, ByVal lpBuffer As String, lpFilePart As Long)</td>
  </tr>
  <tr>
    <td width="100%" colspan="2">说明</td>
  </tr>
  <tr>
    <td width="100%" colspan="2">获取指定文件的完整路径名</td>
  </tr>
  <tr>
    <td width="100%" colspan="2">返回值</td>
  </tr>
  <tr>
    <td width="100%" colspan="2">Long,装载到lpBuffer中的字符数量(排除空中止字符)。如缓冲区的长度不足以容下完整的路径,则返回值就是要求的缓冲区大小。零表示失败。会设置<a
    href="GetLastError.htm" tppabs="http://personal.hb.cninfo.net/~vbapi/GetLastError.htm">GetLastError</a></td>
  </tr>
  <tr>
    <td width="100%" colspan="2">参数表</td>
  </tr>
  <tr>
    <td width="25%">参数</td>
    <td width="75%">类型及说明</td>
  </tr>
  <tr>
    <td width="25%">lpFileName</td>
    <td width="75%">String,指定文件名(长文件名或8.3格式的DOS文件名)</td>
  </tr>
  <tr>
    <td width="25%">nBufferLength</td>
    <td width="75%">Long,lpBuffer字串的长度</td>
  </tr>
  <tr>
    <td width="25%">lpBuffer</td>
    <td width="75%">String,指定一个预先定义好的字串,用于装载目标文件的驱动器及路径名称。如存在长文件名,那么这个参数保存的就肯定是长文件名</td>
  </tr>
  <tr>
    <td width="25%">lpFilePart</td>
    <td width="75%">Long,指定一个长整数变量,用于装载文件名起始的地方。参考注解</td>
  </tr>
  <tr>
    <td width="100%" colspan="2">注解</td>
  </tr>
  <tr>
    <td width="100%" colspan="2"><p align="left">lpFilePart参数在vb里很难使用。它的问题在于:尽管windows在这个Long值中装载lpBuffer字串中的地址,用它表示路径信息文件名部分的起始处。但非常不幸,由vb创建的、传递给api的ANSI字串缓冲区也会使用这个地址。等这个函数返回的时候,vb已将返回的(lpBuffer)字串复制回它的内部Unicode字串缓冲区,所以lpFilePart地址已没有任何意义。因此,我们面临两种选择。首先,可以简单的不使用lpFilePart信息(忽略windows装载在参数中的值)。其次,可以将lpBuffer参数变成一个字节数组(lpFilePart 
    As Byte——将数组的第一个元素作为参数传递)</td>
  </tr>
  <tr>
    <td width="100%" colspan="2">其他</td>
  </tr>
  <tr>
    <td width="100%" colspan="2">在vb的api文本查看器中复制的声明为:Declare 
    Function GetFullPathName Lib &quot;kernel32&quot; Alias &quot;GetFullPathNameA&quot; 
    (ByVal lpFileName As String, ByVal nBufferLength As Long, ByVal lpBuffer As String, ByVal 
    lpFilePart As String) As Long</td>
  </tr>
</table>
</center></div><div align="center"><center>

<table border="0" width="100%" cellspacing="0" cellpadding="0">
  <tr>
    <td width="100%"><p align="right"><a href="#GetFullPathName">Top</a></td>
  </tr>
</table>
</center></div>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -