//using Muchinfo.MTPClient.Controls; using System.Windows; using Muchinfo.MTPClient.UI.ViewModels; namespace Muchinfo.MTPClient.UI.Views { /// /// InputTradePassWordView.xaml 的交互逻辑 /// public partial class InputTradePassWordView :Window { //private const int GWL_STYLE = -16; //private const int WS_SYSMENU = 0x80000; //[DllImport("user32.dll", SetLastError = true)] //private static extern int GetWindowLong(IntPtr hWnd, int nIndex); //[DllImport("user32.dll")] //private static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong); //[DllImport("user32", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)] //private static extern int GetSystemMenu(int hwnd, int revert); //[DllImport("user32", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)] //private static extern int EnableMenuItem(int menu, int ideEnableItem, int enable); //private const int SC_CLOSE = 0xF060; //private const int MF_BYCOMMAND = 0x00000000; //private const int MF_GRAYED = 0x00000001; //private const int MF_ENABLED = 0x00000002; public InputTradePassWordView() { InitializeComponent(); this.DataContext = new InputTradePassWordViewModel(); } private void InputTradePassWordView_OnClosing(object sender, System.ComponentModel.CancelEventArgs e) { //var result = MessageBoxHelper.ShowInfo("请输入交易密码,解锁进入主界面"); } //public static void Disable(int handle) //{ // // The return value specifies the previous state of the menu item // // (it is either MF_ENABLED or MF_GRAYED). 0xFFFFFFFF indicates that // // the menu item does not exist. // switch (EnableMenuItem(GetSystemMenu(handle, 0), SC_CLOSE, MF_BYCOMMAND | MF_GRAYED)) // { // case MF_ENABLED: // break; // case MF_GRAYED: // break; // case -1: // throw new Exception("The Close menu item does not exist."); // default: // break; // } //} private void InputTradePassWordView_OnLoaded(object sender, RoutedEventArgs e) { //var hwnd = new WindowInteropHelper(this).Handle; //SetWindowLong(hwnd, GWL_STYLE, GetWindowLong(hwnd, GWL_STYLE) & ~WS_SYSMENU); //int handle = new WindowInteropHelper(this).Handle.ToInt32(); //Disable(handle); } //protected override void OnClosing(System.ComponentModel.CancelEventArgs e) //{ // e.Cancel = true; //} } }