64位Office API声明语句第112讲

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

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

64位Office API声明语句第112讲_第1张图片

【分享成果,随喜正能量】如果我们真的有在平时认真的去修行,随着我们的修行时间的变化我们自己的你相貌也会随之改变的,风度变了、仪态变了,会和从前大不一样的,在现代这个定义应该是体质的变化,你功夫越得力你会发现过去有些毛病,现在毛病没有了;从前精神常常提不起来,现在精神饱满、容光焕发。。

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

64位Office API声明语句第112讲_第2张图片

' SpeakerVolume for MODEMSETTINGS

Const MDMVOL_LOW = &H0

Const MDMVOL_MEDIUM = &H1

Const MDMVOL_HIGH = &H2

' SpeakerMode for MODEMDEVCAPS

Const MDMSPKRFLAG_OFF = &H1

Const MDMSPKRFLAG_DIAL = &H2

Const MDMSPKRFLAG_ON = &H4

Const MDMSPKRFLAG_CALLSETUP = &H8

' SpeakerMode for MODEMSETTINGS

Const MDMSPKR_OFF = &H0

Const MDMSPKR_DIAL = &H1

Const MDMSPKR_ON = &H2

Const MDMSPKR_CALLSETUP = &H3

' Modem Options

Const MDM_COMPRESSION = &H1

Const MDM_ERROR_CONTROL = &H2

Const MDM_FORCED_EC = &H4

Const MDM_CELLULAR = &H8

Const MDM_FLOWCONTROL_HARD = &H10

Const MDM_FLOWCONTROL_SOFT = &H20

Const MDM_CCITT_OVERRIDE = &H40

Const MDM_SPEED_ADJUST = &H80

Const MDM_TONE_DIAL = &H100

Const MDM_BLIND_DIAL = &H200

Const MDM_V23_OVERRIDE = &H400

' ***************************************************************************** *

' * shellapi.h - SHELL.DLL functions, types, and definitions *

' * *

' * Copyright (c) 1992-1995, Microsoft Corp. All rights reserved *

' * *

' \*****************************************************************************/

Declare PtrSafe Function DragQueryFile Lib "shell32.dll" Alias "DragQueryFileA" (ByVal HDROP As LongPtr, ByVal UINT As Long, ByVal lpStr As String, ByVal ch As Long) As Long

Declare PtrSafe Function DragQueryPoint Lib "shell32.dll" Alias "DragQueryPoint" (ByVal HDROP As LongPtr, lpPoint As POINTAPI) As Long

Declare PtrSafe Sub DragFinish Lib "shell32.dll" Alias "DragFinish" (ByVal hDrop As LongPtr)

Declare PtrSafe Sub DragAcceptFiles Lib "shell32.dll" Alias "DragAcceptFiles" (ByVal hwnd As LongPtr, ByVal fAccept As Long)

Declare PtrSafe Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As LongPtr, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As LongPtr

Declare PtrSafe Function FindExecutable Lib "shell32.dll" Alias "FindExecutableA" (ByVal lpFile As String, ByVal lpDirectory As String, ByVal lpResult As String) As LongPtr

Declare PtrSafe Function ShellAbout Lib "shell32.dll" Alias "ShellAboutA" (ByVal hwnd As LongPtr, ByVal szApp As String, ByVal szOtherStuff As String, ByVal hIcon As LongPtr) As Long

Declare PtrSafe Function DuplicateIcon Lib "shell32.dll" Alias "DuplicateIcon" (ByVal hInst As LongPtr, ByVal hIcon As LongPtr) As LongPtr

Declare PtrSafe Function ExtractAssociatedIcon Lib "shell32.dll" Alias "ExtractAssociatedIconA" (ByVal hInst As LongPtr, ByVal lpIconPath As String, lpiIcon As Long) As LongPtr

Declare PtrSafe Function ExtractIcon Lib "shell32.dll" Alias "ExtractIconA" (ByVal hInst As LongPtr, ByVal lpszExeFileName As String, ByVal nIconIndex As Long) As LongPtr

Type DRAGINFO

        uSize As Long ' init with sizeof(DRAGINFO)

        pt As POINTAPI

        fNC As Long

        lpFileList As String

        grfKeyState As Long

End Type

' // AppBar stuff

Const ABM_NEW = &H0

Const ABM_REMOVE = &H1

Const ABM_QUERYPOS = &H2

Const ABM_SETPOS = &H3

Const ABM_GETSTATE = &H4

Const ABM_GETTASKBARPOS = &H5

Const ABM_ACTIVATE = &H6 ' lParam == TRUE/FALSE means activate/deactivate

Const ABM_GETAUTOHIDEBAR = &H7

Const ABM_SETAUTOHIDEBAR = &H8 ' this can fail at any time. MUST check the result

                                        ' lParam = TRUE/FALSE Set/Unset

                                        ' uEdge = what edge

Const ABM_WINDOWPOSCHANGED = &H9

' these are put in the wparam of callback messages

Const ABN_STATECHANGE = &H0

Const ABN_POSCHANGED = &H1

Const ABN_FULLSCREENAPP = &H2

Const ABN_WINDOWARRANGE = &H3 ' lParam == TRUE means hide

' flags for get state

Const ABS_AUTOHIDE = &H1

Const ABS_ALWAYSONTOP = &H2

Const ABE_LEFT = 0

Const ABE_TOP = 1

Const ABE_RIGHT = 2

Const ABE_BOTTOM = 3

Type APPBARDATA

        cbSize As Long

        hwnd As LongPtr

        uCallbackMessage As Long

        uEdge As Long

        rc As RECT

        lParam As LongPtr ' message specific

End Type

Declare PtrSafe Function SHAppBarMessage Lib "shell32.dll" Alias "SHAppBarMessage" (ByVal dwMessage As Long, pData As APPBARDATA) As LongPtr

' // EndAppBar

Declare PtrSafe Function DoEnvironmentSubst Lib "shell32.dll" Alias "DoEnvironmentSubstA" (ByVal szString As String, ByVal cbString As Long) As Long

Declare PtrSafe Function ExtractIconEx Lib "shell32.dll" Alias "ExtractIconExA" (ByVal lpszFile As String, ByVal nIconIndex As Long, phiconLarge As LongPtr, phiconSmall As LongPtr, ByVal nIcons As Long) As Long

' // Shell File Operations

Const FO_MOVE = &H1

Const FO_COPY = &H2

Const FO_DELETE = &H3

Const FO_RENAME = &H4

Const FOF_MULTIDESTFILES = &H1

Const FOF_CONFIRMMOUSE = &H2

Const FOF_SILENT = &H4 ' don't create progress/report

Const FOF_RENAMEONCOLLISION = &H8

Const FOF_NOCONFIRMATION = &H10 ' Don't prompt the user.

Const FOF_WANTMAPPINGHANDLE = &H20 ' Fill in SHFILEOPSTRUCT.hNameMappings

                                      ' Must be freed using SHFreeNameMappings

Const FOF_ALLOWUNDO = &H40

Const FOF_FILESONLY = &H80 ' on *.*, do only files

Const FOF_SIMPLEPROGRESS = &H100 ' means don't show names of files

Const FOF_NOCONFIRMMKDIR = &H200 ' don't confirm making any needed dirs

Const PO_DELETE = &H13 ' printer is being deleted

Const PO_RENAME = &H14 ' printer is being renamed

Const PO_PORTCHANGE = &H20 ' port this printer connected to is being changed

                                ' if this id is set, the strings received by

                                ' the copyhook are a doubly-null terminated

                                ' list of strings. The first is the printer

                                ' name and the second is the printer port.

Const PO_REN_PORT = &H34 ' PO_RENAME and PO_PORTCHANGE at same time.

' no POF_ flags currently defined

' implicit parameters are:

' if pFrom or pTo are unqualified names the current directories are

' taken from the global current drive/directory settings managed

' by Get/SetCurrentDrive/Directory

'

' the global confirmation settings

Type SHFILEOPSTRUCT

        hwnd As LongPtr

        wFunc As Long

        pFrom As String

        pTo As String

        fFlags As Integer

        fAnyOperationsAborted As Long

        hNameMappings As LongPtr

        lpszProgressTitle As String ' only used if FOF_SIMPLEPROGRESS

End Type

64位Office API声明语句第112讲_第3张图片

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


64位Office API声明语句第112讲_第4张图片

64位Office API声明语句第112讲_第5张图片

你可能感兴趣的:(VBA,OFFICE,开发语言)