bird42 Posted November 10, 2009 Share Posted November 10, 2009 Hello guys! I need some help . 1) RegWrite("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run","autoavvio",-1,@SystemDir&"\"&@ScriptName) What's wrong? I can't write keys. 2) If _IsPressed(43) Then _write("c") EndIf This will result in " cccccccccccccccccccccccccccccccccccccccc". Help me to get to "c". Thanks a lot for your help. Link to comment Share on other sites More sharing options...
99ojo Posted November 10, 2009 Share Posted November 10, 2009 Hello guys! I need some help . 1) RegWrite("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run","autoavvio",-1,@SystemDir&"\"&@ScriptName) What's wrong? I can't write keys. 2) If _IsPressed(43) Then _write("c") EndIf This will result in " cccccccccccccccccccccccccccccccccccccccc". Help me to get to "c". Thanks a lot for your help. Hi, 1) Check if the key is really a REG_SZ. See helpfile for more information: ("HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run","autoavvio","REG_SZ",@SystemDir&"\"&@ScriptName) 2) Please post code of your _write function. Check if you really press the c once. ;-)) Stefan Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 10, 2009 Moderators Share Posted November 10, 2009 (edited) zentral,You need to wait until the key is released - and as you are continually polling _IsPressed, it is best to open and close the DLL:#include <Misc.au3> $iCount = 0 ; to show there is just 1 per press $dll = DllOpen("user32.dll") While 1 If _IsPressed("43", $dll) Then $iCount += 1 ConsoleWrite("c " & $iCount & @CRLF) While _IsPressed("43", $dll) Sleep(10) WEnd EndIf If _IsPressed("1B", $dll) Then ExitLoop WEnd DllClose($dll)M23Edit: Looking at the RegWrite, you have set the "type" parameter to "-1". From the help file:AutoIt supports registry keys of type REG_BINARY, REG_SZ, REG_MULTI_SZ, REG_EXPAND_SZ, REG_QWORD, and REG_DWORDI do not believe "-1" is a valid parameter here - it should be one of the above as a literal string. Edited November 10, 2009 by Melba23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
bird42 Posted November 10, 2009 Author Share Posted November 10, 2009 (edited) Thanks 99ojo and Melba23 ! Now it works. B) B) Edited November 10, 2009 by zentral 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