Quantcast
Channel: VBForums - CodeBank - Visual Basic 6 and earlier
Viewing all articles
Browse latest Browse all 1529

VB6 MultiThreading,A new way to get the VB header,For CreateThread

$
0
0
Msgbox GetVBHeader

Code:

Private Type MODULEINFO
    lpBaseDLL As Long
    ImageSize As Long
    EntryPoint As Long
End Type

Private Declare Function GetModuleInformation Lib "psapi.dll" (ByVal hProcess As Long, ByVal hModule As Long, mInfo As MODULEINFO, ByVal cbSize As Long) As Long
Private Declare Function GetCurrentProcess Lib "kernel32" () As Long
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (Destination As Any, Source As Any, ByVal Length As Long)

Function GetVBHeader() As Long
  Dim mInfo As MODULEINFO
  GetModuleInformation GetCurrentProcess(), &H400000, mInfo, 12
  If mInfo.EntryPoint Then CopyMemory GetVBHeader, ByVal mInfo.EntryPoint + 1, 4
End Function


Viewing all articles
Browse latest Browse all 1529

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>