Solved

open a software from the my application

Posted on 2004-08-28
8
195 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
  • 4
  • 3
8 Comments
 
LVL 5

Expert Comment

by:Nass89
Comment Utility
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
Comment Utility
>>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
Comment Utility
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
 

Author Comment

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

Where did I go wrong?
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 55

Expert Comment

by:Jaime Olivares
Comment Utility
try to remove the last \\ fro directory
0
 

Author Comment

by:mwcmp
Comment Utility
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
Comment Utility
Make a test with this variant:
info.lpFile = TEXT("\\Windows\\PWord.exe");
info.lpDirectory = NULL;
0
 

Author Comment

by:mwcmp
Comment Utility
Thanks. It works. :)
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

762 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now