How to launch other programs?

Hi guys!
How can I launch other programs with pjava?
Can I use the command "Runtime.getRuntime().exec()"?Please Help Me!
Thanks!
Fabio

'Runtime.getRuntime().exec()' is not implemented in the current version of the java runtime for Personal Java on the WinCE platform. You have to write jni code to kick off the process. Here's an example in C++ using the Visual embedded tools.
// PocketViewer.cpp : Defines the entry point for the DLL application.
#include "stdafx.h"
#include "PocketViewer.h"
#include "jni.h"
#include "com_uo_wireless_Loader.h"
#include "winbase.h"
#include "Tchar.h"
BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
switch (ul_reason_for_call)
          case DLL_PROCESS_ATTACH:
          case DLL_THREAD_ATTACH:
          case DLL_THREAD_DETACH:
          case DLL_PROCESS_DETACH:
               break;
return TRUE;
JNIEXPORT void JNICALL Java_com_uo_wireless_Loader_getVideoDevice
(JNIEnv *env, jobject obj, jstring url)
     PROCESS_INFORMATION pInfo;
     STARTUPINFO sInfo;
     sInfo.cb = sizeof(STARTUPINFO);
     sInfo.lpReserved = NULL;
     sInfo.lpReserved2 = NULL;
     sInfo.cbReserved2 = 0;
     sInfo.lpDesktop = NULL;
     sInfo.lpTitle = NULL;
     sInfo.dwFlags = 0;
     sInfo.dwX = 0;
     sInfo.dwY=0;
     sInfo.dwFillAttribute=0;
     sInfo.wShowWindow = SW_SHOW;
     const char *str = (env)->GetStringUTFChars(url,FALSE);
     TCHAR szAppName[] = TEXT("Program Files\\PocketTV\\PocketTV.exe");
     //TCHAR szPVB[] = TEXT("http://167.167.136.82/movies/mh.mpa");
     TCHAR szPVB[150];
     MultiByteToWideChar(CP_ACP,0,str,-1,szPVB,1024);
     if (!CreateProcess(szAppName,szPVB,NULL,NULL,FALSE,0,NULL,NULL,&sInfo,&pInfo))
          printf("Error\n");
          //exit(1);
     (env)->ReleaseStringUTFChars(url,str);
     return;
JNIEXPORT void JNICALL Java_com_uo_wireless_Loader_getAudioDevice
(JNIEnv *env, jobject obj, jstring url)
     PROCESS_INFORMATION pInfo;
     STARTUPINFO sInfo;
     sInfo.cb = sizeof(STARTUPINFO);
     sInfo.lpReserved = NULL;
     sInfo.lpReserved2 = NULL;
     sInfo.cbReserved2 = 0;
     sInfo.lpDesktop = NULL;
     sInfo.lpTitle = NULL;
     sInfo.dwFlags = 0;
     sInfo.dwX = 0;
     sInfo.dwY=0;
     sInfo.dwFillAttribute=0;
     sInfo.wShowWindow = SW_SHOW;
     const char *str = (env)->GetStringUTFChars(url,FALSE);
     TCHAR szAppName[] = TEXT("Windows\\ceplayer.exe");
     TCHAR szPVB[150];
     MultiByteToWideChar(CP_ACP,0,str,-1,szPVB,1024);
     if (!CreateProcess(szAppName,szPVB,NULL,NULL,FALSE,0,NULL,NULL,&sInfo,&pInfo))
          printf("Error\n");
          //exit(1);
     (env)->ReleaseStringUTFChars(url,str);
     return;

Similar Messages

  • Robohelp Crashes After Launching Other Programs, Especially Quickbooks

    We are experienced multiple Robohelp issues on multiple machines.  I appreciate this forums patience as we work through these issues.  Support has been useless.  Anyway, when we have a project open in Robohelp 9 and we launch other programs it will normally lock up Robohelp.  This doesn't happen every time, but at least 50% approx.  We've noticed this is particulary true with running Quickbooks after opening Robohelp 9.  Any help would be greatly appreciated. 
    Also, are there any known issues with Windows 7 64bit and Robohelp? One of our PCs is running Windows 7 now but all the others are still xp 32 bit.

    In addition to Jeff's comments...
    Are you copying down by using copy and paste? If so zip on the server and copy the zip file.
    In your first post in this thread you say "Also, are there any known issues with Windows 7 64bit and Robohelp?" Please see the Sticky Topic "Before You Post" where it is requested that all threads start with the version of RoboHelp used. Both 8 (patched) and 9 should work fine but there may be problems with earlier versions.
    See www.grainge.org for RoboHelp and Authoring tips
    @petergrainge

  • How to launch a program from Director?

    Hi, I'm new to Director.
    I want the user of my Director movie to click on a button
    that launches Adobe Acrobat and a help file (external to the
    Director movie).
    How do I do this?

    I have a similar question... can Director be used to launch a
    program? I understand that you can tell it to open a file, in which
    case the default application is automatically launched, but can you
    give it a specific command line to execute?
    I have SCALA MM200, and it can execute command lines from
    within Windows, but as I recall it wasn't a very seamless
    transition between the presentation and the launched program. I
    hesitate to keep using MM200, since it was designed for Win 98/NT,
    but rather than buy new software it might be best to stick with
    what I've got if it still works under XP.
    Seems to me a lot of current "multimedia" software is great
    for animations and presentations, but there's little consideration
    for creating a true GUI with it that will do stuff outside of the
    presentation itself. I suppose I should go with VisualBasic or
    something like that, but my programming days are 20 years behind
    me, and there's still the issue of buying new software (unless VB
    is free, which I doubt).
    I plan to try MM200 under XP, but if it doesn't work, or
    doesn't perform quite as I'd like it to, it would help to know that
    Director could work. However, if there's no way to execute a
    specific command line, it probably isn't the right choice for me.
    A quick summary of my planned application is to present a
    menu of choices to the user, and then execute certain programs
    depending on the choice. The presentation will probably hide in the
    background while these programs run, so another consideration is
    avoiding any conflicts. The programs are video game emulators, and
    certain options are set in the command line, so simply telling
    Director to open a game file may not work, even if the emulator is
    set as the default application to open that file. I'll still need
    to pass certain command line switches to the app, and I'm not sure
    I can do that in Director.
    Thanks in advance for any help! :) (I never visit the forum,
    so it's best to e-mail me at [email protected])

  • Help! how to run other programs using java

    how can i run other programs or exe files using java, anyone can give sample codes for this.
    ex. if I click [run MsWord] button, then msWord automatically lunch

    RunTime.getRuntime().exec(string command)
    I guess, it might help you..java.lang.Runtime

  • How to call other program in java

    how do i write code to call a program, software in window envirenment?
    such as opening Microsoft Excel files using Microsoft excel?
    plz help

    public static void main(String[] args)
             try
                     Runtime.getRuntime().exec("Book1.xls");
             catch (IOException ed)
    }i tried, but it not working , plz help

  • How to launch other air application from on air application

    Hi there,
    I am new to air technology, I wonder if air can allow me to
    launch different air application when I am in air application. All
    my applications are desktop application.
    By the way, how can I attach my EULA when installing my air
    application?
    Best,

    Take a look at the help for the CreateInterface function. Notepad.exe doesn't have an ActiveX so you have to start it with a command line shell. I don't recall for the moment the function in HiQ that allows that.
    LabVIEW, C'est LabVIEW

  • How to open other programs (Say MS Office word ) through java code.

    Hi,
    Scenario is...
    When we click a button i need a new (blank) word document to be opened (in MS office).
    MS office is just for an example. It can be acrobat reader,winamp,windows media player
    If you dont know the way to do this, please dont post "It is not possible".
    Thank you
    Ashish P.J

    ofcourse by using "process" and "runtime" and "exec" i can open a notepad,calc....
    exec(notepad);
    exec(calc);but what about excel? or word or other applications...
    exec(excel);wont open a blank excel sheet
    even if i give the path to excel(C:\Progarmfiles\.....what ever)

  • How to launch a local program from a Form running on Web

    How to launch a program in local hard disk, say notepad, from a Form running on web?
    I tried the HOST() function but it will launch notepad on the application server other than the client.
    Thanks,

    You can use the following code from a Pluggable Java Component (PJC) to invoke notepad
    String cmd = "notepad.exe";
    Process p1 = null;
    Runtime rt = Runtime.getRuntime();
    int exitValue;
    try
    p1 = rt.exec(cmd);
    exitValue = p1.exitValue();
    System.out.println("Command returned status : " + exitValue);
    catch (Exception e)
    System.out.println("Error : " + e);
    Of course in reality the command to execute would be sent from the Forms Program as a Set_Custom_Property on the PJC
    Note that the PJC to do this would have to be signed to allow access to run such commands

  • Launching External programs from an addon cause Client to stop

    Hi.
    We have an add-on that allow via configuration to launch other programs/files from SAP (Remote desktop, PDF-documents, etc.).
    Launching other processes from an add-on is easy with the System.Diagnostics.Process.Start(file, arguments);
    This has worked since SBO2004A, but since we began working with SBO2005A SP01 launching external programs cause the SAP Client to freeze every 5-10th time or so...
    Nothing except stopping the add-on-process works.
    When the add-on is terminated the Client "Wakes up" to inform that add-on has been disconnected.
    Anyone else have had a similar problem?
    <i>Kind Regards
    Rasmus Wulff Jensen | http://www.b1up.net</i>

    Regarding the thread, I whought about it, but since it is a process.Start, it a whole different process and threads should not have anything to do with it...
    As always, yes I've created a message for this.... And got the normal response from SAP Support "We cant reproduce the issue... please send sample code"... sigh.... Hate random error that can't be reproduced... and sample code is hard to produce when you have created a whole framework above the SDK... I almost never do any "Core" SDK...

  • How to tell what other program is using webcam?

    Hello,
    My in-laws sometimes (maybe 20% of the time) get a message that says that the webcam is already in use by another program when they try to video chat with us. The message is in Danish and says something like "Webcamaret bruges af et andet program". They haven't started any other program. iChat shows a green camera icon on both their buddy list and on our remote system's buddy list.
    Restarting or stopping iChat and disconnecting/reconnecting their webcam always seems to fix the problem, but I'd like to understand how to fix once and for all. Restarting is time consuming and rather disruptive for them and reseating the webcam is difficult for them physically to do.
    They have a Mac Mini Intel 1.66 Core Duo. I recently switched out their firewire-based iSight with a USB-based Logitech Quickcam Vision Pro for Mac. They had the same problem with both, but they don't have the iSight any longer to try it again.
    They are half-way across the world, and not tech-savvy, so resetting the PMU won't be possible.
    I've looked through their Console logs, but don't even see any error message when it occurs.
    Thanks in advance for any suggestions.
    David

    Hi,
    Have them check in System Preferences > Accounts > (The Logged in account) > Login Items.
    This is a list of the apps and utilities that start up when the Mac does.
    (iTunes Helper is a common one that most people have).
    This is one common cause of another app having access the the camera.
    Look for iMovie, Photo Booth, Any System or iChat Add-On relating to Camera and camera tweaks, Any Software for the Logitech (It should not need to be started up at computer Launch)
    Comic Book if bundled with their Mac.
    Also check this list EZ Jim's Work
    I would also get them to Check the System Profiler and then use the reveal Triangles to see Hardware > USB
    If you have another way to login in to their computer other than iChat Screen Sharing then you could run this in Terminal
    /Applications/iChat.app/Contents/MacOS/iChat -errorLogLevel 7
    With iChat Shut down:-
    Copy and Paste the Bold Text into Terminal and then hit the Enter key.
    This will start iChat and Create Log in Terminal.
    When the Buddy List has finished Loading Quit iChat in the Normal Way.
    Copy the whole Log up to that point and paste it into TextEdit and send it to your self.
    If you read through it, it should list two Cameras:-
    1) the External (Or any Internal iSight for other reading this)
    2) A software one ready for iChat Screen Sharing.
    If the Regular one lists a Count less than 0 (zero) then iChat is having a job reading the Hardware state.
    If this is the case then you could try deleting com.apple.iChat.plist from their Home Folder/Library/Preferences (Just drag it to the Trash)
    iChat will need to be restarted where it will rewrite that .plist after checking the System again.
    NOTE:-
    This does lose all the other settings they have changed from Defaults in the iChat Preferences except the Accounts pane. (Saved Transcripts, Font choices, IM colours etc)
    Are they using their Web Browser to Chat on Flash Based or the Google Mail Web Chat page ?
    If that Tab or Window is still open (if they are still in a "Room") the camera will be "held" by the web Browser.
    If they do use this method and it is Flash check they have not ticked the "Remember" button to Allow access each time they use that Chat site (I am not sure if the Google Chat Plug-in has a similar "Allow" Pop Up).
    FaceTime for the Mac (The Beta) can in fact use the camera at the same time as iChat. It does not seem to matter which application is launched first.
    Resetting the SMC on the Mac Mini is not invasive
    Resetting the SMC for Mac Pro, Intel-based iMac, Intel-based Mac mini, or Intel-based Xserve
    1. Shut down the computer.
    2. Unplug the computer's power cord.
    3. Press and hold the power button for 5 seconds.
    4. Release the power button.
    5. Attach the computers power cable.
    6. Press the power button to turn on the computer.
    See the third Expandable link in this Article (Near the bottom)
    In most cases it can be just that the System has flagged somewhere that it thinks the camera is in use when in fact nothing is.
    A PRAM reset may sort it but the SMC reset is more certain.
    A PRAM reset.
    Shut down the computer.
    Restart it holding down Apple/CMD (or ⌘)+ALT PR Keys until you have heard three Start Up Bongs.
    Hope this helps.
    8:40 PM Wednesday; January 26, 2011
    Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"

  • How do I launch a program on a specific desktop?

    Hello,
    I am running a MacBook Pro and would like to be specific which desktop certain programs are opened within?  How do I do that?  When I have the desktop open that I want and launch the program, it switches me to another one.  Why you ask is this important?  I also run Bootcamp because my ridiculous accounting software is not Mac supported and I need Excel to open next to that software.
    I have accomplished this once before, but haven't been able to do it since.
    Thanks for your help.
    S

    Just found out that is I use Control button, I can tell it to assign "None" on the desktop.  Yeah me! for finding it.

  • How to find the value of a variable in other program

    How to find the value of a variable in other program say I am in a FM and this FM is being called in from other program and I want to know some of the variable details of the program from the FM itself. Imagine if this is a txn. and I need to know the details from some of the programs while executing the same transaction
    Regards
    Vin

    Hi Vinayak,
         you will be having your first program values in internal table or some variables,
        when you are calling the second program you wii use like this,
        SUBMIT <Second Program Name> USING SELECTION-SCREEN '1000'
                           WITH s_emp(second program select-options)   IN t_emp(first program variables)
                           WITH p_chk   EQ t_chk
                           WITH p_r1    EQ t_r1
                           WITH p_month EQ t_month
                           WITH s_cust1 IN t_cust1
                           WITH p_r2    EQ t_r2
                           WITH s_cust2 IN t_cust2
                           WITH s_week  IN t_week
                           AND RETURN.
    you have pas like this to get your first program details.

  • I can't forcequit firefox and shutdown my computer, nor can I open up any other programs or applications. Does anyone know how to fix this? please help this poor soul.

    I can't forcequit firefox and shutdown my computer, nor can I open up any other programs or applications. Does anyone know how to fix this? please help this poor soul.

    You can force quit applications
    >Force quit
    if that does not work you can force quit a computer shut down by hold the power button for an extended period.

  • How to capture graphical outputs from other programs

    Does anyone know how we capture the graphical outputs from the other programs and show them
    on the swing?
    I'd like to use a java program to run gnuplot, capture the outputs, and show them using swing.

    Depends on what you mean by "graphic outputs".
    Taking a quick glance at the gnuplot homepage, it looks as if you can output to PNG files, so just run the app, and load the png file.

  • I've downloaded CS6 Master Collection but only see The Photoshop icon.  I can't seem to find the other programs, except on "uninstall programs" How do I open and run the others?

    I've downloaded CS6 Master Collection but only see The Photoshop icon.  I can't seem to find the other programs, except on "uninstall programs" How do I open and run the others?

    How about you give us some real information.
    Did you install the software? What operating system?

Maybe you are looking for

  • Cannot install apps on my bb

    I cannot install several apps on my bb 9360 (Vodafone Ro) - qik, shazam, eagleeye, etc. For all of these i get the error message The Item is not available for your Device Model, Device OS, Carrier and Country combination. Pls advise.

  • Digital media card reader

    hi  when i using digital media crad ,it says very slow response and called not not responding and after 2-3 min its ok  and i if i try to move another picture it say the same . i m very fed up to hp pavillion g6 1159 laptop  ,  pls tell me if any sol

  • Hyperion upgrade from 9.3.1 to 11.1.2

    Hi , We are in process of upgarding Hyperion Systeme 9.3.1 version to Latest version 11.1.2 . Please let me know what will be the steps involved in upgarde of the System 9 .We have around 3 planning applications and 4 standalone cubes. Kindly clarify

  • System does not change at IE4N Transcation from  C1 to C2

    Experts, While using IE4N Transaction I am changing valuation cat Batch from C2 to during dismantling process, system takes bydefault as Batch C1 for dismantle & posting to stores. Thanks Ramesh

  • Any way to enable "display_errors" (PHP) on a page-by-page basis?

    I have just discovered that my host sets 'display_errors' OFF by default. I have asked them not to do this, but in the meantime, is there any way I can enable this on the specific page? Murray --- ICQ 71997575 Adobe Community Expert (If you *MUST* em