You can set your application to run on startup using the registery. You add your application into the registry by using this code. Then just add the code you want to run to check for any new mail on the Form Load event.
VB Code:
Microsoft.Win32.RegistryKey regKey = Microsoft.Win32.Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Run", true); if (chkStartup.Checked == true) { // Set the program to start with Windows: regKey.SetValue(Application.ProductName, Application.ExecutablePath); } else if (regKey.GetValue(Application.ProductName) != null) { regKey.DeleteValue(Application.ProductName); }




Reply With Quote