Guest User

Win32api

a guest
Jun 24th, 2017
306
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 3.01 KB | None | 0 0
  1.     Private Declare Function CloseHandle Lib "kernel32" (ByVal pHandle As IntPtr) As Boolean
  2.     Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Integer, ByVal bInheritHandle As Boolean, ByVal dwProcessId As UInteger) As IntPtr
  3.     Private Declare Function ReadProcessMemory Lib "kernel32" (ByVal hProcess As IntPtr, ByVal lpBaseAddress As IntPtr, <Runtime.InteropServices.Out()> ByVal lpBuffer As Byte(), ByVal nSize As UInteger, ByRef lpNumberOfBytesRead As UInteger) As Boolean
  4.     Private Declare Function WriteProcessMemory Lib "kernel32" (ByVal hProcess As IntPtr, ByVal lpBaseAddress As IntPtr, ByVal lpBuffer As Byte(), ByVal nSize As UInteger, ByRef lpNumberOfBytesWritten As UInteger) As Boolean
  5.     Public Declare Function GetWindowThreadProcessId Lib "user32.dll" (ByVal hwnd As IntPtr, ByRef lpdwProcessID As Integer) As Integer
  6.     Private Declare Function VirtualAllocEx Lib "kernel32" (ByVal hProcess As IntPtr, ByVal lpAddress As IntPtr, ByVal dwSize As UInteger, ByVal flAllocationType As UInteger, ByVal flProtect As UInteger) As IntPtr
  7.     Public Declare Function VirtualFreeEx Lib "kernel32" (ByVal hProcess As IntPtr, ByVal lpAddress As IntPtr, ByVal dwSize As Integer, ByVal dwFreeType As Integer) As Integer
  8.     Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Integer, ByVal wMsg As Integer, ByVal wParam As Integer, ByVal lParam As String) As Integer
  9.     Private Declare Function EnumChildWindows Lib "user32" (ByVal hWnd As IntPtr, ByVal lpEnumFunc As EnumWindProc, ByRef lParam As IntPtr) As Int32
  10.     Private Delegate Function EnumWindProc(ByVal hWnd As Int32, ByVal lParam As Int32) As Boolean
  11.     Private Delegate Function EnumChildWindProc(ByVal hWnd As Int32, ByVal lParam As Int32) As Boolean
  12.     <DllImport("user32.dll")> _
  13.     Private Shared Function FindWindow(lpClassName As String, lpWindowName As String) As IntPtr
  14.     End Function
  15.  
  16. Public Const LVM_FIRST = &H1000
  17.     Public Const LVM_GETITEMTEXTA = (LVM_FIRST + 45)
  18.     Public Const LVM_GETITEMTEXT = LVM_GETITEMTEXTA
  19.     Public Const LVM_DELETEITEM = (LVM_FIRST + 8)
  20.     Public Const LVM_GETITEMCOUNT = (LVM_FIRST + 4)
  21.     Public Const PROCESS_VM_READ = &H10
  22.     Public Const PROCESS_VM_WRITE = (&H20)
  23.     Public Const PROCESS_VM_OPERATION = (&H8)
  24.     Public Const PROCESS_QUERY_INFORMATION = (&H400)
  25.     Public Const PAGE_READWRITE As Long = &H4
  26.     Public Const PAGE_READONLY As System.UInt32 = &H2
  27.     Public Const MEM_COMMIT As Long = &H1000&
  28.     Public Const MEM_RELEASE As Long = &H8000&
  29. #Region " [LVITEM] "
  30.     Public Structure LVITEM
  31.         Dim mask As UInteger
  32.         Dim iItem As Integer
  33.         Dim iSubItem As Integer
  34.         Dim state As UInteger
  35.         Dim stateMask As UInteger
  36.         Dim pszText As String
  37.         Dim cchTextMax As Integer
  38.         Dim iImage As Integer
  39.         Dim lParam As IntPtr
  40.         Dim iIndent As Integer
  41.         Dim iGroupId As Integer
  42.         Dim cColumns As UInteger
  43.         Dim puColumns As IntPtr
  44.     End Structure
  45. #End Region
Advertisement
Add Comment
Please, Sign In to add comment