YoHoJo
2010-03-19 00:29:56
Anyone know of a program that can just spam open/close my CD tray?
<3YoHoJo
<3YoHoJo
2010-03-19 00:29:56
2010-03-19 00:32:22
2010-03-19 00:34:19
2010-03-19 00:35:17
2010-03-19 00:35:39
2010-03-21 00:00:46
var
IsSpamming, Stop: Boolean;
procedure Wait(ms: Cardinal);
var
eT: Cardinal;
begin
eT := GetTickCount + ms;
while (GetTickCount < eT) do
begin
Application.ProcessMessages;
Sleep(1);
end;
end;
procedure DoTheStuff;
var
BetweenV, AfterV: Integer;
begin
IsSpamming := True;
BetweenV := StrToInt(Form1.Edit1.Text);
AfterV := StrToInt(Form1.Edit2.Text);
repeat
mciSendString('Set cdaudio door open wait', nil, 0, Form1.Handle);
Wait(BetweenV);
mciSendString('Set cdaudio door closed wait', nil, 0, Form1.Handle);
Wait(AfterV);
Until(Stop);
Stop := False;
IsSpamming := False;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
if(not(IsSpamming)) then
DoTheStuff;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
Stop := True;
end;
procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
begin
Stop := True;
end;
2010-03-21 04:15:37
2010-03-21 06:09:09
function mcisendstring(command, buffer : string; returnbuf : longword; callbackhandle : hwnd) : longword; external 'mciSendStringA@winmm.dll'; stdcall;should work.
2010-03-21 06:18:52
From: Markus
Except that he cheats using compiled applications, while API calls also do the job :)should work.
function mcisendstring(command, buffer : string; returnbuf : longword; callbackhandle : hwnd) : longword; external 'mciSendStringA@winmm.dll'; stdcall;
2010-03-21 07:46:42
2010-03-21 08:07:17
# open and close the CD <strong class="highlight">tray</strong> door (Windows OS)
# tested with <strong class="highlight">Python</strong> 3.1
import ctypes
import time
# open the CD <strong class="highlight">tray</strong> door
ctypes.windll.winmm.mciSendStringW("set cdaudio door open",
None, 0, None)
# wait 3.5 seconds
time.sleep(3.5)
# close the CD <strong class="highlight">tray</strong> (manual closing only with some notebooks)
ctypes.windll.winmm.mciSendStringW("set cdaudio door closed",
None, 0, None)
2010-03-21 15:33:42
2010-03-21 18:10:43