pierre
04-24-2004, 09:54 AM
Hi All:
Now, I have a problem that it needs all help me modyfying below codes.
--It will display a dialog window to input a numeric by user for loop, and it will open test.m3u by Winamp media player. If the user input a numeric is 5, it will count five times. The autorun application window will minimize first. After 1419000 seconds, the count becomes two until five, then play to end. At this time, the external application (winamp) will be closed by automatically after count equal five, and through 1419000 seconds. And it will record every time open media player time and date.
I wish I can interrupt the application [It means the auto run application, not external application(winamp)] any time after the user has input a numeric to count for loop on this codes.
How can I do? Please all help me modifying and solving this codes probelm again. Thank you for advance.
[OnClick]
numeric = "";
while (numeric == "") and (numeric ~= "CANCEL") do
numeric = Dialog.Input("Burn in", "Please enter your numeric for loop :", "", MB_ICONQUESTION);
if numeric == "" then
result = Dialog.Message("Invalid Input", "Please use a numeric value greater than" , MB_OK, MB_ICONEXCLAMATION, MB_DEFBUTTON1);
elseif numeric ~= "CANCEL" then
min = 1; -- The number to start at
max = numeric; -- The number to stop at
for count = min, max do
File.Open("AutoPlay\\Docs\\test.m3u", "", SW_SHOWNORMAL);
TextFile.WriteFromString("C:\\Test.log", System.GetDate(DATE_FMT_US).."__Start time:"..System.GetTime(TIME_FMT_AMPM).."__".."Multi_Media_Audio" .. "\r\n", true);
handle = Application.GetWndHandle();
--Hide the AutoPlay application window.
Window.Minimize(handle);
Application.Sleep (1419000);
end
end
end
[OnTimer]
--Finds all open windows with the string "Windows Media Player" in the title and sends each of them a close message.
windows = Window.EnumerateTitles()
tblwindow_name = {"Windows Media Player", "Real", "WinAmp"};
for index, window_name in tblwindow_name do
for handle, title in windows do
result = String.Find(title, window_name, 1, false);
if (result ~= -1) then
Window.Close(handle, CLOSEWND_TERMINATE);
end
end
end
Page.StopTimer();
Now, I have a problem that it needs all help me modyfying below codes.
--It will display a dialog window to input a numeric by user for loop, and it will open test.m3u by Winamp media player. If the user input a numeric is 5, it will count five times. The autorun application window will minimize first. After 1419000 seconds, the count becomes two until five, then play to end. At this time, the external application (winamp) will be closed by automatically after count equal five, and through 1419000 seconds. And it will record every time open media player time and date.
I wish I can interrupt the application [It means the auto run application, not external application(winamp)] any time after the user has input a numeric to count for loop on this codes.
How can I do? Please all help me modifying and solving this codes probelm again. Thank you for advance.
[OnClick]
numeric = "";
while (numeric == "") and (numeric ~= "CANCEL") do
numeric = Dialog.Input("Burn in", "Please enter your numeric for loop :", "", MB_ICONQUESTION);
if numeric == "" then
result = Dialog.Message("Invalid Input", "Please use a numeric value greater than" , MB_OK, MB_ICONEXCLAMATION, MB_DEFBUTTON1);
elseif numeric ~= "CANCEL" then
min = 1; -- The number to start at
max = numeric; -- The number to stop at
for count = min, max do
File.Open("AutoPlay\\Docs\\test.m3u", "", SW_SHOWNORMAL);
TextFile.WriteFromString("C:\\Test.log", System.GetDate(DATE_FMT_US).."__Start time:"..System.GetTime(TIME_FMT_AMPM).."__".."Multi_Media_Audio" .. "\r\n", true);
handle = Application.GetWndHandle();
--Hide the AutoPlay application window.
Window.Minimize(handle);
Application.Sleep (1419000);
end
end
end
[OnTimer]
--Finds all open windows with the string "Windows Media Player" in the title and sends each of them a close message.
windows = Window.EnumerateTitles()
tblwindow_name = {"Windows Media Player", "Real", "WinAmp"};
for index, window_name in tblwindow_name do
for handle, title in windows do
result = String.Find(title, window_name, 1, false);
if (result ~= -1) then
Window.Close(handle, CLOSEWND_TERMINATE);
end
end
end
Page.StopTimer();