Jump to content

FaT3oYCG

Active Members
  • Posts

    136
  • Joined

  • Last visited

Everything posted by FaT3oYCG

  1. The first part of the code does not show the information you need to be able to make the proper dll calll.
  2. 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 .
  3. 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
  4. 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.
  5. 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.
  6. 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.
  7. this looks slightly like a bot to me .
  8. 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
  9. 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?
  10. Programming is based on "pure logic" sometimes us humans just cant fathom how that works though, glad you solved you problem anyway.
  11. 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.
  12. Anyone got any ideas? I am actively working on this again.
  13. 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.
  14. 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.
  15. 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.
  16. You could try using an extended style for the gui which I was pointed towards the other day which solved my problem, here is the response I got: http://www.autoitscript.com/forum/index....wtopic=109092&st=0&p=768115&#entry768115
  17. I wasn't saying that it didn't do that I added that response as I don't see there being a limit on sending and receiving http requests, hence unlimited number of downloads (within reason) as you stated IE only seems to allow 2 at a time .
  18. If you wanted to get really smart you could use http requests to download a file and the headder gives the total which would allow you to tell the user the percentage of the download (progress bar) but that may be a little advanced .
  19. I beleive that the forums do not support the creation of bots and you also posted this twice.
  20. Are you being serious? I'm sorry but I have read the other post that you have made and there does not seem to be any suggestion towards the fact that you have actually tried to figure these things out your self. I do not want to say that you havent tried if you have and just havent explained but I am dboutful that you will get any help on these mattes if you post one or two lines in a thread on a general subject. If you want to create something like utorrent then using the phrase "how to create script for torrent file like utorrent " leaves this open to a whole host of answers most of which people won't bother to explain, If I have interpreted what you are asking incorrectly it is because as I pointed out you cant really get much from a 1 or 2 line post. Thanks, Craig.
  21. Perfect thank you, I feel silly asking these questions when you seem to know the answer straight away . Thanks, Craig.
  22. O.K. Thanks for that I have it set up as I want it now, I was just wondering if the child window flickering was because I am creating an instance of Scintilla and if not would you know of any ways to try and stop this problem occouring?
  23. That will work , thanks I'm sure I will be able to pull the relevant information out of that and then research anything that I don't understand, if not ill be back . EDIT: It seems that the information i needed was a simple as this: GUIRegisterMsg($WM_SIZE, "function name") Thanks, Craig.
  24. Hi, I have been looking fo an answer to this since I got up this morning about 6 hours ago, I have a child window that is created inside of my main window which I would like to resize when the parent is being resized but the code that I am using only resizes it after the parent has been resized. I have the code to resize the child but it does not take effect while the window is being resized only after the window has been resized which doesn't look very good. here is the code that I am using, I have tried a few other methods including using the $GUI_EVENT_RESIZED message but that also did not work. #cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.4.0 Author: Craig Gilhooley Script Function: SciPad - A Scintilla based editor. #ce ---------------------------------------------------------------------------- ; Script Start #include <GUIConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include "SciLexer.au3" Local $SciPadWidth = 600 Local $SciPadHeight = 450 $hwndSciPad = GUICreate("SciPad - A Scintilla based editor", $SciPadWidth, $SciPadHeight, (@DesktopWidth - $SciPadWidth) / 2, (@DesktopHeight - $SciPadHeight) / 2, _ BitOR($WS_CAPTION, $WS_SYSMENU, $WS_MAXIMIZEBOX, $WS_MINIMIZEBOX, $WS_SIZEBOX)) $Sci = Sci_CreateEditor($hwndSciPad, 10, 10, $SciPadWidth - 20, $SciPadHeight - 20) GUISetState(@SW_SHOW) While 1 $Msg = GUIGetMsg(1) Local $SciPadPos = WinGetPos($hwndSciPad) WinMove($Sci, "", 10, 10, $SciPadPos[2] - 30, $SciPadPos[3] - 54) Switch $Msg[0] Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Does anyone have a simple solution to this, I would like to keep te code small if that is possible and as simple as it can be aswell so when I come back to it I will be able to understand it. I am not simply requestiong the answer or some code for this question but would preffer to be told what I am doing wrong and directed towards the correct method (unless I won't find it out because it is too advanced). Thanks, Craig.
  25. Any ideas on this, I hvae been searching some more and can't find how I would access a function in the DLL provided a pointer. Is there something I am missing. Thanks, Craig.
×
×
  • Create New...