Jump to content

Recommended Posts

Posted

Topic

I cant add any reg keys ;) Tried examples from Help file.

Some functions in Autoit isnt accepted by Windows Vista or what? :evil:

This world is crazy

Posted

#RequireAdmin
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Diablo II Pather By InFlames", 275, 142, 706, 632)
$Button1 = GUICtrlCreateButton("Path", 80, 8, 81, 81, $WS_GROUP)
$Group1 = GUICtrlCreateGroup("Version", 8, 8, 65, 81)
$V1 = GUICtrlCreateRadio("1.12", 16, 34, 49, 17)
$V2 = GUICtrlCreateRadio("1.13", 16, 58, 49, 17)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button2 = GUICtrlCreateButton("Exit", 8, 96, 153, 33, $WS_GROUP)
$Button3 = GUICtrlCreateButton("Realms", 168, 8, 97, 121, $WS_GROUP)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

GUICtrlSetOnEvent($Button1, "Reg")

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit

EndSwitch
WEnd

Func Reg()
ConsoleWrite("Adding" & @CRLF)
RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Test", "TestKey", "REG_SZ", "Hello this is a test")
ConsoleWrite("Added")
EndFunc

DllCall("kernel32.dll", "int", "Wow64DisableWow64FsRedirection", "int", 1)

No Syntax Errors

This world is crazy

  • Developers
Posted

Really i need this?

Don't know what you mean and hope you do not mean it the way you make it sound, but if you want to know if a function was successful or not you better check the retunrcode and @error.

Anyways, supply the info and you might get help.

Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Posted

I WAS SO STUPID!

on 64 bit Windoes i need

RegWrite("HKLM64\SOFTWARE\Test", "TestKey", "REG_SZ", "Hello this is a test")

...

Ok but if someone have 32 bit system...

Hmmm maybe

If @OSArch = x64 Then
RegWrite("HKLM64\SOFTWARE\Test", "TestKey", "REG_SZ", "Hello this is a test")
Else
RegWrite("HKLM\SOFTWARE\Test", "TestKey", "REG_SZ", "Hello this is a test")
EndIf

This world is crazy

Posted (edited)

Won't it be HKLM64 then instead of HKLM?

When running on 64-bit Windows if you want to write a key or value specific to the 64-bit environment you have to suffix the HK... with 64 i.e. HKLM64.

;)

Edit: Slightly too late...

Edited by Mat
Posted

x86 = 64bit system

x64 = 32bit system

<confused>

Is that right?

Otherway around but here is a little known trick for you. HKLM64 will work on either or at least it did, I haven't tried it recently.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...