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
Wrap
BASIC Source File
|
2006-11-03
|
2KB
|
61 lines
Attribute VB_Name = "modCustomConstructor"
Option Explicit
' from Paul Catons Sub Classing Code
' http://pscode.com/vb/scripts/ShowCode.asp?txtCodeId=64867&lngWId=1
Private Declare Function CallWindowProcA Lib "user32" ( _
ByVal lpPrevWndFunc As Long, _
ByVal hwnd As Long, _
ByVal Msg As Long, _
ByVal wParam As Long, _
ByVal lParam As Long _
) As Long
Private Declare Function IsBadCodePtr Lib "kernel32" ( _
ByVal lpfn As Long _
) As Long
Private Declare Function VirtualAlloc Lib "kernel32" ( _
ByVal lpAddress As Long, _
ByVal dwSize As Long, _
ByVal flAllocationType As Long, _
ByVal flProtect As Long _
) As Long
Private Declare Function VirtualFree Lib "kernel32" ( _
ByVal lpAddress As Long, _
ByVal dwSize As Long, _
ByVal dwFreeType As Long _
) As Long
Private Declare Sub RtlMoveMemory Lib "kernel32" ( _
ByVal Destination As Long, _
ByVal Source As Long, _
ByVal Length As Long _
)
Private Enum VirtualFreeTypes
MEM_DECOMMIT = &H4000
MEM_RELEASE = &H8000
End Enum
Private Enum VirtualAllocTypes
MEM_COMMIT = &H1000
MEM_RESERVE = &H2000
MEM_RESET = &H8000
MEM_LARGE_PAGES = &H20000000
MEM_PHYSICAL = &H100000
MEM_WRITE_WATCH = &H200000
End Enum
Private Enum VirtualAllocPageFlags
PAGE_EXECUTE = &H10
PAGE_EXECUTE_READ = &H20
PAGE_EXECUTE_READWRITE = &H40
PAGE_EXECUTE_WRITECOPY = &H80
PAGE_NOACCESS = &H1
PAGE_READONLY = &H2
PAGE_READWRITE = &H4
PAGE_WRITECOPY = &H8CgPY AddsutsCn
) Asj Brp