private static bool GetProcs() { // Check if this is a 32 bit application if (IntPtr.Size != 4) { #if DEBUG Console.WriteLine("Only 32 bit applications are supported."); #endif return(false); } // Check if the nvapi.dll is available if (LoadLibrary("nvapi.dll") == IntPtr.Zero) { #if DEBUG Console.WriteLine("The nvapi.dll could not be found."); #endif return(false); } try { CreateApplication = Marshal.GetDelegateForFunctionPointer(QueryInterface(0x4347A9DE), typeof(CreateApplicationDelegate)) as CreateApplicationDelegate; CreateProfile = Marshal.GetDelegateForFunctionPointer(QueryInterface(0xCC176068), typeof(CreateProfileDelegate)) as CreateProfileDelegate; CreateSession = Marshal.GetDelegateForFunctionPointer(QueryInterface(0x0694D52E), typeof(CreateSessionDelegate)) as CreateSessionDelegate; DeleteProfile = Marshal.GetDelegateForFunctionPointer(QueryInterface(0x17093206), typeof(DeleteProfileDelegate)) as DeleteProfileDelegate; DestroySession = Marshal.GetDelegateForFunctionPointer(QueryInterface(0xDAD9CFF8), typeof(DestroySessionDelegate)) as DestroySessionDelegate; EnumApplications = Marshal.GetDelegateForFunctionPointer(QueryInterface(0x7FA2173A), typeof(EnumApplicationsDelegate)) as EnumApplicationsDelegate; FindProfileByName = Marshal.GetDelegateForFunctionPointer(QueryInterface(0x7E4A9A0B), typeof(FindProfileByNameDelegate)) as FindProfileByNameDelegate; GetProfileInfo = Marshal.GetDelegateForFunctionPointer(QueryInterface(0x61CD6FD6), typeof(GetProfileInfoDelegate)) as GetProfileInfoDelegate; Initialize = Marshal.GetDelegateForFunctionPointer(QueryInterface(0x0150E828), typeof(InitializeDelegate)) as InitializeDelegate; LoadSettings = Marshal.GetDelegateForFunctionPointer(QueryInterface(0x375DBD6B), typeof(LoadSettingsDelegate)) as LoadSettingsDelegate; SaveSettings = Marshal.GetDelegateForFunctionPointer(QueryInterface(0xFCBC7E14), typeof(SaveSettingsDelegate)) as SaveSettingsDelegate; SetSetting = Marshal.GetDelegateForFunctionPointer(QueryInterface(0x577DD202), typeof(SetSettingDelegate)) as SetSettingDelegate; } catch (Exception) { #if DEBUG Console.WriteLine("The procs of nvapi.dll could not be retrieved."); #endif return(false); } return(true); }
public MainViewModel() { Settings.theSetting = new Settings(); Settings.theSetting.readTheFile(); MyMessageService.readTheFile(); //MyMessages = new ObservableCollection<Mail>(MyMessageService.SavedList.Values.ToList()); // --delegate subscription --- _deleteTheContact += Settings.theSetting.DeleteContact; createMessage += BaseMessageHandler.createMail; _deleteMail += MyMessageService.RemoveMessage; saveSettingsByDelegate += Settings.theSetting.saveTheFile; //_isSeen += BaseMessageHandler.MailIsSeen (Mail, theMail); //--- The Mail ---- //_sender = "Josefine"; //_receiver = "Mendokse"; //_subject = NewMail.Subject; //_messageContent = NewMail.Message; foreach (var contact in Settings.theSetting.myReceivers) { collectionOfContacts.Add(contact); } _theAddedContact.Name = ""; _listViewMeny = new ObservableCollection<string>(); _listViewMeny.Add("Inbox"); _listViewMeny.Add("New Message"); _listViewMeny.Add("Settings"); sendMailButton = "Send"; }
private static bool GetProcs() { // Check if this is a 32 bit application if (IntPtr.Size != 4) { #if DEBUG Console.WriteLine("Only 32 bit applications are supported."); #endif return false; } // Check if the nvapi.dll is available if (LoadLibrary("nvapi.dll") == IntPtr.Zero) { #if DEBUG Console.WriteLine("The nvapi.dll could not be found."); #endif return false; } try { CreateApplication = Marshal.GetDelegateForFunctionPointer(QueryInterface(0x4347A9DE), typeof(CreateApplicationDelegate)) as CreateApplicationDelegate; CreateProfile = Marshal.GetDelegateForFunctionPointer(QueryInterface(0xCC176068), typeof(CreateProfileDelegate)) as CreateProfileDelegate; CreateSession = Marshal.GetDelegateForFunctionPointer(QueryInterface(0x0694D52E), typeof(CreateSessionDelegate)) as CreateSessionDelegate; DeleteProfile = Marshal.GetDelegateForFunctionPointer(QueryInterface(0x17093206), typeof(DeleteProfileDelegate)) as DeleteProfileDelegate; DestroySession = Marshal.GetDelegateForFunctionPointer(QueryInterface(0xDAD9CFF8), typeof(DestroySessionDelegate)) as DestroySessionDelegate; EnumApplications = Marshal.GetDelegateForFunctionPointer(QueryInterface(0x7FA2173A), typeof(EnumApplicationsDelegate)) as EnumApplicationsDelegate; FindProfileByName = Marshal.GetDelegateForFunctionPointer(QueryInterface(0x7E4A9A0B), typeof(FindProfileByNameDelegate)) as FindProfileByNameDelegate; GetProfileInfo = Marshal.GetDelegateForFunctionPointer(QueryInterface(0x61CD6FD6), typeof(GetProfileInfoDelegate)) as GetProfileInfoDelegate; Initialize = Marshal.GetDelegateForFunctionPointer(QueryInterface(0x0150E828), typeof(InitializeDelegate)) as InitializeDelegate; LoadSettings = Marshal.GetDelegateForFunctionPointer(QueryInterface(0x375DBD6B), typeof(LoadSettingsDelegate)) as LoadSettingsDelegate; SaveSettings = Marshal.GetDelegateForFunctionPointer(QueryInterface(0xFCBC7E14), typeof(SaveSettingsDelegate)) as SaveSettingsDelegate; SetSetting = Marshal.GetDelegateForFunctionPointer(QueryInterface(0x577DD202), typeof(SetSettingDelegate)) as SetSettingDelegate; } catch (Exception) { #if DEBUG Console.WriteLine("The procs of nvapi.dll could not be retrieved."); #endif return false; } return true; }