• Advertisement

DaFox

Member
  • Content count

    2
  • Joined

  • Last visited

Community Reputation

173 Neutral

About DaFox

  • Rank
    Newbie
  1. Turn off XBOX 360 Controller

    Very possible. I would not use this in anything more than a controller manager. This is not something that any other type of application should be doing anyway. Windows 7 ships with 4 versions of the XInput.dll though. I expect that Windows 8 will ship with the exact same XInput1_3.dll, and a new XInput1_4.dll.
  2. Turn off XBOX 360 Controller

    Glad that you got it working MemphiZ, this is basically the only thread that I could find that was discussing this issue. Here is some sample code on how to do this. AutoIT: [code]$nController = 1 $XInputDLL = DllOpen("xinput1_3.dll") DllCall($XInputDLL, "long", 103, "int", $nController) [/code] C++: [code] #include <windows.h> #include <iostream> #include "C:/Program Files (x86)\\Microsoft DirectX SDK (June 2010)\\Include\\XInput.h" #pragma comment(lib, "C:\\Program Files (x86)\\Microsoft DirectX SDK (June 2010)\\Lib\\x64\\XInput.lib") using namespace std; typedef int (*FnOff)(int); int wmain() { HINSTANCE hXInputDLL = LoadLibraryA("XInput1_3.dll"); if (hXInputDLL == NULL) { cout << "ERROR: Unable to load XInput1_3.dll!" << endl; fgetc(stdin); return 1; } unsigned result; for (short i = 0; i < XUSER_MAX_COUNT; ++i) { XINPUT_STATE state; memset(&state, 0, sizeof(XINPUT_STATE)); result = XInputGetState(i, &state); if(result == ERROR_SUCCESS) { FnOff pOff; pOff = FnOff(GetProcAddress(hXInputDLL, reinterpret_cast<char*>(103))); pOff(i); } } FreeLibrary(hXInputDLL); return 0; }[/code] This C++ Code simply turns off all connected XInput devices. You can probably safely skip the XInputGetState stuff though I have not tried calling XInput1_3.dll#103 on a device that is not connected. I'm sure it will be fine.
  • Advertisement