Draygoes Posted December 9, 2007 Share Posted December 9, 2007 This is really cool man. I like it that your doing work that could ultimatly help a lot of people. Spoiler "If a vegetarian eats vegetables,What the heck does a humanitarian eat?" "I hear voices in my head, but I ignore them and continue on killing." "You have forced me to raise the indifference warning to beige, it's a beige alert people. As with all beige alerts please prepare to think about the possibility of caring." An optimist says that giving someone power DOESN'T immediately turn them into a sadist. A pessimist says that giving someone power doesn't IMMEDIATELY turn them into a sadist. Link to comment Share on other sites More sharing options...
BrettF Posted December 9, 2007 Share Posted December 9, 2007 Coolies I like it Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
Zedna Posted December 9, 2007 Share Posted December 9, 2007 I have no clue what this does. Can you put up a description for those who aren't familiar?EDIT: Punctuation errorLook into AccelTable.au3 script given by LazyCat. You will get clue from it. Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
Lazycat Posted December 9, 2007 Author Share Posted December 9, 2007 Oh, what the hot discussion Added short description to first post to eliminate issue... Koda homepage ([s]Outdated Koda homepage[/s]) (Bug Tracker)My Autoit script page ([s]Outdated mirror[/s]) Link to comment Share on other sites More sharing options...
The Ape Posted December 9, 2007 Share Posted December 9, 2007 Lazycat... you are superb! Maybe we could use this to control Valik's "Hotkey" so no one else would be affected. Don't worry, Valik, my dog is a cat and he just pissed himself and ran away. Thanks Lazycat! FixJaw.comTriad-Art.com Link to comment Share on other sites More sharing options...
eltorro Posted December 9, 2007 Share Posted December 9, 2007 Bad news On my WIN98SE with AutoIt 3.2.8.1 it's not working.- I must add Global Const $WM_COMMAND = 0x0111 - but it's not problem- nothing happens (only ding sound) if any keyboard shortcut is invoked - Ctrl+O or Alt+XSame for me with XP pro sp2 Au3 - 3.2.8.1Const is declared for Beta 3.2.9.3 but again, only ding sound. Regards, [indent]ElTorro[/indent][font="Book"] Decide, Commit, Achieve[/font]_ConfigIO.au3Language Translation --uses Google(tm) MsgBox Move XML wrapper UDF XML2TreeView Zip functionality Split your GUI Save Print ScreenZipPluginEdit In Place listviewSome of my scripts on Google code Link to comment Share on other sites More sharing options...
Lazycat Posted December 10, 2007 Author Share Posted December 10, 2007 Same for me with XP pro sp2 Au3 - 3.2.8.1Const is declared for Beta 3.2.9.3 but again, only ding sound.I think this is due latest version changes. Something from massive DllCall changes, struct alignment and native pointer support - maybe all in complex. I'm tried some older betas what I have, code start working from about 3.2.9.10, 3.2.9.8 give "corrupt stack" error on the TranslateAccelerator call, prior versions don't work at all. Koda homepage ([s]Outdated Koda homepage[/s]) (Bug Tracker)My Autoit script page ([s]Outdated mirror[/s]) Link to comment Share on other sites More sharing options...
GaryFrost Posted December 11, 2007 Share Posted December 11, 2007 I think this is due latest version changes. Something from massive DllCall changes, struct alignment and native pointer support - maybe all in complex. I'm tried some older betas what I have, code start working from about 3.2.9.10, 3.2.9.8 give "corrupt stack" error on the TranslateAccelerator call, prior versions don't work at all. With some minor changes, ptr should be handle after reading up on the functions. This works for me without crashing on WinXP Pro SP2 3.2.9.10 and 3.2.9.14 expandcollapse popup#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Global $MyAccelTable Global $FVIRTKEY = 0x1 Global $FNOINVERT = 0x2 Global $FSHIFT = 0x4 Global $FCONTROL = 0x8 Global $FALT = 0x10 $hGUI = GUICreate("GUI", 426, 205, -1, -1) $hButton = GUICtrlCreateButton("Button", 170, 112, 75, 25) $hFile = GUICtrlCreateMenu("File") $hFileOpen = GUICtrlCreateMenuItem("Open File" & @TAB & "Ctrl+O", $hFile) _GUICtrlSetAccelerator($MyAccelTable, $hFileOpen, "^o") GUICtrlCreateMenuItem("", $hFile) $hExit = GUICtrlCreateMenuItem("Exit" & @TAB & "Alt+X", $hFile) _GUICtrlSetAccelerator($MyAccelTable, $hExit, "!X") GUISetState(@SW_SHOW) _GUIAcceleratorTableInit($MyAccelTable) GUIRegisterMsg($WM_COMMAND, "WM_COMMAND_FUNC") GUISetState(@SW_SHOW) While 1 _GUIAcceleratorProcessMsg($hGUI, $MyAccelTable) $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $hFileOpen FileOpenDialog("Bla", "", "All (*.*)") Case $hExit _GUIAcceleratorTableFree($MyAccelTable) Exit Case $hButton MsgBox(0, "Button", "Ok") EndSwitch WEnd Func WM_COMMAND_FUNC($hWnd, $MSG, $wParam, $lParam) If BitAND($wParam, 0xF0000) = 0x10000 Then ; Autoit not support WM_COMMAND sent with "accelerator" flag ; so remove it and post message again with the same control id $wParam = BitAND($wParam, BitNOT(0x10000)) DllCall("user32.dll", "int", "PostMessage", "hwnd", $hWnd, _ "int", $WM_COMMAND, _ "wparam", $wParam, _ "lparam", $lParam) Return 0 EndIf Return $GUI_RUNDEFMSG EndFunc ;==>WM_COMMAND_FUNC Func _GUIAcceleratorProcessMsg($hWnd, $hAccel) Local $hDll = DllOpen("user32.dll") Local $MSG = DllStructCreate("hwnd;uint;int;int;dword;int;int") DllCall($hDll, "int", "GetMessage", "ptr", DllStructGetPtr($MSG), "hwnd", $hWnd, "uint", 0, "uint", 0) $ret = DllCall($hDll, "int", "TranslateAccelerator", "hwnd", $hWnd, "hwnd", $hAccel, "ptr", DllStructGetPtr($MSG)) If Not $ret[0] Then DllCall($hDll, "int", "TranslateMessage", "ptr", DllStructGetPtr($MSG)) DllCall($hDll, "int", "DispatchMessage", "ptr", DllStructGetPtr($MSG)) EndIf DllClose($hDll) EndFunc ;==>_GUIAcceleratorProcessMsg Func _GUIAcceleratorTableFree($hAccel) DllCall("user32.dll", "int", "DestroyAcceleratorTable", "hwnd", $hAccel) EndFunc ;==>_GUIAcceleratorTableFree Func _GUIAcceleratorTableInit(ByRef $pTable) Local $tagACCEL = "byte;short;short" Local $fVirt, $key If Not IsArray($pTable) Or UBound($pTable) < 2 Then SetError(1, 0, False) Local $sData = "" For $i = 1 To $pTable[0][0] $sData &= $tagACCEL & ";" Next $sData = StringTrimRight($sData, 1) Local $pData = DllStructCreate($sData) For $i = 1 To $pTable[0][0] _TranslateKeys($pTable[$i][1], $fVirt, $key) DllStructSetData($pData, $i * 3 - 2, $fVirt) DllStructSetData($pData, $i * 3 - 1, $key) DllStructSetData($pData, $i * 3, $pTable[$i][0]) Next $ret = DllCall("user32.dll", "hwnd", "CreateAcceleratorTable", "ptr", DllStructGetPtr($pData), "int", $pTable[0][0]) If @error Or $ret[0] = 0 Then SetError(2, 0, 1) ; Creating table was not succeed $pTable = $ret[0] Return True EndFunc ;==>_GUIAcceleratorTableInit Func _TranslateKeys($sHotkey, ByRef $fVirt, ByRef $key) $fVirt = 0 $sHotkey = StringReplace($sHotkey, "^", "", 1) If @extended = 1 Then $fVirt = BitOR($fVirt, $FCONTROL, $FVIRTKEY) $sHotkey = StringReplace($sHotkey, "!", "", 1) If @extended = 1 Then $fVirt = BitOR($fVirt, $FALT, $FVIRTKEY) $sHotkey = StringReplace($sHotkey, "+", "", 1) If @extended = 1 Then $fVirt = BitOR($fVirt, $FSHIFT, $FVIRTKEY) If StringLen($sHotkey) = 1 Then $key = Asc(StringUpper($sHotkey)) Else ; Here become long case for special keys Switch $sHotkey Case "{SPACE}" $key = 32 Case "{ENTER}" $key = 13 EndSwitch EndIf EndFunc ;==>_TranslateKeys Func _GUICtrlSetAccelerator(ByRef $pTable, $nCtrlID, $sHotkey) If Not IsArray($pTable) Then Local $tmpTable[1][2] = [[0, 0]] $pTable = $tmpTable EndIf $pTable[0][0] += 1 Local $curIdx = $pTable[0][0] ReDim $pTable[$curIdx + 1][2] $pTable[$curIdx][0] = $nCtrlID $pTable[$curIdx][1] = $sHotkey EndFunc ;==>_GUICtrlSetAccelerator SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Zedna Posted December 11, 2007 Share Posted December 11, 2007 With some minor changes, ptr should be handle after reading up on the functions. This works for me without crashing on WinXP Pro SP2 3.2.9.10 and 3.2.9.14Doesn't work on WIN98SE with 3.2.8.1 (only Ding sound) Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
RDSchaefer Posted December 13, 2007 Share Posted December 13, 2007 Oh, wow! What an awesome reply! I couldn't agree more. I usually just tell them to RTFM! Link to comment Share on other sites More sharing options...
RDSchaefer Posted December 13, 2007 Share Posted December 13, 2007 Who said, besides you, that WeaponX is disturbing us? People ask those questions quite often.Edit:And, he is not asking the question continually or persistenly.Exactly, that's the point! They ask the same questions over and over and over....I don't understand what the argument is about. Why is it so darn hard to understand that, by taking 5 minutes to do some research on your own, the information will be of much greater benefit, than if someone just told you the answer?Yelling at someone who points out one of your faults is NOT the way to encourage willingness to help. Link to comment Share on other sites More sharing options...
GaryFrost Posted December 13, 2007 Share Posted December 13, 2007 Exactly, that's the point! They ask the same questions over and over and over....I don't understand what the argument is about. Why is it so darn hard to understand that, by taking 5 minutes to do some research on your own, the information will be of much greater benefit, than if someone just told you the answer?Yelling at someone who points out one of your faults is NOT the way to encourage willingness to help.Don't start this B.S. again. I don't think LazyCat appreciates his thread being hi-jacked with arguments.@Zedna, I don't have Win9x to test so don't know what is happening there, guess you can say you've been "dinged for using Win98". SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
RDSchaefer Posted December 14, 2007 Share Posted December 14, 2007 ...I don't think LazyCat appreciates his thread being hi-jacked with arguments....You're right. Sorry LazyCat, great job! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now