|
Right
That was the command you could use in CreateProcess()/ShellExecute():
EXPLORER.EXE driveletter:\path
This one also works on XP:
EXPLORER.EXE /n, driveletter:\path
Both open Windows Explorer as a "My Computer"-style window - single pane, no tree.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Thanks very much..
I will try the /n option.
As for the first bit; I am actually running XP and the 'driveletter:\path' does indeed still open explorer with the tree pane, however I will try your second suggestion..thanks for the help.
James.
|
|
|
|
|
Here's another example
::ShellExecute(*this, _T("open"), _T("EXPLORER.EXE"), _T("/n, driveletter:\\path"), NULL, SW_SHOWNORMAL);
although the following is probably better since it's not bound to exporer.exe or specific
command-line arguments:
::ShellExecute(*this, _T("open"), _T("driveletter:\\path"), NULL, NULL, SW_SHOWNORMAL);
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
This did the same thing on XP:
::ShellExecute(hwnd, _T("open"), _T("driveletter:\\path"), NULL, NULL, SW_SHOWNORMAL);
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Thanks Mark.
I Like that one; I will try it .. and get back to you tomorrow..its very late here...
I appreciate your help.
James.
|
|
|
|
|
Mark.
Thanks very much for your help.
It's all sorted now .. many thanks.
James.
|
|
|
|
|
Hi,
I have just installed Vista and of course my old VC++ 6.0 won't work on Vista so I'm finally jumping to Visual Studio 2005.
I can save a few bucks by getting the upgrade version of Visual Studio 2005 but I'm concerned that Vista may want to see VC++ installed on the hard drive. In the past, MS products were satisfied by just seeing the qualifying product CD in the drive but that seems to be changing. This would put me in a pickle since I can't really install VC++ 6.0 (and if I did it may muck up Vista).
Anybody know for sure if the VS 2005 upgrade product will install w/o having my VC++ 6.0 product on the hard drive (ie. just a CD verification)?
Thanks
|
|
|
|
|
VC6 works fine on Vista, here are installation instructions: clickety[^]
|
|
|
|
|
Hope this[^] will help you.
Regards,
Paresh.
|
|
|
|
|
I understand that this question may be overheard here and there are huge amount of articles explaining it but for someone that has not used registry like me and want a very simple task it is only more confusing. I only want to save the directory of program installation in registry during installation and read it at the begining of my MFC program. I searched articles on this site and amount of articles was overwhelming and really confusing, I absolutely do not want to use a prewritten class something that I don't know how it works internally. Are there a simple API or similar function to reterive a key. I also interested in CRegKey from ATL. Can this class solve my problem?
Thanks.
|
|
|
|
|
Electronic75 wrote: Are there a simple API or similar function to reterive a key.
Try RegOpenKeyEx() and RegQueryValueEx() .
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Bingo!
Thanks alot.
|
|
|
|
|
|
How can i get all Interfaces, MACs and IPs on my machine ?
How can i list open TC/UDP ports and services connected to these ?
Thank you very much
|
|
|
|
|
Does this help?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
It is possible to avoid that a program executes from our own application?
An example:
I'm running my app and I don't want to let notepad.exe to execute.
Is this possible?
Thanks in advance.
Dr.Pi
|
|
|
|
|
doctorpi wrote: I'm running my app and I don't want to let notepad.exe to execute.
Just out of curiosity, why?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
i'm not sure to understand well :
doctorpi wrote: It is possible to avoid that a program executes from our own application?
just don't call it !
why would it open otherwise ?
|
|
|
|
|
Can you explain why you dont want?
|
|
|
|
|
The question is that 2 programs are really time consuming exigents.
The point is don't let the user execute both at the same time.
Then , if one is running don't let run the other and viceversa.
Dr.Pi
|
|
|
|
|
hi all,
i m using spamassassin to filter my mails as spam or not, but i m unable to execute spamassassin.exe,it works fine when i call that exe from DOS(command prompt)with same commandline argument, here is the code i m using,
C++
HINSTANCE hins =::ShellExecute(NULL,"open","F:/sa/spamassassin.exe","<F:/spam.txt> F:/spamT.txt",NULL,SW_HIDE); in this situation exe invoke and then disappear without executing as i seen tha through task manager, when i call above line of code behind a button then process increases in task manager and then it decreases, without full execution.
here is the command which i paste on DOS and works fine,
any idea.
C:\Documents and Settings\tasleemarif>F:/sa/spamassassin.exe <F:/spam.txt> F:/spamT.txt"
i have also tried that using C++ spawn functions as well but did not work too. any idea r any person can guide me how had worked on spamassisn.
Regards.
Tasleem Arif
|
|
|
|
|
The code you've shown seems fine. Temporarily change SW_HIDE to SW_SHOW . Does that produce any windows?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
i tried that as well but did no show any window,it did worked with this code,but cannot hide console this time,it pops up
char* cmd = const_cast<char*>("F:/sa/spamassassin.exe <F:/spam.txt> F:/spamT.txt");<br />
system(cmd);<br />
Regards.
Tasleem Arif
|
|
|
|
|
What does this do:
ShellExecute(NULL, _T("open"), _T("c:\\windows\\system32\\notepad.exe"), _T("c:\\boot.ini"), NULL, SW_SHOW);
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
it shows notepad.
Regards.
Tasleem Arif
|
|
|
|