Messages - Yaron [ switch to compact view ]

Pages: prev1 2 [3] 4 5next
11
Developer's Corner / Re: Apply changes in Registry immediately
« on: July 04, 2015, 04:25 PM »
@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 [Select]
  1. Components.utils.import("resource://gre/modules/ctypes.jsm");
  2. let lib = ctypes.open("user32.dll");
  3.  
  4. let fontSmooth = lib.declare("SystemParametersInfoW", ctypes.winapi_abi, ctypes.bool, ctypes.unsigned_int, ctypes.unsigned_int, ctypes.voidptr_t, ctypes.unsigned_int);
  5.  
  6. fontSmooth(0x004B, true, ctypes.voidptr_t(0), 0);   // 0x004B = SPI_SETFONTSMOOTHING. true/false = toggle font smoothing.
  7.  
  8. lib.close();

Best regards.

***
@mouser,

Thanks for replying. I really appreciate it.

Best regards.

12
Developer's Corner / Re: Apply changes in Registry immediately
« on: July 03, 2015, 06:22 PM »
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.

13
Developer's Corner / Re: Apply changes in Registry immediately
« on: July 03, 2015, 05:01 PM »
Hello my friend,

I hope you're doing well.

Thank you for this reply.
And also many thanks for "MoveIt" and "Process Counter"; - I use both frequently and really enjoy them.

I think there's a way to update the registry from a Firefox extension without using external applications.
So, I'd rather wait. Please don't consider this ungrateful. :)

Can you think of other good forums I can post this question? I'd appreciate that.

Have a great weekend.

14
Developer's Corner / Apply changes in Registry immediately
« on: July 03, 2015, 03:42 PM »
Hello,

The following code (in a Firefox extension) toggles the value of the "FontSmoothing" Registry-Key.

Code: Javascript [Select]
  1. let regFontSmooth = Components.classes["@mozilla.org/windows-registry-key;1"].createInstance(Components.interfaces.nsIWindowsRegKey);
  2. regFontSmooth.open(regFontSmooth.ROOT_KEY_CURRENT_USER, "Control Panel\\Desktop", regFontSmooth.ACCESS_ALL);
  3. regFontSmooth.writeStringValue("FontSmoothing", regFontSmooth.readStringValue("FontSmoothing") == 0 ? 2 : 0);
  4. regFontSmooth.close();

How do I apply the changes immediately (without a reboot or restarting Windows Explorer?

Thank you.


Pages: prev1 2 [3] 4 5next
Go to full version