public void endTx() { // throw new System.NotImplementedException(); int x = get_current_x(tx_stop_x); int y = get_current_y(tx_stop_y); IntPtr lParam = (IntPtr)((y << 16) | x); // The coordinates IntPtr wParam = IntPtr.Zero; // Additional parameters for the click (e.g. Ctrl) CppDLL.PostMessage(ControlHwd, CppDLL.WM_LBUTTONDOWN, wParam, lParam); CppDLL.PostMessage(ControlHwd, CppDLL.WM_LBUTTONUP, wParam, lParam); }
public void StartControl() { // throw new System.NotImplementedException(); CppDLL.Delay(2000); //Set_CC_ID(CC_ID); IntPtr hwnd = MainHwd; int x = get_current_x(cc_control_x); int y = get_current_y(cc_control_y); IntPtr lParam = (IntPtr)((y << 16) | x); // The coordinates IntPtr wParam = IntPtr.Zero; // Additional parameters for the click (e.g. Ctrl) CppDLL.PostMessage(hwnd, CppDLL.WM_LBUTTONDOWN, wParam, lParam); CppDLL.PostMessage(hwnd, CppDLL.WM_LBUTTONUP, wParam, lParam); CppDLL.PostMessage(hwnd, CppDLL.WM_LBUTTONDBLCLK, wParam, lParam); CppDLL.PostMessage(hwnd, CppDLL.WM_LBUTTONUP, wParam, lParam); CppDLL.Delay(6000); hwnd = CppDLL.FindWindow(null, USB_ID_CC + " - CC2540 - Device Control Panel"); ControlHwd = hwnd; x = get_current_x(continue_tx_x); y = get_current_y(continue_tx_y); lParam = (IntPtr)((y << 16) | x); // The coordinates wParam = IntPtr.Zero; // Additional parameters for the click (e.g. Ctrl) CppDLL.PostMessage(hwnd, CppDLL.WM_LBUTTONDOWN, wParam, lParam); CppDLL.PostMessage(hwnd, CppDLL.WM_LBUTTONUP, wParam, lParam); //maxim control window CppDLL.PostMessage(ControlHwd, CppDLL.WM_Command, (IntPtr)0xf030, (IntPtr)0); }
public void ResetFreqComb() { //throw new System.NotImplementedException(); endTx(); for (int count = 0; count < ((CurrentFreq - 2402) / 2); count++) { int x = get_current_x(combo_line_x); int y = get_current_y(combo_line_y); IntPtr wParam = (IntPtr)(120 << 16); IntPtr lParam = (IntPtr)((y << 16) | x); CppDLL.PostMessage(FreqCombHwd, CppDLL.WM_MouseWheel, wParam, lParam); CppDLL.Delay(100); } // CurrentFreq = 2402; }
public void SetFreq(int freq) { // throw new System.NotImplementedException(); CppDLL.Delay(100); int deltafreq = (freq - CurrentFreq) / 2; if (deltafreq > 0) { for (int count = 0; count < (deltafreq); count++) { int x = get_current_x(combo_line_x); int y = get_current_y(combo_line_y); IntPtr wParam = (IntPtr)((-120 << 16) | 0x00); IntPtr lParam = (IntPtr)((y << 16) | x); CppDLL.PostMessage(FreqCombHwd, CppDLL.WM_MouseWheel, wParam, lParam); CppDLL.Delay(100); } } else { for (int count = 0; count < (-1 * deltafreq); count++) { int x = get_current_x(combo_line_x); int y = get_current_y(combo_line_y); IntPtr wParam = (IntPtr)((120 << 16) | 0x00); IntPtr lParam = (IntPtr)((y << 16) | x); CppDLL.PostMessage(FreqCombHwd, CppDLL.WM_MouseWheel, wParam, lParam); CppDLL.Delay(100); } } CurrentFreq = freq; }
public void endControl() { //throw new System.NotImplementedException(); CppDLL.PostMessage(ControlHwd, CppDLL.WM_Close, IntPtr.Zero, IntPtr.Zero); // CppDLL.PostMessage(ControlHwd, CppDLL.WM_Command, (IntPtr)0xf030, (IntPtr)0); }
public void FocusFreqComb() { // throw new System.NotImplementedException(); int x = get_current_x(freq_combo_x);//int((float) freq_combo_x*(float)(float)current_screen_x_pixels/(float)screen_x_base); int y = get_current_y(freq_combo_y); IntPtr lParam = (IntPtr)((y << 16) | x); // The coordinates IntPtr wParam = IntPtr.Zero; // Additional parameters for the click (e.g. Ctrl) CppDLL.PostMessage(ControlHwd, CppDLL.WM_LBUTTONDOWN, wParam, lParam); CppDLL.PostMessage(ControlHwd, CppDLL.WM_LBUTTONUP, wParam, lParam); CppDLL.Delay(1000); //x = 482; //y = 122; //lParam = (IntPtr)((y << 16) | x); // The coordinates //wParam = IntPtr.Zero; // Additional parameters for the click (e.g. Ctrl) // CppDLL.PostMessage(ControlHwd,CppDLL. WM_LBUTTONDOWN, wParam, lParam); // CppDLL.PostMessage(ControlHwd, CppDLL.WM_LBUTTONUP, wParam, lParam); IntPtr control_window, freq_window, second_hw, third_hw; control_window = ControlHwd; freq_window = CppDLL.FindWindowEx(control_window, IntPtr.Zero, null, ""); second_hw = CppDLL.FindWindowEx(control_window, freq_window, null, ""); third_hw = CppDLL.FindWindowEx(control_window, second_hw, null, ""); freq_window = CppDLL.FindWindowEx(third_hw, IntPtr.Zero, null, "qt_scrollarea_viewport"); second_hw = CppDLL.FindWindowEx(freq_window, IntPtr.Zero, null, "centralWidgetMain"); freq_window = CppDLL.FindWindowEx(second_hw, IntPtr.Zero, null, ""); third_hw = CppDLL.FindWindowEx(freq_window, IntPtr.Zero, null, "RFParameters"); second_hw = third_hw; third_hw = IntPtr.Zero; for (int count = 0; count < 9; count++) { freq_window = CppDLL.FindWindowEx(second_hw, third_hw, "QWidget", null);//RF Parameters third_hw = freq_window; } FreqCombHwd = freq_window; // x = 463; // y = 115; // lParam = (IntPtr)((y << 16) | x); // The coordinates // wParam = IntPtr.Zero; // Additional parameters for the click (e.g. Ctrl) // CppDLL.PostMessage(ControlHwd, CppDLL.WM_LBUTTONDOWN, wParam, lParam); // CppDLL.PostMessage(ControlHwd, CppDLL.WM_LBUTTONUP, wParam, lParam); }
public void exitApp() { CppDLL.PostMessage(MainHwd, CppDLL.WM_Close, IntPtr.Zero, IntPtr.Zero); }