home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 5_2007-2008.ISO / data / Zips / DirectSoun2029361162006.psc / modCustomConstructor.bas < prev   
BASIC Source File  |  2006-11-03  |  2KB  |  61 lines

  1. Attribute VB_Name = "modCustomConstructor"
  2. Option Explicit
  3.  
  4. ' from Paul Catons Sub Classing Code
  5. ' http://pscode.com/vb/scripts/ShowCode.asp?txtCodeId=64867&lngWId=1
  6.  
  7. Private Declare Function CallWindowProcA Lib "user32" ( _
  8.     ByVal lpPrevWndFunc As Long, _
  9.     ByVal hwnd As Long, _
  10.     ByVal Msg As Long, _
  11.     ByVal wParam As Long, _
  12.     ByVal lParam As Long _
  13. ) As Long
  14.  
  15. Private Declare Function IsBadCodePtr Lib "kernel32" ( _
  16.     ByVal lpfn As Long _
  17. ) As Long
  18.  
  19. Private Declare Function VirtualAlloc Lib "kernel32" ( _
  20.     ByVal lpAddress As Long, _
  21.     ByVal dwSize As Long, _
  22.     ByVal flAllocationType As Long, _
  23.     ByVal flProtect As Long _
  24. ) As Long
  25.  
  26. Private Declare Function VirtualFree Lib "kernel32" ( _
  27.     ByVal lpAddress As Long, _
  28.     ByVal dwSize As Long, _
  29.     ByVal dwFreeType As Long _
  30. ) As Long
  31.  
  32. Private Declare Sub RtlMoveMemory Lib "kernel32" ( _
  33.     ByVal Destination As Long, _
  34.     ByVal Source As Long, _
  35.     ByVal Length As Long _
  36. )
  37.  
  38. Private Enum VirtualFreeTypes
  39.     MEM_DECOMMIT = &H4000
  40.     MEM_RELEASE = &H8000
  41. End Enum
  42.  
  43. Private Enum VirtualAllocTypes
  44.     MEM_COMMIT = &H1000
  45.     MEM_RESERVE = &H2000
  46.     MEM_RESET = &H8000
  47.     MEM_LARGE_PAGES = &H20000000
  48.     MEM_PHYSICAL = &H100000
  49.     MEM_WRITE_WATCH = &H200000
  50. End Enum
  51.  
  52. Private Enum VirtualAllocPageFlags
  53.     PAGE_EXECUTE = &H10
  54.     PAGE_EXECUTE_READ = &H20
  55.     PAGE_EXECUTE_READWRITE = &H40
  56.     PAGE_EXECUTE_WRITECOPY = &H80
  57.     PAGE_NOACCESS = &H1
  58.     PAGE_READONLY = &H2
  59.     PAGE_READWRITE = &H4
  60.     PAGE_WRITECOPY = &H8CgPY AddsutsCn
  61. ) Asj  Brp