InputTradePassWordView.xaml.cs 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. //using Muchinfo.MTPClient.Controls;
  2. using System.Windows;
  3. using Muchinfo.MTPClient.UI.ViewModels;
  4. namespace Muchinfo.MTPClient.UI.Views
  5. {
  6. /// <summary>
  7. /// InputTradePassWordView.xaml 的交互逻辑
  8. /// </summary>
  9. public partial class InputTradePassWordView :Window
  10. {
  11. //private const int GWL_STYLE = -16;
  12. //private const int WS_SYSMENU = 0x80000;
  13. //[DllImport("user32.dll", SetLastError = true)]
  14. //private static extern int GetWindowLong(IntPtr hWnd, int nIndex);
  15. //[DllImport("user32.dll")]
  16. //private static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong);
  17. //[DllImport("user32", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
  18. //private static extern int GetSystemMenu(int hwnd, int revert);
  19. //[DllImport("user32", CharSet = CharSet.Ansi, SetLastError = true, ExactSpelling = true)]
  20. //private static extern int EnableMenuItem(int menu, int ideEnableItem, int enable);
  21. //private const int SC_CLOSE = 0xF060;
  22. //private const int MF_BYCOMMAND = 0x00000000;
  23. //private const int MF_GRAYED = 0x00000001;
  24. //private const int MF_ENABLED = 0x00000002;
  25. public InputTradePassWordView()
  26. {
  27. InitializeComponent();
  28. this.DataContext = new InputTradePassWordViewModel();
  29. }
  30. private void InputTradePassWordView_OnClosing(object sender, System.ComponentModel.CancelEventArgs e)
  31. {
  32. //var result = MessageBoxHelper.ShowInfo("请输入交易密码,解锁进入主界面");
  33. }
  34. //public static void Disable(int handle)
  35. //{
  36. // // The return value specifies the previous state of the menu item
  37. // // (it is either MF_ENABLED or MF_GRAYED). 0xFFFFFFFF indicates that
  38. // // the menu item does not exist.
  39. // switch (EnableMenuItem(GetSystemMenu(handle, 0), SC_CLOSE, MF_BYCOMMAND | MF_GRAYED))
  40. // {
  41. // case MF_ENABLED:
  42. // break;
  43. // case MF_GRAYED:
  44. // break;
  45. // case -1:
  46. // throw new Exception("The Close menu item does not exist.");
  47. // default:
  48. // break;
  49. // }
  50. //}
  51. private void InputTradePassWordView_OnLoaded(object sender, RoutedEventArgs e)
  52. {
  53. //var hwnd = new WindowInteropHelper(this).Handle;
  54. //SetWindowLong(hwnd, GWL_STYLE, GetWindowLong(hwnd, GWL_STYLE) & ~WS_SYSMENU);
  55. //int handle = new WindowInteropHelper(this).Handle.ToInt32();
  56. //Disable(handle);
  57. }
  58. //protected override void OnClosing(System.ComponentModel.CancelEventArgs e)
  59. //{
  60. // e.Cancel = true;
  61. //}
  62. }
  63. }