Indigo Rose Software

Professional Software Development Tools

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

    Peekaboo! A confuse problem about Application.Sleep?

    Hi all:
    I have some codes as below:
    --It uses Windows Media Player to open a file that the name is 12-128k_wma.wma

    File.Run("AutoPlay\\Docs\\wmplayer.exe", "D:\\design-MM\\AUDIO\\source\\12\\wma\\12-128k_wma.wma", "", SW_SHOWNORMAL, false);

    --Makes the application sleep for 343000 second
    Application.Sleep (343000);

    --Finds all open windows with the string "Windows Media Player" in the title and sends each of them a close message.

    windows = Window.EnumerateTitles();

    window_name = "Windows Media Player";

    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

    At this time problem is appeared. If I uses upon codes, I must wait 343000 seconds to end, then I can use or open the application again. If I interrupt the application by manual during 34300 seconds, it has not responding. It must wait 343000 seconds to end that it can use again.

    I wish When the application be opened by user, it can interrupt immediatly without waiting 343000 seconds to end. If I can't interrupt the application, it can go on working include 343000 seconds of waiting.

    How can I do that it reach my demand? Who can teach me or give me an example? Thank you for advance!

    About Application.Sleep command:
    Can it other parameters or commands use together?
    If it can do it, who has it examples for me?
    Pierre

  2. #2
    Join Date
    Sep 2002
    Location
    Sol 3
    Posts
    3,160
    That is what Application.Sleep does, it puts your AMS appliction to sleep and appears like it is non-responsive until it wakes up. If you want your application to remain responsive you can look at Page.StartTimer and start a timer for the duration, and when the timer expires it would then close your external window.
    TJ-Tigger
    "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
    "Draco dormiens nunquam titillandus."
    Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

  3. #3
    Join Date
    Apr 2004
    Location
    Taiwan
    Posts
    83
    Sorry, TJ_Tigger.
    I still can't know how to do it. Can you make a simple example for me, please? How to use the Page.StartTimer to reach my demand? Thank you for advance.
    Pierre

  4. #4
    Join Date
    Sep 2002
    Location
    Sol 3
    Posts
    3,160
    There is an example here on how to use the timer.

    http://www.indigorose.com/forums/showthread.php?t=7246
    TJ-Tigger
    "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
    "Draco dormiens nunquam titillandus."
    Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

Similar Threads

  1. Problem in some machine confs
    By AKB in forum AutoPlay Media Studio 4.0
    Replies: 7
    Last Post: 09-06-2003, 08:41 AM
  2. PROBLEM: Setup Starts and then Crashes
    By Support in forum Setup Factory 5.0
    Replies: 0
    Last Post: 10-15-2002, 03:02 PM
  3. PROBLEM: Setup Requests Disk 2 in a Single File Setup
    By Support in forum Setup Factory 6.0 Knowledge Base
    Replies: 0
    Last Post: 10-09-2002, 02:04 PM
  4. INFO: Tips for Debugging Action Lists in AutoPlay Media Studio 4.0
    By Support in forum AutoPlay Media Studio 4.0 Examples
    Replies: 0
    Last Post: 10-03-2002, 08:38 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