$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. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |