![]() So quit the loop! if $temp = 0 then ExitLoop Append the character to our teststr variable that will hold the whole title string $SongTitle &= Chr ( $temp ) Increment address by one to obtain next byte $lpszTitle += 1 WEnd DllCall ( "Kernel32.dll", "int", "CloseHandle", "int", $ProcessHandle ) ErrorLevel and return value are not checked. Mp3 auto tagger, Mp3 Manager, Mp3 Tag Editor, M3 Id3 Tag Editor. no permission for reading from the process's memory if ( ) Then MsgBox ( 0, "", "ReadProcessMemory failed: " & ) DllCall ( "Kernel32.dll", "int", "CloseHandle", "int", $ProcessHandle ) Exit EndIf $temp = DllStructGetData ( $v_Struct, 1 ) Delete structure $v_Struct = 0 If the value of the byte read is zero we are at the end of the string. 圆4 Winamp Portable 64 bit download - 圆4 - X 64-bit Download - 圆4-bit download. Local $v_Struct = DllStructCreate ( 'byte' ) tempVar := DllCall("ReadProcessMemory", "UInt", ProcessHandle, "UInt", lpszTitle, "str", Output, "Uint", 1, "Uint *", 0) $result5 = DllCall ( 'kernel32.dll', 'int', 'ReadProcessMemory', 'int', $ProcessHandle, 'int', $lpszTitle, 'int', DllStructGetPtr ( $v_Struct, 1 ), 'int', 1, 'int', 0 ) Error checking - i.e. $Output = "x" Put exactly one character in as a placeholder. Value will be copied into the string buffer, which must contain exactly one character because ReadProcessMemory won't terminate the string, only overwrite its contents. clear the variable that will hold the track's name $SongTitle = "" While 1 Read from WinAMP's memory. We have to read byte after byte until we encounter a "00" byte (string ends). To proceed we have to use ReadProcessMemory and read starting at the returned address. ProcessHandle := DllCall("OpenProcess", "int", 24, "char", 0, "UInt", PID, "UInt") <-From AutoHotKey $result4 = DllCall ( "kernel32.dll", "uint", "OpenProcess", "byte", 0x10, "int", 0, "int", $PID ) if ( OR NOT $result4 ) then MsgBox ( 0, "", "OpenProcess failed: " & ) Exit endif $ProcessHandle = $result4 MsgBox (0,"",$result4) Now we have the pointer stored in lpszTitle. $result3 = DllCall ( "user32.dll", "int", "GetWindowThreadProcessId", "hwnd", $winampHWND, "int_ptr", $PID ) $PID = $result3 if ( OR NOT $PID ) Then MsgBox ( 0, "", "GetWindowThreadProcessId failed." ) Exit EndIf WARNING - Next command returns different result ($ProcessHandle) from AutoHotKey Open the process so we can to stuff with it. It will be stored in the output-parameter PID. $lpszTitle = $result2 Get the Process ID of WinAMP. ![]() Expand collapse popup #Include Dim $PID = 1 Retrieve Winamp window handle $winampHWND = WinGetHandle ( "" ) If $winampHWND = 0 Then MsgBox ( 0, "", "Winamp does not appear to be running." ) Exit EndIf 0x0400 = WM_USER 0x7D = IPC_GETLISTPOS $result = _SendMessage ( $winampHWND, 0x0400, 0, 0x7D, 0 ) If Then MsgBox ( 0, "", "SendMessage failed." & ) Exit EndIf $result2 = _SendMessage ( $winampHWND, 0x0400, $result, 0xD4, 0 ) If Then MsgBox ( 0, "", "SendMessage failed." ) Exit EndIf Store the address in a new var.
0 Comments
Leave a Reply. |