Skip to content

A simple class library to manage startup with windows in WPF applications.

License

Notifications You must be signed in to change notification settings

itniels/WPF-Startup-Manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WPF Startup Manager

A simple class library to manage startup with windows in WPF applications.

Features

  • Check if set as startup
  • Add to windows startup (Current User + All Users)
  • Remove from windows startup (Current User + All Users)
  • Check if user has administrator privileges.

Tested on

  • Windows 7
  • Windows 8
  • Windows 8.1
  • Windows 10 (Working)
  • Windows Server 2012 (Working)
  • Windows Server 2012 R2 (Working)

Installation

Download the .dll and add to references in your project.

or

Download the NuGet package here: https://www.nuget.org/packages/NovaKittySoftware.wpf.StartupManager/

Usage

Wpf Startup Manager has a few methods that can be called, and these will be explained here in detail. There are 3 groups within the namespace: 'NovaKittySoftware.wpf.StartupManager':

  • Admin
  • AllUsers
  • CurrentUser

These are pretty self explanatory (i hope) ;) and under each are the available public methods that you will need.

All methods return a boolean that is checked after the action is completed and you can test the output.

Just remember to be consistent with the application name! As this is what the library looks for in the registry.

Examples

Adding a program to widows startup for the current user only:

public void AddToStartup(){
  NovaKittySoftware.wpf.StartupManager.CurrentUser.AddApplicationToStartup(MyAppName);
}

Removing a program to widows startup for all users:

public void RemoveFromStartup(){
  NovaKittySoftware.wpf.StartupManager.AllUsers.RemoveApplicationFromStartup(MyAppName);
}

Check if application is set for startup or not for current user:

public void CheckStartup(){
  bool isStartup = NovaKittySoftware.wpf.StartupManager.CurrentUser.IsStartup(MyAppName);
}

Check if the current user is administrator:

public void CheckAdmin(){
  bool isAdmin = NovaKittySoftware.wpf.StartupManager.Admin.IsUserAdministrator();
}

About

A simple class library to manage startup with windows in WPF applications.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages