/// <summary> /// 重写WndProc函数,类型为虚保护,响应窗体消息事件 /// </summary> /// <param name="hwnd"></param> /// <param name="msg">消息内容</param> /// <param name="wParam"></param> /// <param name="lParam"></param> /// <param name="handled">是否相应完成</param> /// <returns></returns> protected virtual IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled) { const int WM_HOTKEY = 0x0312;//如果m.Msg的值为0x0312那么表示用户按下了热键 if (msg == WM_HOTKEY) { if (Var.bLogin) { switch (wParam.ToInt32()) { case 104: //按下的是F6 this.WindowState = System.Windows.WindowState.Minimized; break; case 102: //按下的是F4 Var.PayChannel = 2; if (Var.bAlreadyOpen == false) { Var.bAlreadyOpen = true; PayWindow pay = new PayWindow(); pay.ShowDialog(); Var.bAlreadyOpen = false; } break; case 101: //按下的是F3 Var.PayChannel = 1; if (Var.bAlreadyOpen == false) { Var.bAlreadyOpen = true; PayWindow pay = new PayWindow(); pay.ShowDialog(); Var.bAlreadyOpen = false; } break; case 105: if (Var.bAlreadyOpen == false) { Var.bAlreadyOpen = true; SetAmountPosition win = new SetAmountPosition(); if (!win.IsVisible) { win.ShowDialog(); } else { win.Activate(); } Var.bAlreadyOpen = false; } break; } } } return(IntPtr.Zero); }
private void btPosition_Click(object sender, RoutedEventArgs e) { //ParmIni.IniWriteValue("CaptureScreen", "Left", tBoxCaptureScreen_Left.Text); //ParmIni.IniWriteValue("CaptureScreen", "Top", tBoxCaptureScreen_Top.Text); //ParmIni.IniWriteValue("CaptureScreen", "Width", tBoxCaptureScreen_Width.Text); //ParmIni.IniWriteValue("CaptureScreen", "Height", tBoxCaptureScreen_Height.Text); SetAmountPosition win = new SetAmountPosition(); if (!win.IsVisible) { win.ShowDialog(); } else { win.Activate(); } }
void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target) { switch (connectionId) { case 1: this.SetAmountPage = ((UBPayApp.SetAmountPosition)(target)); #line 12 "..\..\..\SetAmountPosition.xaml" this.SetAmountPage.Loaded += new System.Windows.RoutedEventHandler(this.SetAmountPage_Loaded); #line default #line hidden return; case 2: this.btn_SettingAmountPosition = ((System.Windows.Controls.Button)(target)); #line 19 "..\..\..\SetAmountPosition.xaml" this.btn_SettingAmountPosition.Click += new System.Windows.RoutedEventHandler(this.btn_SettingAmountPosition_Click); #line default #line hidden return; case 3: this.lable0 = ((System.Windows.Controls.Label)(target)); return; case 4: this.lable1 = ((System.Windows.Controls.Label)(target)); return; case 5: this.lable2 = ((System.Windows.Controls.Label)(target)); return; case 6: this.lable3 = ((System.Windows.Controls.Label)(target)); return; case 7: this.lable4 = ((System.Windows.Controls.Label)(target)); return; case 8: this.lb_left = ((System.Windows.Controls.Label)(target)); return; case 9: this.lb_top = ((System.Windows.Controls.Label)(target)); return; case 10: this.lb_width = ((System.Windows.Controls.Label)(target)); return; case 11: this.lb_height = ((System.Windows.Controls.Label)(target)); return; } this._contentLoaded = true; }