Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

open a software from the my application

Posted on 2004-08-28
8
Medium Priority
?
205 Views
Last Modified: 2013-11-20
Is there a way to open another software that is installed into my pocket pc, not by clicking on the software itself, but through my codes?
0
Comment
Question by:mwcmp
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
8 Comments
 
LVL 5

Expert Comment

by:Nass89
ID: 11925002
Hi,

CreateProcess(
LPCWSTR lpszImageName,
LPCWSTR lpszCmdLine,
LPSECURITY_ATTRIBUTES lpsaProcess,
LPSECURITY_ATTRIBUTES lpsaThread,
BOOL fInheritHandles,
DWORD fdwCreate,
LPVOID lpvEnvironment,
LPWSTR lpszCurDir,
LPSTARTUPINFOW lpsiStartInfo,
LPPROCESS_INFORMATION lppiProcInfo);

It runs under Windows ce.

Example:

STARTUPINFO si = { sizeof(STARTUPINFO) };
PROCESS_INFORMATION pi = {0};
BOOL bSuccess;

bSuccess = CreateProcess ( NULL, "C:\\Program Files\\Internet xplorer\\IEXPLORE.exe ", NULL, NULL, FALSE, NORMAL_PRIORITY_CLASS,
NULL, NULL, &si, &pi );
//TerminateProcess to close the application

if(bSuccess){
TerminateProcess(pi.hProcess ,1);
CloseHandle ( pi.hThread );
CloseHandle ( pi.hProcess );

Good Luck!
0
 

Author Comment

by:mwcmp
ID: 11925322
>>NORMAL_PRIORITY_CLASS
Can't seems to be suppported, so I change it to 0

The other application is unable to be open. I also realised that whne my applicationn runs, it failed to enter the if(bSuccess) loop.
0
 
LVL 55

Accepted Solution

by:
Jaime Olivares earned 2000 total points
ID: 11925943
You can use ShellExecuteEx:

            SHELLEXECUTEINFO info;
            info.cbSize = sizeof(info);
            info.dwHotKey = 0;
            info.fMask = SEE_MASK_NOCLOSEPROCESS;
            info.hIcon = 0;
            info.hkeyClass = 0;
            info.hwnd = 0;
            info.lpClass = NULL;
            info.lpDirectory = "\adirectory";    <------- give correct directory here
            info.lpFile = "app.exe";     <------- give correct application name or doc's filename here
            info.lpIDList = NULL;
            info.lpParameters = NULL;
            info.lpVerb = TEXT("open");
            info.nShow = SW_SHOW;
            ShellExecuteEx(&info);
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:mwcmp
ID: 11926082
info.lpDirectory = _T("\\Program Files\\Veo Travler\\Veo\\");    
info.lpFile = _T("VeoTravler.exe");  

Where did I go wrong?
0
 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 11926101
try to remove the last \\ fro directory
0
 

Author Comment

by:mwcmp
ID: 11926142
Yes. Tried.

I suppose the directory goes that way? Or did I miss anything else at the beginning?
0
 
LVL 55

Assisted Solution

by:Jaime Olivares
Jaime Olivares earned 2000 total points
ID: 11926218
Make a test with this variant:
info.lpFile = TEXT("\\Windows\\PWord.exe");
info.lpDirectory = NULL;
0
 

Author Comment

by:mwcmp
ID: 11926315
Thanks. It works. :)
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …

618 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question