Ejoc
Active Members-
Posts
481 -
Joined
-
Last visited
Profile Information
-
Member Title
What's DllStruct?
-
Location
CA, USA
-
WWW
http://www.mozilla.org/
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
Ejoc's Achievements
Universalist (7/7)
1
Reputation
-
BlackLumiere reacted to a post in a topic: GUIGetMSG and sleep
-
Works like a champ and it only ended up being 3 lines of code, not all together obviously: _GUICtrlListView_RegisterSortCallBack($hList) _GUICtrlListView_SortItems($hList, GUICtrlGetState($hList)) _GUICtrlListView_UnRegisterSortCallBack($hList) The unicode is sorted after "" and before "A" but that doesn't matter one bit. *edit Oh, and after yesterday I made sure to update to 3.2.11.1, so this code did work with that version of AutoIt
-
You sir are a genius. Thanks a bunch
-
Is there an existing way to sort a ListView that may contain unicode that does not result in the unicode being converted to question marks? I'm looking to avoid reinventing the wheel if someone has already done it. *edit Forgot to mention that I did try _GUICtrlListView_SimpleSort and except for the unicode converting to ? it does what I need
-
3.2.0.1 Updating did it, sigh that was lame Thanks
-
The help file for Filopen makes no mention of this
-
So I've been searching and searching, but haven't found any examples that cover what I'm trying to do, which as far as I can tell should be simple. How do I read a UTF-8 encoded text file and have the unicode characters preserved in the script? As it is now, the unicode characters are "mangled" and the 3 character header at the beginning of the file is being read in as ascii. Ideally I would be able to use FileOpen() and FileReadLine() I just need it displayed correctly in the GUI Thanks
-
Is there a destructor being called to free a DllStruct if the variable returned from DllStructCreate is set to equal another DllStructCreate? I'm trying to create a link listed, which should be possible using DllStructCreate, but something is not working as I'm expecting it too: $sNode = "int;int;int;ptr" $node = DllStructCreate($sNode) If @Error Then MsgBox(0,"","node = DllStructCreate(sNode)") EndIf $node_ptr = DllStructGetPtr($node) DllStructSetData($node,1,1) DllStructSetData($node,4,0) $NodeHead_ptr = $node_ptr $NodeHead = DllStructCreate($sNode,$NodeHead_ptr) If @Error Then MsgBox(0,"","NodeHead = DllStructCreate(sNode,NodeHead_ptr)") EndIf MsgBox(0,"", "node(" & $node_ptr & ") = " & DllStructGetData($node,1) & " " & DllStructGetData($node,4) & @CRLF & _ "NodeHead(" & $NodeHead_ptr & ") = " & DllStructGetData($NodeHead,1) & " " & DllStructGetData($NodeHead,4)) $node = DllStructCreate($sNode) If @Error Then MsgBox(0,"","node = DllStructCreate(sNode)") EndIf $node_ptr = DllStructGetPtr($node) DllStructSetData($node,1,2) DllStructSetData($node,4,0) $NodeHead = DllStructCreate($sNode,$NodeHead_ptr) If @Error Then MsgBox(0,"","NodeHead = DllStructCreate(sNode,NodeHead_ptr)") EndIf DllStructSetData($NodeHead,4,$node_ptr) MsgBox(0,"", "node(" & $node_ptr & ") = " & DllStructGetData($node,1) & " " & DllStructGetData($node,4) & @CRLF & _ "NodeHead(" & $NodeHead_ptr & ") = " & DllStructGetData($NodeHead,1) & " " & DllStructGetData($NodeHead,4)) $node = DllStructCreate($sNode) If @Error Then MsgBox(0,"","node = DllStructCreate(sNode)") EndIf $node_ptr = DllStructGetPtr($node) DllStructSetData($node,1,3) DllStructSetData($node,4,0) $NodeHead = DllStructCreate($sNode,$NodeHead_ptr) If @Error Then MsgBox(0,"","NodeHead = DllStructCreate(sNode,NodeHead_ptr)") EndIf MsgBox(0,"", "node(" & $node_ptr & ") = " & DllStructGetData($node,1) & " " & DllStructGetData($node,4) & @CRLF & _ "NodeHead(" & $NodeHead_ptr & ") = " & DllStructGetData($NodeHead,1) & " " & DllStructGetData($NodeHead,4)) Results: node(6099336) = 1 0 NodeHead(6099336) = 1 0 -As Expected node(6101672) = 2 0 NodeHead(6099336) = 1 6101672 -As Expected node(6101112) = 3 0 NodeHead(6099336) = 153 5832864 -Not Expected
-
I didn't run it, but if you right click in your task bar you can open the task manager, and then you should be able to kill the program.
-
quick_sliver007: I love that laughing man picture
-
In the functions where you are using DllStructCreate() when you have errors and return -1, before the return call DllStructDelete()'s on the structs. Other then that and I personally check for errors after each DllStructCreate() but alot of people don't. Example: $procHandle = DllCall("kernel32.dll", 'int', 'OpenProcess', 'int', $PROCESS_ALL_ACCESS, 'int', False, 'int', $pId) If @error Then ConsoleWrite("Error: Could not read toolbar process memory, " & @error) DllStructDelete($TBBUTTON);add DllStructDelete($TBBUTTON2);add DllStructDelete($ExtraData);add return -1 EndIf
-
Very nice, I can now delete the 1/2 completed version I have
-
But getting people to include comments is a good thing, even when they are your own. Go back in 2 years, and those comments are priceless.
-
So I got GTA San Andreas for the PC and was missing seeing it / hearing it on the TV so I got a Box setup in the front room to basicly be a game console. It has no Keyboard and No mouse, just a Playstation style Joystick. So I made this script that I have run automaticlly when the system comes up and it lets me select what games to play. Also handy if you are building an arcade machine which is basicly the same idea. Enjoy *EDIT changed the sends to controlsends as I was losing focus to the window on bootup The 'Game Launch.ini' : [GENERAL] Grand Theft Auto San Andreas = C:\Documents and Settings\All Users\Desktop\GTA San Andreas.lnk CyberBall = C:\Documents and Settings\Ejoc\Application Data\Microsoft\Internet Explorer\Quick Launch\cyberb2p.lnk Samurai Showdown 2 = C:\Documents and Settings\Ejoc\Application Data\Microsoft\Internet Explorer\Quick Launch\samsho2.lnk MAME = C:\Documents and Settings\Ejoc\Application Data\Microsoft\Internet Explorer\Quick Launch\Mame.lnk The Script: #cs vi:ts=4 sw=4: Game Launch.au3 Used to launch games from an INI via joystick input, useful if you have no Keyboard or Mouse. I use shortcuts to setup all the working directory and parameters so if you need to set either or those, I suggest making a shortcut and putting the path to the shortcut in the INI file. Ejoc Game Launch.ini should contain: [GENERAL] Grand Theft Auto San Andreas = C:\Documents and Settings\All Users\Desktop\GTA San Andreas.lnk Mame32 = C:\Documents and Settings\Ejoc\Application Data\Microsoft\Internet Explorer\Quick Launch\Mame.lnk GAME #3 = PATH TO SHORTCUT GAME #4 = PATH TO SHORTCUT GAME #5 = PATH TO SHORTCUT #ce #include <GUIConstants.au3> ;Read the ini file and get the list of games $Games = INIReadSection("Game Launch.ini","GENERAL") If @error Then MsgBox(0,"NO INI FILE","Could not open Game Launch.ini") Exit EndIf ;Build the GUI $hGUI = GUICreate("Game Launcher",@DeskTopWidth,@DeskTopHeight) GuiSetFont(24) $hList = GUICtrlCreateList($games[1][0],5,5,@DesktopWidth-10,@DeskTopHeight-10) For $i = 2 To $Games[0][0] GUICtrlSetData($hList,$Games[$i][0]) Next ;show the GUI GuiSetState() GUISetState(@SW_MAXIMIZE) ControlSend("Game Launcher","",$hList,"{UP}{DOWN}") $joy = _JoyInit() While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop ; If WinGetTitle("") = "Game Launcher" Then If 1 Then $j = _GetJoy($joy,0) If $j[1] > 65000 Or $j[6] = 18000 Then; pushed down on D-Pad or joystick ControlSend("Game Launcher","",$hList,"{Down}") Sleep(250) EndIf If $j[1] < 500 Or $j[6] = 0 Then; pushed up on D-Pad or joystick ControlSend("Game Launcher","",$hList,"{UP}") Sleep(250) EndIf If $j[7] Then; they pushed a button For $i = 1 To $Games[0][0] If GUICtrlRead($hList) = $Games[$i][0] Then $plist = ProcessList() $pNumBeforeLaunch = $plist[0][0] RunWait(@comspec & ' /c START /WAIT "" "' & $Games[$i][1] & '"',"",@SW_HIDE) Do; some games will spawn process' so the RunWait doesn't catch all of them $plist = ProcessList() Sleep(250) Until $plist[0][0] = $pNumBeforeLaunch $i = $Games[0][0] EndIf Next EndIf EndIf Wend _JoyClose($joy) ;====================================== ; _JoyInit() ;====================================== Func _JoyInit() Local $joy Global $JOYINFOEX_struct = "dword[13]" $joy = DllStructCreate($JOYINFOEX_struct) if @error Then Return 0 DllStructSetData($joy,1,DllStructGetSize($joy),1);dwSize = sizeof(struct) DllStructSetData($joy,1,255,2) ;dwFlags = GetAll return $joy EndFunc ;====================================== ; _GetJoy($lpJoy,$iJoy) ; $lpJoy Return from _JoyInit() ; $iJoy Joystick # 0-15 ; Return Array containing X-Pos, Y-Pos, Z-Pos, R-Pos, U-Pos, V-Pos,POV ; Buttons down ; ; *POV This is a digital game pad, not analog joystick ; 65535 = Not pressed ; 0 = U ; 4500 = UR ; 9000 = R ; Goes around clockwise increasing 4500 for each position ;====================================== Func _GetJoy($lpJoy,$iJoy) Local $coor,$ret Dim $coor[8] DllCall("Winmm.dll","int","joyGetPosEx",_ "int",$iJoy,_ "ptr",DllStructGetPtr($lpJoy)) if Not @error Then $coor[0] = DllStructGetData($lpJoy,1,3) $coor[1] = DllStructGetData($lpJoy,1,4) $coor[2] = DllStructGetData($lpJoy,1,5) $coor[3] = DllStructGetData($lpJoy,1,6) $coor[4] = DllStructGetData($lpJoy,1,7) $coor[5] = DllStructGetData($lpJoy,1,8) $coor[6] = DllStructGetData($lpJoy,1,11) $coor[7] = DllStructGetData($lpJoy,1,9) EndIf return $coor EndFunc ;====================================== ; _JoyClose($lpJoy) ; Free the memory allocated for the joystick struct ;====================================== Func _JoyClose($lpJoy) DllStructDelete($lpJoy) EndFuncGame_Launch.au3
-
@Scriptonize JSThePatriot is working on adding native encryption support, so someone is working on it atm.
-
I use silurian