int main(int argc, const char* argv[]) { DWORD res; if (argc<2 ) { printf("Syntax: [1..16|a]\n"); return -1; } /////// 'a' - All devices // vXbox if (argc == 2 && tolower(argv[1][0])=='a' ) { printf("Removing All\n"); for (int i = 1; i < 5; i++) { res = UnPlugForce(i); if (res == STATUS_SUCCESS) printf("Device %d - Unplugged\n", i); else printf("Device %d - No change\n", i); } return 0; } // Remove one device int i = atoi(argv[1]); if (i < 1 || i>4) { printf("Devive range: 1-4\n"); return -2; } res = UnPlugForce(i); if (res == STATUS_SUCCESS) printf("Device %d - Unplugged\n", i); else printf("Device %d - No change\n", i); printf("OK\n"); return 0; }
int main() { DWORD dwRes; #if 0 // Clean-up vXbox devices dwRes = UnPlugForce(1); dwRes = UnPlugForce(2); dwRes = UnPlugForce(3); dwRes = UnPlugForce(4); #endif // 0 // Display status and wait C_DisplayStatus(); getchar(); UCHAR nSlots = 100; dwRes = GetNumEmptyBusSlots(&nSlots); DisplayError(dwRes); SHORT vJoyVer = GetvJoyVersion(); BOOL exist = (STATUS_SUCCESS == isVBusExist()); BYTE Led[4]; XINPUT_VIBRATION Vib; LONG MaxX; char c[3]; BOOL Plugged, UnPlugged, Pressed, GetN; UINT iSlot; // Plug-in vBox device 1, Display status and wait dwRes = isControllerPluggedIn(1, &Plugged); DisplayError(dwRes); dwRes = PlugIn(1); DisplayError(dwRes); dwRes = isControllerPluggedIn(1, &Plugged); DisplayError(dwRes); dwRes = ResetController(1); DisplayError(dwRes); C_DisplayStatus(); getchar(); // Interactive: Ask user which device to acquire HDEVICE h1 = C_AcqDevice(); getchar(); C_DisplayDeviceInfo(h1); getchar(); getchar(); C_DisplayStatus(); C_DisplayAllDeviceCtrls(); // Loop through interactive tests C_Test(h1); //dwRes = ResetControllerDPad(4); getchar(); return (0); }