|
-
Sep 12th, 2000, 07:09 PM
#1
Thread Starter
Junior Member
my project is for pc security i change some values
in registry like in system policies i hide ihe icon from
the desktop
butto take effect i must restart or log off
but i need to make it take effect now but how i need to hide icon by one click on show it by another
-
Sep 12th, 2000, 07:29 PM
#2
To restart or log off the computer, use the ExitWindowsEx api function.
Code:
Declare Function ExitWindowsEx Lib "user32.dll" _
(ByVal uFlags As Long, ByVal dwReserved As Long) As Long
EWX_FORCE = 4
EWX_LOGOFF = 0
EWX_REBOOT = 2
'Reboot
Dim retval As Long
retval = ExitWindowsEx(EWX_REBOOT Or EWX_FORCE, 0)
If retval = 0 Then Msgbox "Error: Cannot reboot!", vbCritical
'Log Off
Dim retval As Long
retval = ExitWindowsEx(EWX_LOGOFF Or EWX_FORCE, 0)
If retval = 0 Then Msgbox "Error: Cannot reboot!", vbCritical
To hide an icon, use the SetAttr statement to hide a program.
Code:
'A program
SetAttr "C:\Program.exe", vbHidden
'Your program
SetAttr App.Path & "\" & App.EXEName & ".exe", vbHidden
-
Sep 12th, 2000, 08:06 PM
#3
Thread Starter
Junior Member
no
no
i want to apply settings without restarting maybe
by using api
-
Sep 13th, 2000, 11:13 AM
#4
Thread Starter
Junior Member
-
Sep 13th, 2000, 11:27 AM
#5
Frenzied Member
no!
I can't help you, but I can give you a tip.
Be kind to people who try to help you (read: Matthew Gates) by at least saying "Thanks for the help but...", not "no I want this or that", and if you're inpatient don't say "Help me" (it's more like an order then a question) but say "I'm desperate, please help me!" 
Anyway, you will be much more appriciated (read: helped) if you are kind to people...
Jop - validweb.nl
Alcohol doesn't solve any problems, but then again, neither does milk.
-
Sep 13th, 2000, 01:35 PM
#6
I don't think there is any API function that can do this. Only because, when you change something important, Windows restarting is a must. Because it saves the settings when Windows exits and once it restarts, it reads the new information.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|