64位Office API声明语句第115讲

跟我学VBA,我这里专注VBA, 授人以渔。我98年开始,从源码接触VBA已经20余年了,随着年龄的增长,越来越觉得有必要把这项技能传递给需要这项技术的职场人员。希望职场和数据打交道的朋友,都来学习VBA,利用VBA,起码可以提高自己的工作效率,可以有时间多陪陪父母,多陪陪家人,何乐而不为呢?我的教程一共九套,从入门开始一直讲到程序的分发,是学习利用VBA的实用教程。这份API资料是随高级教程赠送的.

这讲我们继续学习64位Office API声明语句第115讲,这些内容是MS的权威资料,看似枯燥,但对于想学习API函数的朋友是非常有用的。

c2474f5e94600b5d0993ff9405b17f30.jpeg

【分享成果,随喜正能量】 修得不生气的心,才有好福气的命,一张笑脸,向顺,向福。一切有为法,如梦幻泡影,如露亦如电,应作如是观。若是生活发生了太多,那就呵护好自己内心的快乐,快乐多一点,生活的阳光就多一分。。

当学员学习到高级阶段,如果引用API,这个资料可以直接查到64位写法。大多数情况下我们是将低版本的程序文件升级到高版本,这时您就不必为如下的错误提示所困扰了:

24979ba04fc66ba813d93c0521ab9f36.jpeg

MousePos As POINTAPI

End Type

Type ANIMATIONINFO

cbSize As Long

iMinAnimate As Long

End Type

Type MINIMIZEDMETRICS

cbSize As Long

iWidth As Long

iHorzGap As Long

iVertGap As Long

iArrange As Long

End Type

' Define API decoration for direct importing of DLL references.

Declare PtrSafe Function HeapValidate Lib "kernel32" Alias "HeapValidate" (ByVal hHeap As LongPtr, ByVal dwFlags As Long, lpMem As Any) As Long

Declare PtrSafe Function HeapCompact Lib "kernel32" Alias "HeapCompact" (ByVal hHeap As LongPtr, ByVal dwFlags As Long) As LongPtr

Const PROCESS_HEAP_REGION = &H1

Const PROCESS_HEAP_UNCOMMITTED_RANGE = &H2

Const PROCESS_HEAP_ENTRY_BUSY = &H4

Const PROCESS_HEAP_ENTRY_MOVEABLE = &H10

Const PROCESS_HEAP_ENTRY_DDESHARE = &H20

Declare PtrSafe Function HeapLock Lib "kernel32" Alias "HeapLock" (ByVal hHeap As LongPtr) As Long

Declare PtrSafe Function HeapUnlock Lib "kernel32" Alias "HeapUnlock" (ByVal hHeap As LongPtr) As Long

' GetBinaryType return values.

Const SCS_32BIT_BINARY = 0

Const SCS_DOS_BINARY = 1

Const SCS_WOW_BINARY = 2

Const SCS_PIF_BINARY = 3

Const SCS_POSIX_BINARY = 4

Const SCS_OS216_BINARY = 5

Declare PtrSafe Function GetBinaryType Lib "kernel32" Alias "GetBinaryTypeA" (ByVal lpApplicationName As String, lpBinaryType As Long) As Long

Declare PtrSafe Function GetShortPathName Lib "kernel32" Alias "GetShortPathNameA" (ByVal lpszLongPath As String, ByVal lpszShortPath As String, ByVal cchBuffer As Long) As Long

Declare PtrSafe Function GetProcessAffinityMask Lib "kernel32" Alias "GetProcessAffinityMask" (ByVal hProcess As LongPtr, lpProcessAffinityMask As LongPtr, SystemAffinityMask As LongPtr) As Long

' Logon Support APIs

Const LOGON32_LOGON_INTERACTIVE = 2

Const LOGON32_LOGON_BATCH = 4

Const LOGON32_LOGON_SERVICE = 5

Const LOGON32_PROVIDER_DEFAULT = 0

Const LOGON32_PROVIDER_WINNT35 = 1

Declare PtrSafe Function LogonUser Lib "kernel32" Alias "LogonUserA" (ByVal lpszUsername As String, ByVal lpszDomain As String, ByVal lpszPassword As String, ByVal dwLogonType As Long, ByVal dwLogonProvider As Long, phToken As LongPtr) As Long

Declare PtrSafe Function ImpersonateLoggedOnUser Lib "kernel32" Alias "ImpersonateLoggedOnUser" (ByVal hToken As LongPtr) As Long

Declare PtrSafe Function CreateProcessAsUser Lib "advapi32.dll" Alias "CreateProcessAsUserA" (ByVal hToken As LongPtr, ByVal lpApplicationName As String, ByVal lpCommandLine As String, lpProcessAttributes As SECURITY_ATTRIBUTES, lpThreadAttributes As SECURITY_ATTRIBUTES, ByVal bInheritHandles As Long, ByVal dwCreationFlags As Long, ByVal lpEnvironment As String, ByVal lpCurrentDirectory As String, lpStartupInfo As STARTUPINFO, lpProcessInformation As PROCESS_INFORMATION) As Long

' Performance counter API's

Type OSVERSIONINFO

dwOSVersionInfoSize As Long

dwMajorVersion As Long

dwMinorVersion As Long

dwBuildNumber As Long

dwPlatformId As Long

szCSDVersion(0 To 127) As Byte ' Maintenance string for PSS usage

End Type

' dwPlatformId defines:

'

Const VER_PLATFORM_WIN32s = 0

Const VER_PLATFORM_WIN32_WINDOWS = 1

Const VER_PLATFORM_WIN32_NT = 2

Declare PtrSafe Function GetVersionEx Lib "kernel32" Alias "GetVersionExA" (lpVersionInformation As OSVERSIONINFO) As Long

' Power Management APIs

Const AC_LINE_OFFLINE = &H0

Const AC_LINE_ONLINE = &H1

Const AC_LINE_BACKUP_POWER = &H2

Const AC_LINE_UNKNOWN = &HFF

Const BATTERY_FLAG_HIGH = &H1

Const BATTERY_FLAG_LOW = &H2

Const BATTERY_FLAG_CRITICAL = &H4

Const BATTERY_FLAG_CHARGING = &H8

Const BATTERY_FLAG_NO_BATTERY = &H80

Const BATTERY_FLAG_UNKNOWN = &HFF

Const BATTERY_PERCENTAGE_UNKNOWN = &HFF

Const BATTERY_LIFE_UNKNOWN = &HFFFFFFFF

Type SYSTEM_POWER_STATUS

ACLineStatus As Byte

BatteryFlag As Byte

BatteryLifePercent As Byte

Reserved1 As Byte

BatteryLifeTime As Long

BatteryFullLifeTime As Long

End Type

Declare PtrSafe Function GetSystemPowerStatus Lib "kernel32" Alias "GetSystemPowerStatus" (lpSystemPowerStatus As SYSTEM_POWER_STATUS) As Long

Declare PtrSafe Function SetSystemPowerState Lib "kernel32" Alias "SetSystemPowerState" (ByVal fSuspend As Long, ByVal fForce As Long) As Long

' * commdlg.h -- This module defines the 32-Bit Common Dialog APIs *

Type OPENFILENAME

lStructSize As Long

hwndOwner As LongPtr

hInstance As LongPtr

lpstrFilter As String

lpstrCustomFilter As String

nMaxCustFilter As Long

nFilterIndex As Long

lpstrFile As String

nMaxFile As Long

lpstrFileTitle As String

nMaxFileTitle As Long

lpstrInitialDir As String

lpstrTitle As String

flags As Long

nFileOffset As Integer

nFileExtension As Integer

lpstrDefExt As String

lCustData As LongPtr

lpfnHook As LongPtr

lpTemplateName As String

'#if (_WIN32_WINNT >= 0x0500)

pvReserved As LongPtr

dwReserved As Long

FlagsEx As Long

'#endif // (_WIN32_WINNT >= 0x0500)

End Type

Declare PtrSafe Function GetOpenFileName Lib "comdlg32.dll" Alias "GetOpenFileNameA" (pOpenfilename As OPENFILENAME) As Long

Declare PtrSafe Function GetSaveFileName Lib "comdlg32.dll" Alias "GetSaveFileNameA" (pOpenfilename As OPENFILENAME) As Long

Declare PtrSafe Function GetFileTitle Lib "comdlg32.dll" Alias "GetFileTitleA" (ByVal lpszFile As String, ByVal lpszTitle As String, ByVal cbBuf As Integer) As Integer

Const OFN_READONLY = &H1

Const OFN_OVERWRITEPROMPT = &H2

Const OFN_HIDEREADONLY = &H4

Const OFN_NOCHANGEDIR = &H8

Const OFN_SHOWHELP = &H10

Const OFN_ENABLEHOOK = &H20

Const OFN_ENABLETEMPLATE = &H40

Const OFN_ENABLETEMPLATEHANDLE = &H80

Const OFN_NOVALIDATE = &H100

Const OFN_ALLOWMULTISELECT = &H200

Const OFN_EXTENSIONDIFFERENT = &H400

b3013f8b7428b6c323896a39de375d75.jpeg

我20多年的VBA实践经验,全部浓缩在下面的各个教程中:

d8aa1efdbe97c227a5a829a8d60cc9c6.jpeg


6d7361ef4c1462077f1560e757728440.jpeg

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/671352.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

黑马程序员-瑞吉外卖-day7

目录 1.做新建菜品里面的上传图片 1.1设置存储路径(先是我们自己存到我们的本地) 2.在controller目录下写代码 3.在过滤器放开这个路径的访问 4.访问localhost:8080/backend/page/demo/upload.html 1.做新建菜品里面的上传图片 1.1设置存储路径&…

系留无人机的发展与应用场景分析,系留旋翼无人机技术难点分析

传统无人机的局限 随着无人机民用市场的扩大,无人机的功能愈加多样化,被广泛应用于搜救、公共安全、农林、摄像娱乐等多领域。民用市场的扩大使传统无人机面临很多技术难题,诸如定位、通讯、交互技术等等,其中最主要的是续航问题…

LeetCode-第876题-链表的中间结点

1.题目描述 给你单链表的头结点 head ,请你找出并返回链表的中间结点。如果有两个中间结点,则返回第二个中间结点。 2.样例描述 3.思路描述 创建两个快慢指针 slow , fast ,起始共同指向头节点,slow 每次走一步,fas…

编译原理与技术(三)——语法分析(五)自底向上-LR分析

一、自顶向下的LL(1)与自底向上的LR (一)LL(1)非递归预测分析器及分析表 (二)LR分析器及分析表 二、LR分析 举个例子。 从上面不难看出,LR分析也是由分析表驱动的。那么关键在于构造LR分析表。

「数据结构」栈:题解

🎇个人主页:Ice_Sugar_7 🎇所属专栏:Java数据结构 🎇欢迎点赞收藏加关注哦! 栈 🍉简介🍉栈的常用方法🍉栈的应用🍌逆波兰表达式求值🍌出栈入栈顺序…

《动手学深度学习(PyTorch版)》笔记6.1

注:书中对代码的讲解并不详细,本文对很多细节做了详细注释。另外,书上的源代码是在Jupyter Notebook上运行的,较为分散,本文将代码集中起来,并加以完善,全部用vscode在python 3.9.18下测试通过&…

不看后悔之Spring Framework篇:Spring MVC架构与控制器设计的艺术

目录 开篇:拥抱Spring MVC,构建高效Java EE Web应用一、Spring MVC核心架构概览 1.1 请求处理流程1.2 关键组件解析:DispatcherServlet、Controller、ModelAndView 二、基于注解的Spring MVC控制器设计 2.1 RequestMapping详解2.2 Controlle…

力扣 第 383 场周赛 解题报告 | 珂学家 | Z函数/StringHash

前言 谁言别后终无悔 寒月清宵绮梦回 深知身在情长在 前尘不共彩云飞 整体评价 T3是道模拟题,但是感觉题意有些晦涩,T4一眼Z函数,当然StringHash更通用些。 新年快乐, _. T1. 将单词恢复初始状态所需的最短时间 I 思路: 模拟 就是前缀和为…

C++ 哈希+unordered_map+unordered_set+位图+布隆过滤器(深度剖析)

文章目录 1. 前言2. unordered 系列关联式容器2.1 unordered_map2.1.1 unordered_map 的概念2.1.2 unordered_map 的使用 2.2 unordered_set2.2.1 unordered_set 的概念2.2.2 unordered_set 的使用 3. 底层结构3.1 哈希的概念3.2 哈希冲突3.3 哈希函数3.4 哈希冲突的解决3.4.1 …

芯片级原子钟,国产原子钟,芯片原子钟、国产芯片级微型原子钟介绍

原子钟已经为天文、航海、宇宙航行等领域提供了强有力的保障。但是,目前这些器件体积庞大,重量也很大,达几百千克。要成为平常人可使用的实用功能,原子钟的尺寸需要大幅缩小,而精度和速度需要被保留。 文章介绍的此类…

linux设置固定ip

进入目录 cd /etc/sysconfig/network-scripts 找到对应的配置文件,一般是ifcfg-ens开头的 vim ifcfg-ens192 BOOTPROTOstatic 网络类型配置,static代表静态ip IPADDR就是你要设置的ip

并发容器【ConcurentHashMap、CopyOnWriteArrayList、阻塞队列、ArrayBlockingQueue】

并发容器 什么是并发容器?同步容器:并发容器: ConcurrentHashMap结构图JDK1.7结构图JDK1.8结构图 CopyOnWriteArrayList实现原理 并发队列阻塞队列ArrayBlockingQueue 转自极客时间 什么是并发容器? 在JUC包中,有一大部分是关于并发容器的,如Concurr…

ref用法

目录 React中提供两种方法创建ref对象: 类组件获取 Ref 三种方式 ① Ref属性是一个字符串。 ② Ref 属性是一个函数。 ③ Ref属性是一个ref对象。 高级用法1:forwardRef 转发 Ref 高级用法2:ref实现组件通信 【ref作用】:最…

e^{ix} 的 conjugate value(复共轭)

e^{ix} 的 conjugate value 正文实数的复共轭 e i x e^{ix} eix 的复共轭推导 正文 这里简单说明一下 e i x e^{ix} eix 的复共轭。 实数的复共轭 首先,我们知道,所谓复共轭是针对复数而言的。对于实数,我们知道,实数集被复数…

年假作业day2

1.打印字母图形 #include<stdio.h> #include<string.h> int main(int argc, const char *argv[]) { int i,j; char k; for(i1;i<7;i) { for(j1;j<i;j) { printf("%c",_); } for(j0,…

2.6学习总结

2.6 1.蓝桥公园 2.路径 3.打印路径 4.【模板】Floyd Floyd算法&#xff1a; 是一种多源的最短路径算法&#xff0c;经过一次计算可以得到任意两个点之间的最短路径。 这种算法是基于动态规划的思想&#xff1a; m[i][j]表示从i到j这条边的距离&#xff0c;dp[k][i][j]表示从…

【Vue3】解决路由缓存问题(响应路由参数的变化)

官方文档解释&#xff1a; 解决问题的思路: 让组件实例不复用,强制销毁重建监听路由变化,变化之后执行数据更新操作 方案一&#xff1a;给router-view添加key 以当前路由完整路径为key 的值&#xff0c;给router-view组件绑定 <RouterView :key"$route.fullPath&qu…

如何使用Docker部署Nginx容器实现无公网ip远程访问本地服务

文章目录 1. 安装Docker2. 使用Docker拉取Nginx镜像3. 创建并启动Nginx容器4. 本地连接测试5. 公网远程访问本地Nginx5.1 内网穿透工具安装5.2 创建远程连接公网地址5.3 使用固定公网地址远程访问 在开发人员的工作中&#xff0c;公网远程访问内网是其必备的技术需求之一。对于…

mvn常见报错:Failed to read artifact descriptor for 解决

问题&#xff1a; mvn打包时报错&#xff1a;Failed to read artifact descriptor for 产生原因&#xff1a; 项目打包时所需的依赖包不存在本地仓库&#xff0c;或本地仓库文件存在问题。 解决方法&#xff1a; 检查仓库可用性&#xff1a; 确保在Maven设置或pom.xml中指定…

引入BertTokenizer出现OSError: Can‘t load tokenizer for ‘bert-base-uncased‘.

今天在跑一个模型的时候出现该报错&#xff0c;完整报错为&#xff1a; OSError: Cant load tokenizer for bert-base-uncased. If you were trying to load it from https://huggingface.co/models, make sure you dont have a local directory with the same name. Otherwis…