Microsoft DirectX 8.1 (Visual Basic)

Step 5: Closing Down the DirectInput System

When an application is about to close, it should release all Microsoft—> DirectInput—> devices. This is done using the DirectInputDevice8.Unacquire method, generally in the Unload event handler as shown in the following code sample.

Private Sub Form_Unload(Cancel As Integer)
    didev.Unacquire
End Sub