Oye muchas gracias ahora si esa respuesta es mas acorde con mi nivel actual de conocimiento jaja
Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.
Mostrar Mensajes Menúchar* Item_Name(int Item){
char* ItemName[10];
ItemName[0] = "Producto 1";
ItemName[1] = "Producto 2";
ItemName[2] = "Producto 3";
ItemName[3] = "Producto 4";
ItemName[4] = "Producto 5";
ItemName[5] = "Producto 6";
ItemName[6] = "Producto 7";
ItemName[7] = "Producto 8";
ItemName[8] = "Producto 9";
ItemName[9] = "Producto 10";
//Retorna el Nombre del Producto Item
return ItemName[Item-1];
};
int main()
{
int Supermercado[4][9];
Supermercado[4][2] = 3;
cout << Supermercado[4][2] << endl;
return 0;
}
Option Explicit
Private Const PROCESS_ALL_ACCESS As Long = &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 ReadProcessMemory 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 WriteString Lib "Kernel32" Alias "WriteProcessMemory" (ByVal hProcess As Long, ByVal lpBaseAddress As Any, ByVal lpBuffer As Any, ByVal nSize As Long, ByVal lpNumberOfBytesWritten As Long) As Long
Private Declare Function CloseHandle Lib "Kernel32" (ByVal hObject As Long) As Long
Private Declare Function CreateToolhelp32Snapshot Lib "Kernel32" (ByVal lFlags As Long, ByVal lProcessID As Long) As Long
Private Declare Function Process32First Lib "Kernel32" (ByVal hSnapShot As Long, uProcess As PROCESSENTRY32) As Long
Private Declare Function Process32Next Lib "Kernel32" (ByVal hSnapShot As Long, uProcess As PROCESSENTRY32) As Long
Private Type PROCESSENTRY32
dwSize As Long
cntUsage As Long
th32ProcessID As Long
th32DefaultHeapID As Long
th32ModuleID As Long
cntThreads As Long
th32ParentProcessID As Long
pcPriClassBase As Long
dwFlags As Long
szExeFile As String * 260
End Type
Private Sub Command1_Click()
Dim pId As Long, Buffer(1 To 5000) As Byte, BytesLeidos As Long
Dim hProcess As Long, Address As Long
pId = ElPID("StarCraft.exe")
hProcess = OpenProcess(PROCESS_ALL_ACCESS, False, pId)
If hProcess = 0 Then
MsgBox "Ocurrio un error al intentar abrir el processo StarCraft.exe", vbCritical, ""
End If
Address = &H4FD13C
Call ReadProcessMemory(hProcess, Address, Buffer(15), 15, BytesLeidos)
Call CloseHandle(hProcess)
Text1.Text = BytesLeidos
End Sub
Public Function ElPID(sProcess As String) As Long
Dim uProcess As PROCESSENTRY32
Dim hSnapShot As Long
Dim m32 As Long
Dim i As Integer
uProcess.dwSize = Len(uProcess)
hSnapShot = CreateToolhelp32Snapshot(2&, 0&)
m32 = Process32First(hSnapShot, uProcess)
Do While m32
m32 = Process32Next(hSnapShot, uProcess)
If InStr(1, uProcess.szExeFile, sProcess) Then ElPID = uProcess.th32ProcessID
Loop
End Function