Link to home
Start Free TrialLog in
Avatar of mwcmp
mwcmp

asked on

open a software from the my application

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?
Avatar of Nass89
Nass89
Flag of United States of America image

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!
Avatar of mwcmp
mwcmp

ASKER

>>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.
ASKER CERTIFIED SOLUTION
Avatar of Jaime Olivares
Jaime Olivares
Flag of Peru image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mwcmp

ASKER

info.lpDirectory = _T("\\Program Files\\Veo Travler\\Veo\\");    
info.lpFile = _T("VeoTravler.exe");  

Where did I go wrong?
try to remove the last \\ fro directory
Avatar of mwcmp

ASKER

Yes. Tried.

I suppose the directory goes that way? Or did I miss anything else at the beginning?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mwcmp

ASKER

Thanks. It works. :)