SAMPLE: Joystick.exe Calls the Joystick API FunctionsLast reviewed: February 20, 1998Article ID: Q181478 |
The information in this article applies to:
SUMMARYJoystick.exe is a self-extracting compressed file containing a sample project that demonstrates how to use the Joystick API functions in Visual Basic. You can use this sample as a starting point for a game program that uses a joystick for an input device.
MORE INFORMATIONThe following file is available for download from the Microsoft Software Library:
~ Joystick.exe (size: 27399 bytes)For more information about downloading files from the Microsoft Software Library, please see the following article in the Microsoft Knowledge Base:
ARTICLE-ID: Q119591 TITLE : How to Obtain Microsoft Support Files from Online ServicesWhen you run the self-extracting compressed file, the following files are expanded in the Joystick Sample Project directory:
How the Sample WorksThe joyGetDevCaps function is used in the form load event to determine if a joystick is connected to the system. If the function is successful, the form is redrawn with new controls to display the capabilities of the joystick. These capabilities are stored in the members of the JOYCAPS user- defined type variable. A timer control is used to poll the joystick's position. The current position is determined by the successful results of the joyGetPosEx function. The members of the JOYINFOEX user-defined variable type contain the joystick position information. This information is displayed in text boxes in the form. Keywords : vb5win VBKBWinAPI kbsample Version : WINDOWS:5.0 Platform : WINDOWS Solution Type : kbfile |
================================================================================
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |