Solved

open a software from the my application

Posted on 2004-08-28
8
201 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 500 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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 500 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Host to IP 7 84
Smart Camera scanning and reading information 3 126
fizzArray2 challenge 1 110
JQuery serialize and unserialize 8 263
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.

737 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