home *** CD-ROM | disk | FTP | other *** search
- EXTPROC CEnvi
- //*** Adsound.cmd - access After Dark sound from Wipeout
- //***
- //*** I thought you might be interested in what I've been doing with your product.
- //*** The following program automates a process with Bocasoft's WipeOut program
- //*** while using it's After Dark server. I wanted to be able to toggle the After
- //*** Dark sound easily, instead of going through the number of screens required.
- //*** Following is my solution.
- //***
- //*** You'll notice I took sections of sample program you created and made them
- //*** subroutines within this program.
- //***
- //*** I had to employ a trick because when I select the After Dark options button,
- //*** a subwindow is made active and the keystoke that brought up the window
- //*** freezes the program until the subwindow disappears. This explains the
- //*** spawn command and the second routine used when spawned.
- //***
- //*** The use of VK_HOME and the VK_END, VK_UP sequence is to set the screen saver
- //*** to After Dark and to then reset the screen saver back to Random.
- //***
- //*** Because of how the WipeOut and After Dark server interact, once the program
- //*** finishes, all thats left is the MS Windows Sound Setup, where I can toggle
- //*** the sound.
- //***
- //*** no problem with you adding my sample program to your library. Note that the
- //*** program assumes that the After Dark entry is at the beginning of the list
- //*** (uses the HOME key) and the Random entry I go back to is towards the bottom
- //*** of the list (uses the END key and some UP-ARROW keys to get back there).
- //*** This might change for other users.
- //***
- //*** Thank you, Edward Reddy, for contributing AdSound.cmd
-
-
-
- /* needed by winset and keypush */
- #include <PMdll.lib>
- #include <WinTools.lib>
- /* needed by keypush */
- #include <KeyPush.lib>
-
- /* exist params */
- #define FOUND 0
- #define NOT_FOUND 1
- /* end of exist params */
-
- main(argc,argv)
- {
- if (argc==1)
- {
- ShowWindow("BocaSoft WipeOut",SW_RESTORENOACTIVE);
- thiswindow = make_active_window("BocaSoft WipeOut");
- spawn(P_NOWAIT,"ADSOUND.CMD SUBWINDOW");
- Keystroke(VK_HOME,VK_ALT,'O');
- /* pause occurs here where subwindow locks Wipeout window */
- /* must reset active window after pause */
- thiswindow_temp = make_active_window("BocaSoft WipeOut");
- Keystroke(VK_END,VK_UP,VK_UP,VK_UP,VK_UP,VK_UP);
- restore_active_window(thiswindow);
- ShowWindow("BocaSoft WipeOut",SW_MINIMIZE);
- }
-
- if (argc==2 && !stricmp(argv[1],"SUBWINDOW"))
- {
- thiswindow = make_active_window("AD Settings");
- Keystroke(VK_ALT,'S');
- /* pause occurs here while Windows dialog occurs */
- Keystroke(VK_ALT,'O');
- }
- }
-
- /* use with keypush functions */
- make_active_window(title)
- {
-
- // save the currently active window to be restored
- RememberActiveWindow = GetActiveWindow();
-
- // Set the active window to First argument
- if (!SetActiveWindow(title) )
- {
- printf("Unrecognized Window Title \"%s\"\n\a",title);
- exit(EXIT_FAILURE);
- }
- return (RememberActiveWindow);
- }
-
- restore_active_window(RememberActiveWindow)
- {
- // Restore currently active window
- SetActiveWindow(RememberActiveWindow);
-
- }
- /* end of keypush functions */
-