|
-
Mar 15th, 2002, 08:57 AM
#1
You either can create a console application and write a main function, or create a GUI function and write a WinMain function. If you don't want anything to appear you write a GUI app, a WinMain, include <windows.h> but don't create a window, just use the ShellExecute.
Actually, you don't need any include at all:
Code:
extern "C" void* ShellExecuteA(void*, const char* szOp, const char*szFile, const char* szParams, const char* szDirectory, int iShowCmd);
int WinMain(void* hInst, void*, char* szParams, int iShowCmd)
{
int iErr = (int)ShellExecuteA( // the HINSTANCE return is for compatibility only
0, 0, // no parent and no op (= open)
"drive:\\path1\\path2\\filename.ext", // the file to open
szParams, // just pass our own params
"drive:\\path1\\path2", // default path is execution directory
iShowCmd); // show the same way this was intended to be shown
}
And you only need one import libraray, I think it's SHLWAPI.LIB.
Then you have a valid app.
Of course this is not recommended.
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|