Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Code Samples & Tips
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Code Samples & Tips Share your recent discoveries and ideas with other users.


Shell and wait


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-26-2008, 03:14 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 2,724
Default Shell and wait

The following code allows you to run an external application and wait for it to finish (unlike regular Shell which continues to run immediately).
It requires the Door library: http://www.basic4ppc.com/forum/showthread.php?p=11025

Code:
Sub Globals
    'Declare the global variables here.

End Sub

Sub App_Start
    'Initialize objects
    process.New1(false)
    process.CreateNew("System.Diagnostics.Process" & process.System_NS)
    StartInfo.New1(false)
    StartInfo.Value = process.GetProperty("StartInfo")
    
    'Usage
    ShellAndWait("iexplore","www.basic4ppc.com")
    Msgbox("After Shell")
End Sub

Sub ShellAndWait(File, Arguments)
    StartInfo.SetProperty("FileName",File)
    StartInfo.SetProperty("Arguments",arguments)
    process.RunMethod("Start")
    process.RunMethod("WaitForExit")
    process.RunMethod("Close")
End Sub
Attached Files
File Type: sbp ShellAndWait.sbp (788 Bytes, 61 views)
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Shell and wait while process is running g0dspeed Questions & Help Needed 2 03-22-2008 09:48 AM
using shell() Put Claude Questions & Help Needed 2 12-26-2007 08:41 AM
Shell Wizarda2z Questions & Help Needed 3 08-05-2007 07:56 AM
Shell tvrman Questions & Help Needed 3 07-30-2007 01:20 PM
Wait cursor library agraham Code Samples & Tips 2 07-07-2007 02:49 PM


All times are GMT. The time now is 06:21 PM.


Powered by vBulletin® Version 3.6.10
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0