Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2004
    Location
    Taiwan
    Posts
    83

    How can interrupt auto run application when running?

    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).."__".."Mult i_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();
    Pierre

  2. #2
    Join Date
    Nov 2003
    Location
    Salzburg / Austria
    Posts
    312
    The problem is the action "Application.Sleep (1419000)".

    Onlinehelp Note: While sleeping, the application will not respond to mouse movements, clicks, or key presses.

    "will be closed by automatically after count equal five, and through 1419000 seconds"
    Time: (number) The time to sleep, in milliseconds.
    time to sleep: 1419 seconds (about 23 minutes).

    Where do you start the timer?
    Where do you create the "test.log" file. (The file must exist)

    Your code in the [On Timer] is better placed at the end of the code from [OnClick]




    Stefan

  3. #3
    Join Date
    Apr 2004
    Location
    Taiwan
    Posts
    83
    Hi Stefan_M:
    First, thank you for replying my problem. But I can't complete your meaning.

    Your said:
    Where do you start the timer?
    Where do you create the "test.log" file. (The file must exist)


    1th:
    Q: Where do you start the timer?
    A: After user input a numeric count for loop on this codes.

    2th:
    Q: Where do you create the "test.log"file?
    A: I will create the test.log file by AMS5.0 on c: drive.

    Other confuse problem: Your said: On the [OnTimer] tab, all codes can put in [OnClick] tab, is it correct? Can you reply the issue again? Thank you for advance.
    Pierre

  4. #4
    Join Date
    Nov 2003
    Location
    Salzburg / Austria
    Posts
    312
    In all cases I mean where did you place the 'code' to do something.

    Why did place the code for closing the application in the [OnTimer] page?

    There is a conceptual problem: you want that the application reacts on user events but you make the application sleep for a long time.



    Stefan

  5. #5
    Join Date
    Apr 2004
    Location
    Taiwan
    Posts
    83
    Hi Stefan_M:
    What action can I use to interrupt autorun application when running program?
    Pierre

Similar Threads

  1. Running an Application After Rebooting
    By Desmond in forum AutoPlay Media Studio 5.0 Examples
    Replies: 0
    Last Post: 09-26-2003, 09:15 AM
  2. Running my Application Only Once
    By Desmond in forum AutoPlay Media Studio 5.0 Examples
    Replies: 0
    Last Post: 09-26-2003, 08:46 AM
  3. HOWTO: Distribute an AutoPlay Application with Setup Factory 6.0
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-25-2002, 02:33 PM
  4. HOWTO: Make an AutoPlay Application Expire
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-09-2002, 10:10 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts