Win32 application with out an UI.
-
Hi, I want a simple application which will only launch another application. But I dont want to show the cosole or any UI for the 1st application. can any one help me how to do so.
birajendu CyberG India Delhi India
Why do you need such a thing? Why can't the 'another application' be launched directly instead? There are valid reasons, but I want to know what's your case.
It is a crappy thing, but it's life -^ Carlo Pallini
-
Why do you need such a thing? Why can't the 'another application' be launched directly instead? There are valid reasons, but I want to know what's your case.
It is a crappy thing, but it's life -^ Carlo Pallini
-
Hi, I want a simple application which will only launch another application. But I dont want to show the cosole or any UI for the 1st application. can any one help me how to do so.
birajendu CyberG India Delhi India
-
I am lunching the 2nd application with some specific command line options, that is why i need this 1st appliaction.
birajendu CyberG India Delhi India
I'm just curious before I can give you an answer, why can you not just launch the second application with command lines already? Why the extra 'launcher' application?
It is a crappy thing, but it's life -^ Carlo Pallini
-
I'm just curious before I can give you an answer, why can you not just launch the second application with command lines already? Why the extra 'launcher' application?
It is a crappy thing, but it's life -^ Carlo Pallini
-
Hi, I want a simple application which will only launch another application. But I dont want to show the cosole or any UI for the 1st application. can any one help me how to do so.
birajendu CyberG India Delhi India
Something like this maybe:
#include <windows.h>
#include <shellapi.h>int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
SHELLEXECUTEINFO ShExecInfo;
ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
ShExecInfo.fMask = NULL;
ShExecInfo.hwnd = NULL;
ShExecInfo.lpVerb = NULL;
ShExecInfo.lpFile = "program.exe";
ShExecInfo.lpParameters = "-switch1 -switch2";
ShExecInfo.lpDirectory = "c:\\yourpath";
ShExecInfo.nShow = SW_HIDE;
ShExecInfo.hInstApp = NULL;ShellExecuteEx(&ShExecInfo);
return 0;
} -
The end user has the requiremet like that. he want to launch the application with a icon click on desktop..... :)
birajendu CyberG India Delhi India
-
The end user has the requiremet like that. he want to launch the application with a icon click on desktop..... :)
birajendu CyberG India Delhi India
You could do something like this:
#include <windows.h>
#include <tchar.h>int APIENTRY _tWinMain(HINSTANCE hInstance, HINSTANCE hPrevInst, LPTSTR lpCmdLine, int nCmdShow)
{
CreateProcess[^]
return false;
}You might as well use
ShellExecute
orShellExecuteEx
, like Michael Schubert suggested.It is a crappy thing, but it's life -^ Carlo Pallini
-
Something like this maybe:
#include <windows.h>
#include <shellapi.h>int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
SHELLEXECUTEINFO ShExecInfo;
ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
ShExecInfo.fMask = NULL;
ShExecInfo.hwnd = NULL;
ShExecInfo.lpVerb = NULL;
ShExecInfo.lpFile = "program.exe";
ShExecInfo.lpParameters = "-switch1 -switch2";
ShExecInfo.lpDirectory = "c:\\yourpath";
ShExecInfo.nShow = SW_HIDE;
ShExecInfo.hInstApp = NULL;ShellExecuteEx(&ShExecInfo);
return 0;
} -
Thanks, I tried this and also CreateProcess(), but my problem is i dont want the console window of the parent application. I am creating a win 32 project in visual studio 2005.
birajendu CyberG India Delhi India
The code I supplied (same for Rajesh's suggestion) doesn't create any window, neither console nor GUI.
-
Thanks, I tried this and also CreateProcess(), but my problem is i dont want the console window of the parent application. I am creating a win 32 project in visual studio 2005.
birajendu CyberG India Delhi India
I don't see how can you see a window when the code creates none... You have probably created a Win32 console application. You need to create a Win32 application instead.
It is a crappy thing, but it's life -^ Carlo Pallini
-
The end user has the requiremet like that. he want to launch the application with a icon click on desktop..... :)
birajendu CyberG India Delhi India
So why not just change the shortcut to include the necessary arguments?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons