跟我学VBA,我这里专注VBA, 授人以渔。我98年开始,从源码接触VBA已经20余年了,随着年龄的增长,越来越觉得有必要把这项技能传递给需要这项技术的职场人员。希望职场和数据打交道的朋友,都来学习VBA,利用VBA,起码可以提高自己的工作效率,可以有时间多陪陪父母,多陪陪家人,何乐而不为呢?我的教程一共九套,从入门开始一直讲到程序的分发,是学习利用VBA的实用教程。这份API资料是随高级教程赠送的.
这讲我们继续学习VBA 64位API声明语句第005讲,这些内容是MS的权威资料,看似枯燥,但对于想学习API函数的朋友是非常有用的。
【分享成果,随喜正能量】 很多时候,温和才是一种更强大的力量,能溶解一切不善的念头。。
当学员学习到高级阶段,如果引用API,这个资料可以直接查到64位写法。大多数情况下我们是将低版本的程序文件升级到高版本,这时您就不必为如下的错误提示所困扰了:
Const CREATE_NO_WINDOW = &H8000000
Const PROFILE_USER = &H10000000
Const PROFILE_KERNEL = &H20000000
Const PROFILE_SERVER = &H40000000
Const MAXLONG = &H7FFFFFFF
Const THREAD_BASE_PRIORITY_MIN = -2
Const THREAD_BASE_PRIORITY_MAX = 2
Const THREAD_BASE_PRIORITY_LOWRT = 15
Const THREAD_BASE_PRIORITY_IDLE = -15
Const THREAD_PRIORITY_LOWEST = THREAD_BASE_PRIORITY_MIN
Const THREAD_PRIORITY_BELOW_NORMAL = (THREAD_PRIORITY_LOWEST + 1)
Const THREAD_PRIORITY_NORMAL = 0
Const THREAD_PRIORITY_HIGHEST = THREAD_BASE_PRIORITY_MAX
Const THREAD_PRIORITY_ABOVE_NORMAL = (THREAD_PRIORITY_HIGHEST - 1)
Const THREAD_PRIORITY_ERROR_RETURN = (MAXLONG)
Const THREAD_PRIORITY_TIME_CRITICAL = THREAD_BASE_PRIORITY_LOWRT
Const THREAD_PRIORITY_IDLE = THREAD_BASE_PRIORITY_IDLE
' ++ BUILD Version: 0093 Increment this if a change has global effects
' Copyright (c) 1990-1995 Microsoft Corporation
' Module Name:
' winnt.h
' Abstract:
' This module defines the 32-Bit Windows types and constants that are
' defined by NT, but exposed through the Win32 API.
' Revision History:
Const APPLICATION_ERROR_MASK = &H20000000
Const ERROR_SEVERITY_SUCCESS = &H0
Const ERROR_SEVERITY_INFORMATIONAL = &H40000000
Const ERROR_SEVERITY_WARNING = &H80000000
Const ERROR_SEVERITY_ERROR = &HC0000000
Const MINCHAR = &H80
Const MAXCHAR = &H7F
Const MINSHORT = &H8000
Const MAXSHORT = &H7FFF
Const MINLONG = &H80000000
Const MAXByte = &HFF
Const MAXWORD = &HFFFF
Const MAXDWORD = &HFFFFFFFF
'
' Calculate the byte offset of a field in a structure of type type.
' * Language IDs.
' *
' * The following two combinations of primary language ID and
' * sublanguage ID have special semantics:
' *
' * Primary Language ID Sublanguage ID Result
' * ------------------- --------------- ------------------------
' * LANG_NEUTRAL SUBLANG_NEUTRAL Language neutral
' * LANG_NEUTRAL SUBLANG_DEFAULT User default language
' * LANG_NEUTRAL SUBLANG_SYS_DEFAULT System default language
' */
'
' * Primary language IDs.
' */
Const LANG_NEUTRAL = &H0
Const LANG_BULGARIAN = &H2
Const LANG_CHINESE = &H4
Const LANG_CROATIAN = &H1A
Const LANG_CZECH = &H5
Const LANG_DANISH = &H6
Const LANG_DUTCH = &H13
Const LANG_ENGLISH = &H9
Const LANG_FINNISH = &HB
Const LANG_FRENCH = &HC
Const LANG_GERMAN = &H7
Const LANG_GREEK = &H8
Const LANG_HUNGARIAN = &HE
Const LANG_ICELANDIC = &HF
Const LANG_ITALIAN = &H10
Const LANG_JAPANESE = &H11
Const LANG_KOREAN = &H12
Const LANG_NORWEGIAN = &H14
Const LANG_POLISH = &H15
Const LANG_PORTUGUESE = &H16
Const LANG_ROMANIAN = &H18
Const LANG_RUSSIAN = &H19
Const LANG_SLOVAK = &H1B
Const LANG_SLOVENIAN = &H24
Const LANG_SPANISH = &HA
Const LANG_SWEDISH = &H1D
Const LANG_TURKISH = &H1F
'
' * Sublanguage IDs.
' *
' * The name immediately following SUBLANG_ dictates which primary
' * language ID that sublanguage ID can be combined with to form a
' * valid language ID.
' */
Const SUBLANG_NEUTRAL = &H0 ' language neutral
Const SUBLANG_DEFAULT = &H1 ' user default
Const SUBLANG_SYS_DEFAULT = &H2 ' system default
Const SUBLANG_CHINESE_TRADITIONAL = &H1 ' Chinese (Taiwan)
Const SUBLANG_CHINESE_SIMPLIFIED = &H2 ' Chinese (PR China)
Const SUBLANG_CHINESE_HONGKONG = &H3 ' Chinese (Hong Kong)
Const SUBLANG_CHINESE_SINGAPORE = &H4 ' Chinese (Singapore)
Const SUBLANG_DUTCH = &H1 ' Dutch
Const SUBLANG_DUTCH_BELGIAN = &H2 ' Dutch (Belgian)
Const SUBLANG_ENGLISH_US = &H1 ' English (USA)
Const SUBLANG_ENGLISH_UK = &H2 ' English (UK)
Const SUBLANG_ENGLISH_AUS = &H3 ' English (Australian)
Const SUBLANG_ENGLISH_CAN = &H4 ' English (Canadian)
Const SUBLANG_ENGLISH_NZ = &H5 ' English (New Zealand)
Const SUBLANG_ENGLISH_EIRE = &H6 ' English (Irish)
Const SUBLANG_FRENCH = &H1 ' French
Const SUBLANG_FRENCH_BELGIAN = &H2 ' French (Belgian)
Const SUBLANG_FRENCH_CANADIAN = &H3 ' French (Canadian)
Const SUBLANG_FRENCH_SWISS = &H4 ' French (Swiss)
Const SUBLANG_GERMAN = &H1 ' German
Const SUBLANG_GERMAN_SWISS = &H2 ' German (Swiss)
Const SUBLANG_GERMAN_AUSTRIAN = &H3 ' German (Austrian)
Const SUBLANG_ITALIAN = &H1 ' Italian
Const SUBLANG_ITALIAN_SWISS = &H2 ' Italian (Swiss)
Const SUBLANG_NORWEGIAN_BOKMAL = &H1 ' Norwegian (Bokma
Const SUBLANG_NORWEGIAN_NYNORSK = &H2 ' Norwegian (Nynorsk)
Const SUBLANG_PORTUGUESE = &H2 ' Portuguese
Const SUBLANG_PORTUGUESE_BRAZILIAN = &H1 ' Portuguese (Brazilian)
Const SUBLANG_SPANISH = &H1 ' Spanish (Castilian)
Const SUBLANG_SPANISH_MEXICAN = &H2 ' Spanish (Mexican)
Const SUBLANG_SPANISH_MODERN = &H3 ' Spanish (Modern)
'
' * Sorting IDs.
' *
' */
Const SORT_DEFAULT = &H0 ' sorting default
Const SORT_JAPANESE_XJIS = &H0 ' Japanese0xJIS order
Const SORT_JAPANESE_UNICODE = &H1 ' Japanese Unicode order
Const SORT_CHINESE_BIG5 = &H0 ' Chinese BIG5 order
Const SORT_CHINESE_UNICODE = &H1 ' Chinese Unicode order
Const SORT_KOREAN_KSC = &H0 ' Korean KSC order
Const SORT_KOREAN_UNICODE = &H1 ' Korean Unicode order
' The FILE_READ_DATA and FILE_WRITE_DATA constants are also defined in
' devioctl.h as FILE_READ_ACCESS and FILE_WRITE_ACCESS. The values for these
' constants *MUST* always be in sync.
' The values are redefined in devioctl.h because they must be available to
' both DOS and NT.
'
Const MAX_PATH = 260
' String Length Maximums
Const MAX_LEADBYTES = 12 ' 5 ranges, 2 bytes ea., 0 term.
Const FILE_READ_DATA = (&H1) ' file pipe
Const FILE_LIST_DIRECTORY = (&H1) ' directory
Const FILE_WRITE_DATA = (&H2) ' file pipe
Const FILE_ADD_FILE = (&H2) ' directory
Const FILE_APPEND_DATA = (&H4) ' file
Const FILE_ADD_SUBDIRECTORY = (&H4) ' directory
Const FILE_CREATE_PIPE_INSTANCE = (&H4) ' named pipe
我20多年的VBA实践经验,全部浓缩在下面的各个教程中: