Deklarasi 32 Bit Dan 64 Bit Api Untuk Pengembang Vba

API kepanjangan dari Application Programming Interface, API dalam VBA digunakan untuk menambah fitur yang tidak ada pada VBA.
Berikut ini adalah kumpulan deklarasi API VBA untuk 32 bit dan 64 bit

Deklarasi API 32 Bit
Private Declare Function FindWindow Lib "User32.dll" Alias "FindWindowA" (ByVal lpszClass As String, ByVal lpszWindow As String) As Long
Private Declare Function MoveWindow Lib "User32.dll" (ByVal HWnd As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal bRepaint As Long) As Long
Private Declare Function GetWindowLong Lib "User32.dll" Alias "GetWindowLongA" (ByVal HWnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLong Lib "User32.dll" Alias "SetWindowLongA" (ByVal HWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function SetLayeredWindowAttributes Lib "User32.dll" (ByVal HWnd As Long, ByVal crKey As Long, ByVal bAlpha As Byte, ByVal dwFlags As Long) As Long
Private Declare Function DrawMenuBar Lib "User32.dll" (ByVal HWnd As Long) As Long
Private Declare Function GetSystemMetrics Lib "User32.dll" (ByVal nIndex As Long) As Long
Private Declare Function GetDeviceCaps Lib "gdi32" (ByVal hDC As Long, ByVal nIndex As Long) As Long
Private Declare Function ReleaseDC Lib "User32.dll" (ByVal HWnd As Long, ByVal hDC As Long) As Long
Private Declare Function GetDC Lib "User32.dll" (ByVal HWnd As Long) As Long
Private Declare Function SetTimer Lib "user32" (ByVal HWnd As Long, ByVal nIDEvent As Long, ByVal uElapse As Long, ByVal lpTimerFunc As Long) As Long
Private Declare Function KillTimer Lib "user32" (ByVal HWnd As Long, ByVal nIDEvent As Long) As Long
Private Declare Function AddFontResource Lib "gdi32" Alias "AddFontResourceA" (ByVal lpFilename As String) As Long
Private Declare Function RemoveFontResource Lib "gdi32" Alias "RemoveFontResourceA" (ByVal lpFilename As String) As Long
Private Declare Function AddFontMemResourceEx Lib "gdi32" (ByVal pbFont As Integer, ByVal cbFont As Integer, ByVal pdv As Integer, ByRef pcFonts As Integer) As Long

Deklarasi API 64 Bit
Private Declare PtrSafe Function FindWindow Lib "USER32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare PtrSafe Function MoveWindow Lib "User32.dll" (ByVal HWnd As LongPtr, ByVal X As LongPtr, ByVal Y As LongPtr, ByVal nWidth As LongPtr, ByVal nHeight As LongPtr, ByVal bRepaint As LongPtr) As LongPtr
Private Declare PtrSafe Function GetWindowLong Lib "User32.dll" Alias "GetWindowLongA" (ByVal HWnd As LongPtr, ByVal nIndex As LongPtr) As Long
Private Declare PtrSafe Function SetWindowLong Lib "User32.dll" Alias "SetWindowLongA" (ByVal HWnd As LongPtr, ByVal nIndex As LongPtr, ByVal dwNewLongPtr As LongPtr) As LongPtr
Private Declare PtrSafe Function SetLayeredWindowAttributes Lib "User32.dll" (ByVal HWnd As LongPtr, ByVal crKey As LongPtr, ByVal bAlpha As Byte, ByVal dwFlags As LongPtr) As LongPtr
Private Declare PtrSafe Function DrawMenuBar Lib "User32.dll" (ByVal HWnd As LongPtr) As LongPtr
Private Declare PtrSafe Function GetSystemMetrics Lib "USER32" (ByVal nIndex As Long) As Long
Private Declare PtrSafe Function GetDeviceCaps Lib "gdi32" (ByVal hDC As LongPtr, ByVal nIndex As Long) As Long
Private Declare PtrSafe Function ReleaseDC Lib "User32.dll" (ByVal HWnd As LongPtr, ByVal hDC As LongPtr) As LongPtr
Private Declare PtrSafe Function GetDC Lib "USER32" (ByVal HWnd As LongPtr) As Long
Private Declare PtrSafe Function SetTimer Lib "user32" (ByVal HWnd As LongPtr, ByVal nIDEvent As LongLong, ByVal uElapse As LongPtr, ByVal lpTimerFunc As LongPtr) As Long
Private Declare PtrSafe Function KillTimer Lib "user32" (ByVal HWnd As LongPtr, ByVal nIDEvent As LongPtr) As Long
Private Declare PtrSafe Function AddFontResource Lib "gdi32" Alias "AddFontResourceA" (ByVal lpFilename As String) As LongPtr
Private Declare PtrSafe Function RemoveFontResource Lib "gdi32" Alias "RemoveFontResourceA" (ByVal lpFilename As String) As LongPtr
Private Declare PtrSafe Function AddFontMemResourceEx Lib "Gdi32.dll" (ByVal pbFont As LongPtr, ByVal cbFont As Integer, ByVal pdv As Integer, ByRef pcFonts As Integer) As LongPtr

Supaya bisa berjalan pada Microsoft Office 32 Bit atau 64 Bit saya gunakan keduannya dengan memanfaatkan "IF" seperti berikut :
#If VBA7 Then
'isi dengan code API 32 Bit
#Else
'isi dengan code API 64 Bit
#End if

Tentunya masih banyak lagi code API yang akan di update dan contoh-contoh penggunaannya.. Untuk itu tetap kunjungi dan check update di artikel kami lainnya..
Deklarasi 32 Bit Dan 64 Bit Api Untuk Pengembang Vba
Deklarasi 32 Bit Dan 64 Bit Api Untuk Pengembang Vba

Harga : *Free Ongkir, dikirim melalui Whatsapp
Pesan via whatsapp Pesan via Email
Tags
Previous article
Next article
About Me
Profesional Developer VBA yang berorientasi detail dengan pengalaman lebih dari 3 tahun sebagai software support specialist dan system Retail. Berpengalaman membuat aplikasi VBA untuk banyak perusahaan di Indonesia, aplikasi Sekolah, UKM dan beberapa lembaga lainnya. Mampu memberi masukkan tentang aplikasi yang akan dibuat serta meminimalisasi tingkat kecurangan dalam aplikasi.

1 Response to "Deklarasi 32 Bit Dan 64 Bit Api Untuk Pengembang Vba"

  1. However, fraud and dishonest have been majorly concerning the customers of on-line playing. A lot of on-line casinos and on-line playing websites have been accused of not being clear and hiding their internal workings and the methods for their dealings. With blockchain technology, everybody will be able to|be capable of|have the flexibility to} see precisely what is going on|what's going on} behind the scenes. Games similar to SlotsMillion, Casino VR Poker, and The Gear may be} performed by way of VR are participating the customers and are shaping https://thekingofdealer.com/pharaoh-casino/ the net playing industry.

    ReplyDelete

Kode Iklan Atas Artikel

Kode Iklan Tengah Artikel 1

Kode Iklan Tengah Artikel 2

Kode Iklan Bawah Artikel

Call me
Whatsapp dan Telp silahkan hubungi :

+62852 1966 6672

Done