Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-19-2007, 09:20 AM
Member
 
Join Date: Sep 2006
Posts: 38
Default Return value for Shell.run?

According to the Documentation, The Shell.run method returns the window object.

My experience is that this varies greatly depending upon the applicaton that you're trying to launch.

For example, if I write...

window = Shell.run( "notepad.exe");
Dialogs.msgBox(window.handle);

Then the dialog box correctly shows the handle value.

If, however, I write...

window = Shell.run( C:\\\\Program Files\\norton antivirus\\navw32.exe");
Dialogs.msgBox(window.handle);

Then the dialog box shows "Undefined", even though the appplication DOES LAUNCH (the window successfully comes up).

Do you have any insights?

TIA

Steve


Reply With Quote
  #2 (permalink)  
Old 04-19-2007, 12:20 PM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:Return value for Shell.run?

Yes, it is possible that the "run" method returns undefined, because after launching the new program, it may not create and show its main window immediately. The "run" method has to wait for it to finish its initialization and display its main window. However, the "run" method does not wait long, but just returns undefined, because that would block the main movie. Although the run method may return undefined, you still can get the window handle of the newly created program later by using the Window.find method.
Reply With Quote
  #3 (permalink)  
Old 04-29-2007, 11:27 AM
Junior Member
 
Join Date: Jan 2006
Posts: 16
Default Re:Return value for Shell.run?

I try using the Window.find method, but still return undefinded, can give some more detail guide? thank you.
Reply With Quote
  #4 (permalink)  
Old 04-29-2007, 11:39 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:Return value for Shell.run?

If you only know the name of the window, but not the name of the window class, please use the following
Code:
Window.find(null, "window name");
Reply With Quote
  #5 (permalink)  
Old 04-29-2007, 12:08 PM
Junior Member
 
Join Date: Jan 2006
Posts: 16
Default Re:Return value for Shell.run?

thank you so quick response.
I use explore sample to test, my app is a dos console name as s.exe , in runCalc code:winCalc=Shell.run(getAdditionalFile("s.exe")) ; in closeCalc code: test=winCalc.find(null,"s");
Dialogs.msgBox(test.handle); but it's still undefinded. may be the name of window is wrong?
Reply With Quote
  #6 (permalink)  
Old 04-30-2007, 06:05 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re:Return value for Shell.run?

In the closeCalc script, please use
Code:
test=Window.find(null,"s");
because find is a static method of the Window object, and winCalc may be undefined, which does not have a find method.
Reply With Quote
Reply

Was this information helpful?    Yes No



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 04:15 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.