| |

VerySource

 Forgot password?
 Register
Search
View: 791|Reply: 8

How to make the registry changes take effect immediately?

[Copy link]

1

Threads

12

Posts

12.00

Credits

Newbie

Rank: 1

Credits
12.00

 China

Post time: 2020-1-31 18:20:01
| Show all posts |Read mode
After modifying the registry, how can I make it take effect immediately without restarting? You can end the explorer process manually and then start it again to take effect.
How can I get it in the program? Just like the Group Policy Editor, clicking Apply will take effect immediately.
Reply

Use magic Report

0

Threads

32

Posts

27.00

Credits

Newbie

Rank: 1

Credits
27.00

 Invalid IP Address

Post time: 2020-3-10 23:45:01
| Show all posts
You should be able to log out.
Reply

Use magic Report

1

Threads

12

Posts

12.00

Credits

Newbie

Rank: 1

Credits
12.00

 China

 Author| Post time: 2020-3-11 12:00:02
| Show all posts
Yes, how is it used in the program, and what functions are available? Thank you!
Reply

Use magic Report

0

Threads

5

Posts

5.00

Credits

Newbie

Rank: 1

Credits
5.00

 China

Post time: 2020-3-11 18:00:02
| Show all posts
First, the registry changes are effective immediately.

What you said is effective, just let the program that reads the value in the registry read it again.
So what you want to achieve is to be able to reload the programs that read the registry.
Reply

Use magic Report

0

Threads

59

Posts

43.00

Credits

Newbie

Rank: 1

Credits
43.00

 China

Post time: 2020-3-11 20:00:01
| Show all posts
// logout code
   HANDLE hToken;
   TOKEN_PRIVILEGES tkp;
 
   // Get a token for this process.
 
   if (! OpenProcessToken (GetCurrentProcess (),
        TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY,&hToken))
      return (FALSE);
 
   // Get the LUID for the shutdown privilege.
 
   LookupPrivilegeValue (NULL, SE_SHUTDOWN_NAME,
        &tkp.Privileges [0] .Luid);
 
   tkp.PrivilegeCount = 1; // one privilege to set
   tkp.Privileges [0] .Attributes = SE_PRIVILEGE_ENABLED;
 
   // Get the shutdown privilege for this process.
 
   AdjustTokenPrivileges (hToken, FALSE,&tkp, 0,
        (PTOKEN_PRIVILEGES) NULL, 0);
 
   if (GetLastError ()! = ERROR_SUCCESS)
      return FALSE;
 
   // Shut down the system and force all applications to close.
 
   if (! ExitWindowsEx (EWX_LOGOFF | EWX_FORCE, 0))
      return FALSE;
Reply

Use magic Report

0

Threads

3

Posts

0.00

Credits

Newbie

Rank: 1

Credits
0.00

 China

Post time: 2020-3-12 09:29:52
| Show all posts
It depends on what process your modified registry affects. If it affects desktop operation, directly end the explorer.exe process and create another one without registration. If it is another process, the same, just restart the process!
Reply

Use magic Report

1

Threads

12

Posts

12.00

Credits

Newbie

Rank: 1

Credits
12.00

 China

 Author| Post time: 2020-3-12 10:15:01
| Show all posts
How do I end the explorer process in the program and then reopen it? How is the application implemented?
Reply

Use magic Report

1

Threads

12

Posts

12.00

Credits

Newbie

Rank: 1

Credits
12.00

 China

 Author| Post time: 2020-4-27 20:00:01
| Show all posts
How can I end a process in the program?
Reply

Use magic Report

1

Threads

12

Posts

12.00

Credits

Newbie

Rank: 1

Credits
12.00

 China

 Author| Post time: 2020-7-7 00:15:01
| Show all posts
I checked online, ::SendMessage(HWND_BROADCAST, WM_SETTINGCHANGE, NULL, NULL) can meet the requirements!
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list