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
Solved

open a software from the my application

Posted on 2004-08-28
8
199 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
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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

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: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone 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
iSeries DB2 Query 2 97
bigDiff challenge 17 124
no14 challenge 14 70
matchUp  challenge 9 115
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…
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 a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

839 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