borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2010 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (What is Visual Basic .Net?)Next Topic (Auto import text files into Access) New Topic New Poll Post Reply
AndreaVB Forum : VB.Net : Help with VB.net
Poster Message
yumyum
Level: Guest


Ads by Lake Quincy Media
icon Help with VB.net

I have just started teaching myself VB.net and this is the first time that i have had a go at learning a programing language and i got to say that im enjoying it very much.
With some help from one or 2 books i have made 1 or 2 programs but i need some help

Someone sent me a module for VB6 and i would like to us it in VB.net but i have not got a clue how to do it  
This is the module i got

Private Const PROCESS_ALL_ACCESS = &H1F0FFF
Private Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Long, lpdwProcessId As Long) As Long
Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
Private Declare Function WriteProcessMemory Lib "kernel32" (ByVal hProcess As Long, ByVal lpBaseAddress As Any, lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long
Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal Classname As String, ByVal WindowName As String) As Long
Private Declare Function ReadProcessMem Lib "kernel32" Alias "ReadProcessMemory" (ByVal hProcess As Long, ByVal lpBaseAddress As Any, ByRef lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long
Public Declare Function GetKeyPress Lib "user32" Alias "GetAsyncKeyState" (ByVal key As Long) As Integer
Public Declare Function GetAsyncKeyState Lib "user32.dll" (ByVal vKey As Long) As Integer
Public Declare Sub keybd_event Lib "user32.dll" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
Public Declare Function sndPlaySound Lib "winmm.dll" Alias "sndPlaySoundA" (ByVal lpszSoundName As String, ByVal uFlags As Long) As Long

Public Sub WriteAInt(Address As Long, Value As Integer)
    Dim hwnd As Long, pid As Long, phandle As Long
    '2: 9090, write in reverse
    hwnd = FindWindow(vbNullString, "Delta Force 2,  V1.06.15")
    If (hwnd <> 0) Then
        GetWindowThreadProcessId hwnd, pid
        phandle = OpenProcess(PROCESS_ALL_ACCESS, False, pid)
        If (phandle <> 0) Then
            WriteProcessMemory phandle, Address, Value, 2, 0&
        End If
        CloseHandle phandle
    End If
End Sub

I would be most greatfull for any help with this, as im starting to  

thx
nick

14-01-2003 at 02:04 PM
| Quote Reply
devmann
Level: Guest

icon Re: Help with VB.net

Hei

I don't know what your code i surpose to do but ..

Private Const PROCESS_ALL_ACCESS As Long = &H1F0FFF

and any as a type don't exist i vb.net use long.

This may help you  

Ads by Lake Quincy Media
06-07-2003 at 10:48 AM
| Quote Reply
the_devil73
Level: Guest

icon Re: Help with VB.net

im srry but i need help with this command im trying to make a game trainer and i need it to read the memory then write to  it every time a different option is selected. i need some code to do that with

08-08-2003 at 03:52 PM
| Quote Reply
AndreaVB Forum : VB.Net : Help with VB.net
Previous Topic (What is Visual Basic .Net?)Next Topic (Auto import text files into Access) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2010 Andrea Tincaniborder