
FaT3oYCG
Active Members-
Posts
136 -
Joined
-
Last visited
FaT3oYCG's Achievements

Adventurer (3/7)
0
Reputation
-
Help with DllStructCreate / Calling C DLL functions
FaT3oYCG replied to ernesthan's topic in AutoIt General Help and Support
The first part of the code does not show the information you need to be able to make the proper dll calll. -
XBOX 360 Chatpad Adapter Driver (Test)
FaT3oYCG replied to FaT3oYCG's topic in AutoIt General Help and Support
Thanks for your findings, I have been very busy at work etc. so haven't had time to look at this, I will try and work on it for a bit now and see what comes of it, someone recently linked me to some more information about how the Chatpad seems to send and receive data via the pc but I need to set that up first as I was trying to get the adapter to be recognised first . -
XBOX 360 Chatpad Adapter Driver (Test)
FaT3oYCG replied to FaT3oYCG's topic in AutoIt General Help and Support
Ill have to work up another script to try and find out which one it is on yours but thanks for the response, a list of the outputs would be nice if you could -
XBOX 360 Chatpad Adapter Driver (Test)
FaT3oYCG replied to FaT3oYCG's topic in AutoIt General Help and Support
Wireless, it will check to see if the adapter is installed under the same name on your system so that it can be accessed by the raw input functions. I don't need to specifically know what comes out of the controller in raw output mode but to use the Chatpad I will need to do some testing to see how to get it to work. -
XBOX 360 Chatpad Adapter Driver (Test)
FaT3oYCG replied to FaT3oYCG's topic in AutoIt General Help and Support
That is correct, but to create a driver for it (Sort of) using autoit to read and write raw input and output to the controller through the adaptor requires the driver for the adaptor. -
Hi, I have recently been looking into making a driver for the XBOX 360 Chatpad so that you can use it with your PC, I am running on a Windows 7 machine and had a hell of a job installing the driver for the Controller so that I could connect to the controller but now that I have solved that issue I moved onto looking at how I could use raw input to possibly create a Driver (Sort of) for the Chatpad. I have come up with this simple script for now to see if the adapter has the same name for other people as it is quite strange related to other HID devices that I have attached to my computer, If you could please test this script with the adapter attached and tell me if you are notified that it has been found then that would be great, I can continue myself for now working towards the driver but I want to know if it will work on other systems not just my own. Script: #cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.4.0 Author: Craig Gilhooley Script Function: XBOX 360 Controller HID Chatpad Driver. #ce ---------------------------------------------------------------------------- ; XBOX 360 Wireless Controller Adaptor Name (???) $deviceName = "\\?\HID#{84a1e9b8-12ba-4a9c-8ab0-a43784e0d149}_LOCALMFG&0000#8&1494f40&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}" ; Open the User32 dll to allow access to the raw input functions $dll = DllOpen("user32.dll") ; If the dll could not be opened show error message If Not $dll Then MsgBox(48, "Error!", "The DLL could not be opened.") EndIf $rid = DllStructCreate("dword;dword;") $numDevices = DllStructCreate("int") $retval = DllCall($dll, "long", "GetRawInputDeviceList", "ptr", 0, "ptr", DllStructGetPtr($numDevices), "long", DllStructGetSize($rid)) If @error Then MsgBox(48, "Error!", "Unable to obtain the number of devices, Error code " & @error) EndIf $numDevs = DllStructGetData($numDevices, 1) $temp = "" For $i = 0 To ($numDevs - 1) $temp &= "dword;dword;" Next $ridl = DllStructCreate($temp) $dwsize = $numDevs * DllStructGetSize($ridl) $retval = DllCall($dll, "long", "GetRawInputDeviceList", "ptr", DllStructGetPtr($ridl), "ptr", DllStructGetPtr($numDevices), "long", DllStructGetSize($rid)) If @error Then MsgBox(48, "Error!", "Unable to obtain a list of devices, Error code " & @error) EndIf For $i = 0 To ($numDevs - 1) $devName = DllStructCreate("char[256]") $size = DllStructCreate("dword") DllStructSetData($size, 1, 256) DllCall($dll, "long", "GetRawInputDeviceInfo", "long", DllStructGetData($ridl, ($i * 2) + 1), "int", 0x20000007, "ptr", DllStructGetPtr($devName), "ptr", DllStructGetPtr($size)) MsgBox(0, "Device: " & $i, _ "Handle: " & DllStructGetData($ridl, ($i * 2) + 1) & @CRLF & _ " Type: " & DllStructGetData($ridl, ($i * 2) + 2) & @CRLF & _ " Name: " & DllStructGetData($devName, 1)) If StringInStr(DllStructGetData($devName, 1), $deviceName) <> 0 Then MsgBox(64, "Search Stopped!", "The Chatpad adaptor was found.") $chatpadHandle = DllStructGetData($rid, ($i * 2) + 1) $i = $numDevs EndIf Next DllClose($dll) Thanks, Craig.
-
this looks slightly like a bot to me .
-
Search Function which searches all sub folders
FaT3oYCG replied to vickerps's topic in AutoIt General Help and Support
I have personally posted some information that would help to solve this problem on a previous occasion, if you search through my posts im sure you could find the thread. EDIT: This thread: http://www.autoitscript.com/forum/index.php?showtopic=86695&st=0&p=621662&hl=lua%20recursive&fromsearch=1&#entry621662 -
Although that method may work it is reliant on current folder layout defaults and windows updates, the best way would be to find the icon by name etc. and then open the root application, or just do that straight from the windows folder, much easier and it wont get broken by updates etc. p.s. @OP Why did you put the thread title in CAPS LOCK?
-
A String Is a String Is a String -- or not?
FaT3oYCG replied to SpotCheckBilly's topic in AutoIt General Help and Support
Programming is based on "pure logic" sometimes us humans just cant fathom how that works though, glad you solved you problem anyway. -
LIB USB - DLL C for loop with structures.
FaT3oYCG replied to FaT3oYCG's topic in AutoIt General Help and Support
Well determination and lots more research seem to have eventually prospered, I have found that I can use a pointer as the second argument to the DllStructCreate() function. This gives me this at the moment: #include <Array.au3> $libusb0 = DllOpen("libusb0.DLL") #include "libusb0.au3" usb_init() usb_find_busses() usb_find_devices() $busses = usb_get_busses() $usb_bus = DllStructCreate("ptr;ptr;char[512];ptr;ulong;ptr", $busses[0]) MsgBox(0, "ugb", IsDllStruct($usb_bus)) MsgBox(0, "ugb", DllStructGetData($usb_bus, 3)) Which is working fine. I hope to develop this into a UDF for use in more cases but I believe that I will be able to progress and provide some examples eventually. Thanks, Craig. -
LIB USB - DLL C for loop with structures.
FaT3oYCG replied to FaT3oYCG's topic in AutoIt General Help and Support
Anyone got any ideas? I am actively working on this again. -
Finding files that contain a specific string
FaT3oYCG replied to yaffasoft's topic in AutoIt General Help and Support
StringInStr ( "string", "substring" [, casesense [, occurrence [, start [, count]]]] ) help file, you can also use the help file to find information on the functions that you will need to read a list of the file names and how to create a for loop to check them. -
LIB USB - DLL C for loop with structures.
FaT3oYCG replied to FaT3oYCG's topic in AutoIt General Help and Support
Hi, sorry I didn't pick up on this earlier, I went away to try and fix it on my own and did not realise the readability issues and since got distracted. I currently have the functions for initialising the lib and finding the busses and devices sorted (hopefully) they seem to function as described. To put my original problem in a different way, there is a simple example provided for the lib in C which I was attempting to convert but hit a road block when it came to the for loop. Here is the example in C: http://libusb.sourceforge.net/doc/examples-code.html Here are the relevant structs from the usb.h file: struct usb_device { struct usb_device *next, *prev; char filename[LIBUSB_PATH_MAX]; struct usb_bus *bus; struct usb_device_descriptor descriptor; struct usb_config_descriptor *config; void *dev; /* Darwin support */ unsigned char devnum; unsigned char num_children; struct usb_device **children; }; struct usb_bus { struct usb_bus *next, *prev; char dirname[LIBUSB_PATH_MAX]; struct usb_device *devices; unsigned long location; struct usb_device *root_dev; }; Some functions I made for the libusb0.au3: Func usb_init() DllCall($libusb0, "none", "usb_init") EndFunc ;==>usb_init Func usb_find_busses() $retval = DllCall($libusb0, "int", "usb_find_busses") Return $retval EndFunc ;==>usb_find_busses Func usb_find_devices() $retval = DllCall($libusb0, "int", "usb_find_devices") Return $retval EndFunc ;==>usb_find_devices My test: $libusb0 = DllOpen("libusb0.DLL") #include "libusb0.au3" usb_init() usb_find_busses() usb_find_devices() Which is all fine and dandy bit it doesn't do anything at the moment, looking at the documentation I am finding it hard to see how I would use the usb_get_busses() function as it seems to return a struct or the data is placed into one by reference somehow. Again here is the documentation: http://libusb.sourceforge.net/doc/functions.html and the usb_get_busses() page: http://libusb.sourceforge.net/doc/function.usbgetbusses.html Some help with this would be appreciated a lot. Thanks, Craig. -
LIB USB - DLL C for loop with structures.
FaT3oYCG posted a topic in AutoIt General Help and Support
Hi, I have been playing arround with libusb0-win32 and was/am attempting to make the starts of a udf library as I haven't found one and it would come in handy for my current project. I am having trouble figuring out how I would convert this code: http://libusb.sourceforge.net/doc/examples-code.html more notably this section struct usb_bus *bus; int c, i, a; /* ... */ for (bus = busses; bus; bus = bus->next) { struct usb_device *dev; for (dev = bus->devices; dev; dev = dev->next) {to work with autoit. At the moment I have this code: As I am testing it but I cant seem to get the usb_open to work and I dont have a clue how to convert the code I showed at the top of the post. I have found relevant documentation here: http://libusb.sourceforge.net/doc/ And I got the information about the structure of the STRUCT's from libusb.h, I beleive that the more relevant ones are: struct usb_device { struct usb_device *next, *prev; char filename[LIBUSB_PATH_MAX]; struct usb_bus *bus; struct usb_device_descriptor descriptor; struct usb_config_descriptor *config; void *dev; /* Darwin support */ unsigned char devnum; unsigned char num_children; struct usb_device **children; }; struct usb_bus { struct usb_bus *next, *prev; char dirname[LIBUSB_PATH_MAX]; struct usb_device *devices; unsigned long location; struct usb_device *root_dev; };Here is a link to the DLL: http://sourceforge.net/projects/libusb-w...in32-device-bin-0.1.12.2.tar.gz/download And a link to the src (libusb.h): http://sourceforge.net/projects/libusb-w...ibusb-win32-src-0.1.12.2.tar.gz/download Any help or information towards my goal is appreciated. Thanks, Craig.