Results 1 to 6 of 6

Thread: no need to log off or restart

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Aug 2000
    Location
    egypt
    Posts
    25

    Arrow

    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

  2. #2
    Guest
    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

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Aug 2000
    Location
    egypt
    Posts
    25

    no

    no
    i want to apply settings without restarting maybe
    by using api

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Aug 2000
    Location
    egypt
    Posts
    25

    help me

    help me

  5. #5
    Frenzied Member Jop's Avatar
    Join Date
    Mar 2000
    Location
    Amsterdam, the Netherlands
    Posts
    1,986
    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.

  6. #6
    Guest
    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
  •  



Click Here to Expand Forum to Full Width