ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

Other Software > Developer's Corner

Apply changes in Registry immediately

<< < (2/3) > >>

MilesAhead:
Hello MilesAhead,

Thanks again. I appreciate it.

The code I use does change the value in the registry; - it doesn't apply it immediately.
Your replies are very helpful. I'll wait a bit.

Best wishes.
-Yaron (July 03, 2015, 06:22 PM)
--- End quote ---

I found this API call that may be worth reading.

https://msdn.microsoft.com/en-us/library/windows/desktop/ms724867%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396

mouser:
It's a shame but I don't believe there is truly a way to make the system readjust to some registry changes without a reboot.

Yaron:
@MilesAhead,

Persistent as always. :) I'm truly grateful.

I think that "Components.interfaces.nsIWindowsRegKey" uses that API.

I posted the question here and Mike referred me to the SystemParametersInfo function.

So, the following code works:


--- Code: Javascript ---Components.utils.import("resource://gre/modules/ctypes.jsm");let lib = ctypes.open("user32.dll"); let fontSmooth = lib.declare("SystemParametersInfoW", ctypes.winapi_abi, ctypes.bool, ctypes.unsigned_int, ctypes.unsigned_int, ctypes.voidptr_t, ctypes.unsigned_int); fontSmooth(0x004B, true, ctypes.voidptr_t(0), 0);   // 0x004B = SPI_SETFONTSMOOTHING. true/false = toggle font smoothing. lib.close();
Best regards.

***
@mouser,

Thanks for replying. I really appreciate it.

Best regards.

MilesAhead:
@MilesAhead,

Persistent as always. :) I'm truly grateful.

I think that "Components.interfaces.nsIWindowsRegKey" uses that API.

I posted the question here and Mike referred me to the SystemParametersInfo function.

So, the following code works:
-Yaron (July 04, 2015, 04:25 PM)
--- End quote ---

Thanks for posting how you solved it.  I tried a little JavaScript back around the year 2000. (Just struggled with beginner code.)  I am glad to see it has some serious capabilities. Very cool.

Yaron:
Hi MilesAhead,

Thank you.

I have very little experience in development; - I wouldn't know where to start creating a nice app like "MoveIt".
With your talent, I'm sure you could contribute a lot to Firefox and Firefox add-ons. I think you would enjoy it as well.

http://forums.mozillazine.org/viewforum.php?f=19

I wish you the very best.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version