|
yes, this is console application
|
|
|
|
|
In that case, the solution that I gave using CreateProcess will work.
|
|
|
|
|
yes I tired but same result as ShellExecute. 
|
|
|
|
|
I tried this again and it works perfectly.
wchar_t szCommand[] = L"C:\\Windows\\System32\\Cmd.exe";
STARTUPINFO si;
::ZeroMemory(&si, sizeof(STARTUPINFO));
si.cb = sizeof(STARTUPINFO);
si.dwFlags = STARTF_USESHOWWINDOW;
si.wShowWindow = SW_HIDE;
PROCESS_INFORMATION pi;
::CreateProcess(0, szCommand, 0, 0, 0, 0, 0, 0, &si, &pi);
|
|
|
|
|
yes this will hide the command prompt but what about the other application which will launch through command prompt.
wchar_t szCommand[] = L"-m -l";
STARTUPINFO si;
::ZeroMemory(&si, sizeof(STARTUPINFO));
si.cb = sizeof(STARTUPINFO);
si.dwFlags = STARTF_USESHOWWINDOW;
si.wShowWindow = SW_HIDE;
PROCESS_INFORMATION pi;
::CreateProcess(_T("myapp.exe"), szCommand, 0, 0, 0, 0, 0, 0, &si, &pi);
|
|
|
|
|
JM2251 wrote: yes this will hide the command prompt but what about the other application which will launch through command prompt.
You're correct: Cmd is hidden but the app it's executing not. Some solutions:
- create a shortcut to the exe and run that one. In the shortcut you can set options to hide it.
- If it is a console app you could route the display output to a NULL device (example:
Dir > null). See createprocess options.
Hope this helps
|
|
|
|
|
What type of exe you are using...?
|
|
|
|
|
|
First try with SW_SHOWNORMAL mode. if it is working fine then try with SW_HIDE. If it is also not working then check the exe path and command line arguments.
Is it running in normal mode when you using SW_HIDE argument...?
|
|
|
|
|
how can i typecast LPSTR to DWORD_PTR?
DWORD_PTR nBmpID = GetItemData(hTSelItem);
LPSTR lpNodeData = (LPSTR)GlobalLock(hgNodeData);
((DWORD_PTR)lpNodeData) = nBmpID;
shows error
error C2106: '=' : left operand must be l-value
|
|
|
|
|
What's a hTSelItem and what's a hgNodeData ? And what's the point in typecasting something that's on the left side of the assignment operator?
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
RakeshManohar wrote: ((DWORD_PTR)lpNodeData) = nBmpID;
change to
lpNodeData =(LPSTR) nBmpID;
|
|
|
|
|
Thanks.. this the right way.
|
|
|
|
|
What a mess. What are you trying to do?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
That's the same exact thought what occurred to me. Which is why I asked the OP a few questions hoping that I could help him, but some other helpful soul has answered the query.
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
It's the semantic problem the trouble, Watson, the semantic, my dear, not the syntatic one!
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi All,
I want to display a message to the user at the time of locking the machine.
The message is to warn the user saying "Before you lock, please check your POWER settings." .
Is there any way to do this ?
Thanks,Appu..
"Never explain yourself to anyone.
Because the person who likes you does n't need it.
And the person who dislikes you won't believe it."
|
|
|
|
|
|
Thanks ... will check that.. Appu..
"Never explain yourself to anyone.
Because the person who likes you does n't need it.
And the person who dislikes you won't believe it."
|
|
|
|
|
I don't think a keyboard hook can be of help here.
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
Yes..it is not helping me.. Appu..
"Never explain yourself to anyone.
Because the person who likes you does n't need it.
And the person who dislikes you won't believe it."
|
|
|
|
|
class CAdd
{
public:
CAdd(){};
~CAdd(){};
void Display( ){ }
};
CAdd pObj = NULL;
pObj->Display();
Here pObj is set to NULL but call to Display() succeed how?
|
|
|
|
|
Debug or Release version? If Release, the compiler may have been smart enough to see the function didn't do anything and optimized the whole call away. You measure democracy by the freedom it gives its dissidents, not the freedom it gives its assimilated conformists.
|
|
|
|
|
In executes debug as well as in release mode.
Even if write some statements in Display() function it will execute.Its not because of empty function.
|
|
|
|
|
CAdd *pObj = NULL;
pObj->Display();
Call will be succeeded as long as none of the member variables of CAdd is referred in Display(). When pgm loads, a class will be having only one copy of all its member functions for all class variables we create, but will be having its own copy of member variables for each class variables. So members variables will be allocated only when an instance of class is created but there will be already a copy of all member functions even if no instance of class is created. Hope you understood how the calls to Display is succeeded above.
|
|
|
|