Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

57 lines
1.5 KiB

  1. //---------------------------------------------------------------------------
  2. //
  3. //---------------------------------------------------------------------------
  4. #include "regedt32.h"
  5. // stolen from the CRT, used to shirink our code
  6. int _stdcall ModuleEntry(void)
  7. {
  8. STARTUPINFO si;
  9. LPSTR pszCmdLine = GetCommandLine();
  10. if ( *pszCmdLine == '\"' ) {
  11. /*
  12. * Scan, and skip over, subsequent characters until
  13. * another double-quote or a null is encountered.
  14. */
  15. while ( *++pszCmdLine && (*pszCmdLine
  16. != '\"') );
  17. /*
  18. * If we stopped on a double-quote (usual case), skip
  19. * over it.
  20. */
  21. if ( *pszCmdLine == '\"' )
  22. pszCmdLine++;
  23. }
  24. else {
  25. while (*pszCmdLine > ' ')
  26. pszCmdLine++;
  27. }
  28. /*
  29. * Skip past any white space preceeding the second token.
  30. */
  31. while (*pszCmdLine && (*pszCmdLine <= ' ')) {
  32. pszCmdLine++;
  33. }
  34. si.dwFlags = 0;
  35. GetStartupInfoA(&si);
  36. return WinMain(GetModuleHandle(NULL), NULL, pszCmdLine,
  37. si.dwFlags & STARTF_USESHOWWINDOW ? si.wShowWindow : SW_SHOWDEFAULT);
  38. }
  39. const char szFile[] = "regedit.exe";
  40. //---------------------------------------------------------------------------
  41. int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
  42. {
  43. ShellExecute(HWND_DESKTOP, NULL, szFile, lpCmdLine, NULL, nCmdShow);
  44. ExitProcess(0);
  45. return 0;
  46. }