main.c
资源名称:shell.rar [点击查看]
上传用户:xhy777
上传日期:2007-02-14
资源大小:24088k
文件大小:1k
源码类别:
系统编程
开发平台:
Visual C++
- #include "diskcopy.h"
- HINSTANCE g_hinst = NULL;
- int _stdcall WinMainT(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpszCmdLine, int nCmdShow)
- {
- g_hinst = hInstance;
- SHCopyDisk(NULL, -1, -1, 0);
- return TRUE;
- }
- // stolen from the CRT, used to shirink our code
- int _stdcall ModuleEntry(void)
- {
- int i;
- STARTUPINFO si;
- LPTSTR pszCmdLine = GetCommandLine();
- if ( *pszCmdLine == TEXT('"') ) {
- /*
- * Scan, and skip over, subsequent characters until
- * another double-quote or a null is encountered.
- */
- while ( *++pszCmdLine && (*pszCmdLine
- != TEXT('"')) );
- /*
- * If we stopped on a double-quote (usual case), skip
- * over it.
- */
- if ( *pszCmdLine == TEXT('"') )
- pszCmdLine++;
- }
- else {
- while (*pszCmdLine > TEXT(' '))
- pszCmdLine++;
- }
- /*
- * Skip past any white space preceeding the second token.
- */
- while (*pszCmdLine && (*pszCmdLine <= TEXT(' '))) {
- pszCmdLine++;
- }
- si.dwFlags = 0;
- GetStartupInfoA(&si);
- i = WinMainT(GetModuleHandle(NULL), NULL, pszCmdLine,
- si.dwFlags & STARTF_USESHOWWINDOW ? si.wShowWindow : SW_SHOWDEFAULT);
- ExitProcess(i);
- }
English
