Can any one tell me how to launch a windows .hlp file from within an allegro program? Specifically what function calls I need to make and what #include is that function in. Also helpfull would be how to flip to a specific page in that help file.
system("start helpfile.hlp"); ?
Thanks BAF that was what I was looking for. You have been a lot more helpfull than google and msdn on this topic. By the way do you know how to make it open on a specific page of that help file?
There are more "friendly" ways, like using the Windows API (they may have specific help stuff, as well) like CreateProcess or whatever, but system will work just fine in most cases.
Since I am not too knowlagable in the windows API or even this magical "system" command. I was wondering if I could append any arguments to the string to get the help file to open to a specific page.
I am not too knowlagable in ... this magical "system" command
They system() function will execute any command you can in the dos-prompt.
It's like you're actually typing the command into the prompt.
To go directly to a certain page in a help file, I don't know if that can be done.
Here is what you can do with the start command though
| 1 | Starts a separate window to run a specified program or command. |
| 2 | |
| 3 | START ["title"] [/Dpath] [/I] [/MIN] [/MAX] [/SEPARATE | /SHARED] |
| 4 | [/LOW | /NORMAL | /HIGH | /REALTIME | /ABOVENORMAL | /BELOWNORMAL] |
| 5 | [/WAIT] [/B] [command/program] |
| 6 | [parameters] |
| 7 | |
| 8 | "title" Title to display in window title bar. |
| 9 | path Starting directory |
| 10 | B Start application without creating a new window. The |
| 11 | application has ^C handling ignored. Unless the application |
| 12 | enables ^C processing, ^Break is the only way to interrupt |
| 13 | the application |
| 14 | I The new environment will be the original environment passed |
| 15 | to the cmd.exe and not the current environment. |
| 16 | MIN Start window minimized |
| 17 | MAX Start window maximized |
| 18 | SEPARATE Start 16-bit Windows program in separate memory space |
| 19 | SHARED Start 16-bit Windows program in shared memory space |
| 20 | LOW Start application in the IDLE priority class |
| 21 | NORMAL Start application in the NORMAL priority class |
| 22 | HIGH Start application in the HIGH priority class |
| 23 | REALTIME Start application in the REALTIME priority class |
| 24 | ABOVENORMAL Start application in the ABOVENORMAL priority class |
| 25 | BELOWNORMAL Start application in the BELOWNORMAL priority class |
| 26 | WAIT Start application and wait for it to terminate |
| 27 | command/program |
| 28 | If it is an internal cmd command or a batch file then |
| 29 | the command processor is run with the /K switch to cmd.exe. |
| 30 | This means that the window will remain after the command |
| 31 | has been run. |
| 32 | |
| 33 | If it is not an internal cmd command or batch file then |
| 34 | it is a program and will run as either a windowed application |
| 35 | or a console application. |
| 36 | |
| 37 | parameters These are the parameters passed to the command/program |
| 38 | |
| 39 | |
| 40 | If Command Extensions are enabled, external command invocation |
| 41 | through the command line or the START command changes as follows: |
| 42 | |
| 43 | non-executable files may be invoked through their file association just |
| 44 | by typing the name of the file as a command. (e.g. WORD.DOC would |
| 45 | launch the application associated with the .DOC file extension). |
| 46 | See the ASSOC and FTYPE commands for how to create these |
| 47 | associations from within a command script. |
| 48 | |
| 49 | When executing an application that is a 32-bit GUI application, CMD.EXE |
| 50 | does not wait for the application to terminate before returning to |
| 51 | the command prompt. This new behavior does NOT occur if executing |
| 52 | within a command script. |
| 53 | |
| 54 | When executing a command line whose first token is the string "CMD " |
| 55 | without an extension or path qualifier, then "CMD" is replaced with |
| 56 | the value of the COMSPEC variable. This prevents picking up CMD.EXE |
| 57 | from the current directory. |
| 58 | |
| 59 | When executing a command line whose first token does NOT contain an |
| 60 | extension, then CMD.EXE uses the value of the PATHEXT |
| 61 | environment variable to determine which extensions to look for |
| 62 | and in what order. The default value for the PATHEXT variable |
| 63 | is: |
| 64 | |
| 65 | .COM;.EXE;.BAT;.CMD |
| 66 | |
| 67 | Notice the syntax is the same as the PATH variable, with |
| 68 | semicolons separating the different elements. |
| 69 | |
| 70 | When searching for an executable, if there is no match on any extension, |
| 71 | then looks to see if the name matches a directory name. If it does, the |
| 72 | START command launches the Explorer on that path. If done from the |
| 73 | command line, it is the equivalent to doing a CD /D to that path. |
Just ShellExecute is more straightforward and pretty damn simple too, y'know.