六十四位Office中API函数声明语句第58讲【分享成果,随喜正能量】物质贫乏不可怕,可怕的是心理贫困贫困常与潦倒相连,人穷常与志短相关心理贫困,富也会沦为贫穷,心理富足,穷也能转为富裕物质贫乏加上万念俱灰,会很快摧毁一个人的身体;自信自强,虽暂时物质贫乏,但好日子也会很快到来人穷志不短,自强不息,下面我们就来说一说关于六十四位Office中API函数声明语句第58讲?我们一起去了解并探讨一下这个问题吧!

六十四位Office中API函数声明语句第58讲(六十四位Office中API函数声明语句第58讲)

六十四位Office中API函数声明语句第58讲

六十四位Office中API函数声明语句第58讲

【分享成果,随喜正能量】物质贫乏不可怕,可怕的是心理贫困。贫困常与潦倒相连,人穷常与志短相关。心理贫困,富也会沦为贫穷,心理富足,穷也能转为富裕。物质贫乏加上万念俱灰,会很快摧毁一个人的身体;自信自强,虽暂时物质贫乏,但好日子也会很快到来。人穷志不短,自强不息。

跟我学VBA,我这里专注VBA, 授人以渔。我98年开始,从源码接触VBA已经20余年了,随着年龄的增长,越来越觉得有必要把这项技能传递给需要这项技术的职场人员。希望和数据打交道的朋友,都来学习VBA,利用VBA,起码可以提高自己的工作效率,可以有时间多陪陪父母,多陪陪家人,何乐而不为呢?

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

Declare PtrSafe Function CheckMenuItem Lib "user32" Alias "CheckMenuItem" (ByVal hMenu As LongPtr, ByVal wIDCheckItem As Long, ByVal wCheck As Long) As Long

Declare PtrSafe Function EnableMenuItem Lib "user32" Alias "EnableMenuItem" (ByVal hMenu As LongPtr, ByVal wIDEnableItem As Long, ByVal wEnable As Long) As Long

Declare PtrSafe Function GetSubMenu Lib "user32" Alias "GetSubMenu" (ByVal hMenu As LongPtr, ByVal nPos As Long) As LongPtr

Declare PtrSafe Function GetMenuItemID Lib "user32" Alias "GetMenuItemID" (ByVal hMenu As LongPtr, ByVal nPos As Long) As Long

Declare PtrSafe Function GetMenuItemCount Lib "user32" Alias "GetMenuItemCount" (ByVal hMenu As LongPtr) As Long

Declare PtrSafe Function InsertMenu Lib "user32" Alias "InsertMenuA" (ByVal hMenu As LongPtr, ByVal nPosition As Long, ByVal wFlags As Long, ByVal wIDNewItem As LongPtr, ByVal lpNewItem As Any) As Long

Declare PtrSafe Function AppendMenu Lib "user32" Alias "AppendMenuA" (ByVal hMenu As LongPtr, ByVal wFlags As Long, ByVal wIDNewItem As LongPtr, ByVal lpNewItem As Any) As Long

Declare PtrSafe Function ModifyMenu Lib "user32" Alias "ModifyMenuA" (ByVal hMenu As LongPtr, ByVal nPosition As Long, ByVal wFlags As Long, ByVal wIDNewItem As LongPtr, ByVal lpString As Any) As Long

Declare PtrSafe Function RemoveMenu Lib "user32" Alias "RemoveMenu" (ByVal hMenu As LongPtr, ByVal nPosition As Long, ByVal wFlags As Long) As Long

Declare PtrSafe Function DeleteMenu Lib "user32" Alias "DeleteMenu" (ByVal hMenu As LongPtr, ByVal nPosition As Long, ByVal wFlags As Long) As Long

Declare PtrSafe Function SetMenuItemBitmaps Lib "user32" Alias "SetMenuItemBitmaps" (ByVal hMenu As LongPtr, ByVal nPosition As Long, ByVal wFlags As Long, ByVal hBitmapUnchecked As LongPtr, ByVal hBitmapChecked As LongPtr) As Long

Declare PtrSafe Function GetMenuCheckMarkDimensions Lib "user32" Alias "GetMenuCheckMarkDimensions" () As Long

Declare PtrSafe Function TrackPopupMenu Lib "user32" Alias "TrackPopupMenu" (ByVal hMenu As LongPtr, ByVal wFlags As Long, ByVal x As Long, ByVal y As Long, ByVal nReserved As Long, ByVal hwnd As LongPtr, lprc As RECT) As Long

' Flags for TrackPopupMenu

Const TPM_LEFTBUTTON = &H0&

Const TPM_RIGHTBUTTON = &H2&

Const TPM_LEFTALIGN = &H0&

Const TPM_CENTERALIGN = &H4&

Const TPM_RIGHTALIGN = &H8&

Declare PtrSafe Function DrawIcon Lib "user32" Alias "DrawIcon" (ByVal hdc As LongPtr, ByVal x As Long, ByVal y As Long, ByVal hIcon As LongPtr) As Long

' DrawText() Format Flags

Const DT_TOP = &H0

Const DT_LEFT = &H0

Const DT_CENTER = &H1

Const DT_RIGHT = &H2

Const DT_VCENTER = &H4

Const DT_BOTTOM = &H8

Const DT_WORDBREAK = &H10

Const DT_SINGLELINE = &H20

Const DT_EXPANDTABS = &H40

Const DT_TABSTOP = &H80

Const DT_NOCLIP = &H100

Const DT_EXTERNALLEADING = &H200

Const DT_CALCRECT = &H400

Const DT_NOPREFIX = &H800

Const DT_INTERNAL = &H1000

Declare PtrSafe Function DrawText Lib "user32" Alias "DrawTextA" (ByVal hdc As LongPtr, ByVal lpStr As String, ByVal nCount As Long, lpRect As RECT, ByVal wFormat As Long) As Long

Declare PtrSafe Function TabbedTextOut Lib "user32" Alias "TabbedTextOutA" (ByVal hdc As LongPtr, ByVal x As Long, ByVal y As Long, ByVal lpString As String, ByVal nCount As Long, ByVal nTabPositions As Long, lpnTabStopPositions As Long, ByVal nTabOrigin As Long) As Long

Declare PtrSafe Function GetTabbedTextExtent Lib "user32" Alias "GetTabbedTextExtentA" (ByVal hdc As LongPtr, ByVal lpString As String, ByVal nCount As Long, ByVal nTabPositions As Long, lpnTabStopPositions As Long) As Long

Declare PtrSafe Function UpdateWindow Lib "user32" Alias "UpdateWindow" (ByVal hwnd As LongPtr) As Long

Declare PtrSafe Function SetActiveWindow Lib "user32" Alias "SetActiveWindow" (ByVal hwnd As LongPtr) As LongPtr

Declare PtrSafe Function GetForegroundWindow Lib "user32" Alias "GetForegroundWindow" () As LongPtr

Declare PtrSafe Function SetForegroundWindow Lib "user32" Alias "SetForegroundWindow" (ByVal hwnd As LongPtr) As Long

Declare PtrSafe Function WindowFromDC Lib "user32" Alias "WindowFromDC" (ByVal hdc As LongPtr) As LongPtr

Declare PtrSafe Function GetDC Lib "user32" Alias "GetDC" (ByVal hwnd As LongPtr) As LongPtr

Declare PtrSafe Function GetDCEx Lib "user32" Alias "GetDCEx" (ByVal hwnd As LongPtr, ByVal hrgnclip As LongPtr, ByVal fdwOptions As Long) As LongPtr

Const DCX_WINDOW = &H1&

Const DCX_CACHE = &H2&

Const DCX_NORESETATTRS = &H4&

Const DCX_CLIPCHILDREN = &H8&

Const DCX_CLIPSIBLINGS = &H10&

Const DCX_PARENTCLIP = &H20&

Const DCX_EXCLUDERGN = &H40&

Const DCX_INTERSECTRGN = &H80&

Const DCX_EXCLUDEUPDATE = &H100&

Const DCX_INTERSECTUPDATE = &H200&

Const DCX_LOCKWINDOWUPDATE = &H400&

Const DCX_NORECOMPUTE = &H100000

Const DCX_VALIDATE = &H200000

Declare PtrSafe Function GetWindowDC Lib "user32" Alias "GetWindowDC" (ByVal hwnd As LongPtr) As LongPtr

Declare PtrSafe Function ReleaseDC Lib "user32" Alias "ReleaseDC" (ByVal hwnd As LongPtr, ByVal hdc As LongPtr) As Long

Declare PtrSafe Function BeginPaint Lib "user32" Alias "BeginPaint" (ByVal hwnd As LongPtr, lpPaint As PAINTSTRUCT) As LongPtr

Declare PtrSafe Function EndPaint Lib "user32" Alias "EndPaint" (ByVal hwnd As LongPtr, lpPaint As PAINTSTRUCT) As Long

Declare PtrSafe Function GetUpdateRect Lib "user32" Alias "GetUpdateRect" (ByVal hwnd As LongPtr, lpRect As RECT, ByVal bErase As Long) As Long

Declare PtrSafe Function GetUpdateRgn Lib "user32" Alias "GetUpdateRgn" (ByVal hwnd As LongPtr, ByVal hRgn As LongPtr, ByVal fErase As Long) As Long

Declare PtrSafe Function ExcludeUpdateRgn Lib "user32" Alias "ExcludeUpdateRgn" (ByVal hdc As LongPtr, ByVal hwnd As LongPtr) As Long

Declare PtrSafe Function InvalidateRect Lib "user32" Alias "InvalidateRect" (ByVal hwnd As LongPtr, lpRect As RECT, ByVal bErase As Long) As Long

Declare PtrSafe Function ValidateRect Lib "user32" Alias "ValidateRect" (ByVal hwnd As LongPtr, lpRect As RECT) As Long

Declare PtrSafe Function InvalidateRgn Lib "user32" Alias "InvalidateRgn" (ByVal hwnd As LongPtr, ByVal hRgn As LongPtr, ByVal bErase As Long) As Long

Declare PtrSafe Function ValidateRgn Lib "user32" Alias "ValidateRgn" (ByVal hwnd As LongPtr, ByVal hRgn As LongPtr) As Long

第1套教程:VBA代码解决方案

第2套教程:VBA数据库解决方案

第3套教程:VBA数组与字典解决方案

第4套教程:VBA代码解决方案之视频(第一套的视频讲解)

第5套教程:VBA中类的解读和利用

第6套教程:VBA信息获取与处理

第7套教程:VBA之EXCEL应用

第8套教程:VBA之Word应用(最新推出)

上述教程的学习顺序:

① 7→1→3→2→6→5或者7→4→3→2→6→5。

② 7→8