Index: /trunk/src/VBox/Frontends/VirtualBox/src/main.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/main.cpp	(revision 73190)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/main.cpp	(revision 73191)
@@ -271,55 +271,130 @@
 static void ShowHelp()
 {
-    RTPrintf(VBOX_PRODUCT " Manager %s\n"
-            "(C) 2005-" VBOX_C_YEAR " " VBOX_VENDOR "\n"
-            "All rights reserved.\n"
-            "\n"
-            "Usage:\n"
-            "  --startvm <vmname|UUID>    start a VM by specifying its UUID or name\n"
-            "  --separate                 start a separate VM process\n"
-            "  --normal                   keep normal (windowed) mode during startup\n"
-            "  --fullscreen               switch to fullscreen mode during startup\n"
-            "  --seamless                 switch to seamless mode during startup\n"
-            "  --scale                    switch to scale mode during startup\n"
-            "  --no-startvm-errormsgbox   do not show a message box for VM start errors\n"
-            "  --restore-current          restore the current snapshot before starting\n"
-            "  --no-aggressive-caching    delays caching media info in VM processes\n"
-            "  --fda <image|none>         Mount the specified floppy image\n"
-            "  --dvd <image|none>         Mount the specified DVD image\n"
+#if !defined(VBOX_GUI_WITH_SHARED_LIBRARY) || !defined(VBOX_RUNTIME_UI)
+    static const char s_szTitle[] = VBOX_PRODUCT " VM Selector";
+#else
+    static const char s_szTitle[] = VBOX_PRODUCT " VM Runner";
+#endif
+    static const char s_szUsage[] =
+#if !defined(VBOX_GUI_WITH_SHARED_LIBRARY) || defined(VBOX_RUNTIME_UI)
+        "Options:\n"
+        "  --startvm <vmname|UUID>    start a VM by specifying its UUID or name\n"
+        "  --separate                 start a separate VM process\n"
+        "  --normal                   keep normal (windowed) mode during startup\n"
+        "  --fullscreen               switch to fullscreen mode during startup\n"
+        "  --seamless                 switch to seamless mode during startup\n"
+        "  --scale                    switch to scale mode during startup\n"
+        "  --no-startvm-errormsgbox   do not show a message box for VM start errors\n"
+        "  --restore-current          restore the current snapshot before starting\n"
+        "  --no-aggressive-caching    delays caching media info in VM processes\n"
+        "  --fda <image|none>         Mount the specified floppy image\n"
+        "  --dvd <image|none>         Mount the specified DVD image\n"
 # ifdef VBOX_GUI_WITH_PIDFILE
-            "  --pidfile <file>           create a pidfile file when a VM is up and running\n"
+        "  --pidfile <file>           create a pidfile file when a VM is up and running\n"
 # endif /* VBOX_GUI_WITH_PIDFILE */
 # ifdef VBOX_WITH_DEBUGGER_GUI
-            "  --dbg                      enable the GUI debug menu\n"
-            "  --debug                    like --dbg and show debug windows at VM startup\n"
-            "  --debug-command-line       like --dbg and show command line window at VM startup\n"
-            "  --debug-statistics         like --dbg and show statistics window at VM startup\n"
-            "  --no-debug                 disable the GUI debug menu and debug windows\n"
-            "  --start-paused             start the VM in the paused state\n"
-            "  --start-running            start the VM running (for overriding --debug*)\n"
-            "\n"
+        "  --dbg                      enable the GUI debug menu\n"
+        "  --debug                    like --dbg and show debug windows at VM startup\n"
+        "  --debug-command-line       like --dbg and show command line window at VM startup\n"
+        "  --debug-statistics         like --dbg and show statistics window at VM startup\n"
+        "  --no-debug                 disable the GUI debug menu and debug windows\n"
+        "  --start-paused             start the VM in the paused state\n"
+        "  --start-running            start the VM running (for overriding --debug*)\n"
 # endif /* VBOX_WITH_DEBUGGER_GUI */
-            "Expert options:\n"
-            "  --disable-patm             disable code patching (ignored by AMD-V/VT-x)\n"
-            "  --disable-csam             disable code scanning (ignored by AMD-V/VT-x)\n"
-            "  --recompile-supervisor     recompiled execution of supervisor code (*)\n"
-            "  --recompile-user           recompiled execution of user code (*)\n"
-            "  --recompile-all            recompiled execution of all code, with disabled\n"
-            "                             code patching and scanning\n"
-            "  --execute-all-in-iem       For debugging the interpreted execution mode.\n"
-            "  --warp-pct <pct>           time warp factor, 100%% (= 1.0) = normal speed\n"
-            "  (*) For AMD-V/VT-x setups the effect is --recompile-all.\n"
-            "\n"
+        "\n"
+        "Expert options:\n"
+        "  --disable-patm             disable code patching (ignored by AMD-V/VT-x)\n"
+        "  --disable-csam             disable code scanning (ignored by AMD-V/VT-x)\n"
+        "  --recompile-supervisor     recompiled execution of supervisor code (*)\n"
+        "  --recompile-user           recompiled execution of user code (*)\n"
+        "  --recompile-all            recompiled execution of all code, with disabled\n"
+        "                             code patching and scanning\n"
+        "  --execute-all-in-iem       For debugging the interpreted execution mode.\n"
+        "  --warp-pct <pct>           time warp factor, 100%% (= 1.0) = normal speed\n"
+        "  (*) For AMD-V/VT-x setups the effect is --recompile-all.\n"
+        "\n"
 # ifdef VBOX_WITH_DEBUGGER_GUI
-            "The following environment (and extra data) variables are evaluated:\n"
-            "  VBOX_GUI_DBG_ENABLED (GUI/Dbg/Enabled)\n"
-            "                             enable the GUI debug menu if set\n"
-            "  VBOX_GUI_DBG_AUTO_SHOW (GUI/Dbg/AutoShow)\n"
-            "                             show debug windows at VM startup\n"
-            "  VBOX_GUI_NO_DEBUGGER       disable the GUI debug menu and debug windows\n"
+        "The following environment (and extra data) variables are evaluated:\n"
+        "  VBOX_GUI_DBG_ENABLED (GUI/Dbg/Enabled)\n"
+        "                             enable the GUI debug menu if set\n"
+        "  VBOX_GUI_DBG_AUTO_SHOW (GUI/Dbg/AutoShow)\n"
+        "                             show debug windows at VM startup\n"
+        "  VBOX_GUI_NO_DEBUGGER\n"
+        "                             disable the GUI debug menu and debug windows\n"
 # endif /* VBOX_WITH_DEBUGGER_GUI */
-            "\n",
-            RTBldCfgVersion());
-    /** @todo Show this as a dialog on windows. */
+#else
+        "No special options.\n"
+        "\n"
+        "If you are looking for --startvm and related options, you need to use VirtualBoxVM.\n"
+#endif
+        ;
+
+    RTPrintf("%s v%s\n"
+             "(C) 2005-" VBOX_C_YEAR " " VBOX_VENDOR "\n"
+             "All rights reserved.\n"
+             "\n"
+             "%s",
+             s_szTitle, RTBldCfgVersion(), s_szUsage);
+
+#ifdef RT_OS_WINDOWS
+    /*
+     * Show message box.  We modify the option list a little to better
+     * make it fit in the dialog.
+     */
+    char        szTitleWithVersion[sizeof(s_szTitle) + 128];
+    char        szMsg[sizeof(s_szUsage) + 128];
+    char       *pszDst = szMsg;
+    size_t      offSrc = 0;
+    while (offSrc < sizeof(s_szUsage) - 1U)
+    {
+        char ch;
+        if (   s_szUsage[offSrc]     == ' '
+            && s_szUsage[offSrc + 1] == ' '
+            && (   (ch = s_szUsage[offSrc + 2]) == '-' /* option line */
+                || ch == 'V' /* env.var. line*/ ) )
+        {
+            /* Split option lines: */
+            if (ch == '-')
+            {
+                offSrc += 2;
+                size_t cchOption = 0;
+                while (   s_szUsage[offSrc + cchOption] != ' '
+                       || s_szUsage[offSrc + cchOption + 1] != ' ')
+                    cchOption++;
+
+                memcpy(pszDst, &s_szUsage[offSrc], cchOption);
+                offSrc   += cchOption + 2;
+                pszDst   += cchOption;
+            }
+            /* Change environment variable indentation: */
+            else
+            {
+                offSrc += 2;
+                size_t cchLine = 0;
+                while ((ch = s_szUsage[offSrc + cchLine]) != '\n' && ch != '\0')
+                    cchLine++;
+
+                memcpy(pszDst, &s_szUsage[offSrc], cchLine);
+                offSrc += cchLine + 1;
+                pszDst += cchLine;
+            }
+            *pszDst++ = '\n';
+            *pszDst++ = '\t';
+
+            while (s_szUsage[offSrc] == ' ')
+                offSrc++;
+        }
+
+        /* Copy up to and including end of line. */
+        while ((ch = s_szUsage[offSrc++]) != '\n' && ch != '\0')
+            *pszDst++ = ch;
+        *pszDst++ = ch;
+    }
+    *pszDst = '\0';
+
+    RTStrPrintf(szTitleWithVersion, sizeof(szTitleWithVersion), "%s v%s - Command Line Options", s_szTitle, RTBldCfgVersion());
+    MessageBoxExA(NULL /*hwndOwner*/, szMsg, szTitleWithVersion, MB_OK | MB_ICONINFORMATION,
+                  MAKELANGID(LANG_NEUTRAL, SUBLANG_NEUTRAL));
+#endif
 }
 
@@ -469,5 +544,5 @@
 #else
 # ifndef VBOX_RUNTIME_UI
-        /* Create global app instance for Selecotr UI: */
+        /* Create global app instance for Selector UI: */
         VBoxGlobal::create(VBoxGlobal::UIType_SelectorUI);
 # else
