Einzelnen Beitrag anzeigen

bladecs

Registriert seit: 10. Sep 2005
23 Beiträge
 
Delphi 6 Personal
 
#10

Re: TWinAmpControl - Die ultimative Unit für Winamp :)

  Alt 27. Jan 2006, 21:31
tipp:


du könntest auch noch eine property für volume einbauen.

code würde so ungefähr aussehen:

Delphi-Quellcode:
private
function GetVolume: Byte;

public
procedure SetVolume(Vol: Byte);
property Volume: Byte read GetVolume write Setvolume;

end;

function TWinAmpControl.GetVolume: Byte;
var
  wnd: HWND;
begin
  if IsRunning then
  begin
    wnd := GetHandle;
    result:=SendMessage(wnd, WM_WA_IPC, -666, IPC_SETVOLUME);
  end;
end;

procedure TWinAmpControl.SetVolume(vol: Byte);
var
  wnd: HWND;
begin
  if IsRunning then
  begin
    wnd := GetHandle;
    SendMessage(wnd, WM_WA_IPC, vol, IPC_SETVOLUME);
  end;
end;
  Mit Zitat antworten Zitat