findwindow

Click on button in another program - FindWindow, C#

本小妞迷上赌 提交于 2019-12-20 03:13:58
问题 I'm trying to create a program that will be able to control another program (in Windows). I found this code: // Get a handle to an application window. [DllImport("USER32.DLL", CharSet = CharSet.Unicode)] public static extern IntPtr FindWindow(string lpClassName, string lpWindowName); // Activate an application window. [DllImport("USER32.DLL")] public static extern bool SetForegroundWindow(IntPtr hWnd); //button event private void button1_Click(object sender, EventArgs e) { // Get a handle to

user32.dll FindWindowEx, finding elements by classname on remote WPF window

吃可爱长大的小学妹 提交于 2019-12-12 10:25:39
问题 I have a WPF application that is being started from a command-line application. I am trying to do some simple automation (get/set text, click some buttons, etc). I cannot seem to find any of the child windows in WPF. I have working models with WPF and UIA Framework, WinForms and WinAPI, but cannot seem to get WinAPI and WPF to play nicely. I have used UISpy, WinSpy++, Winspector, the UIA Verify app to look at the controls, etc, but they do not seem to carry the same information for WPF as

Sending a restore message from FM to another Application

旧时模样 提交于 2019-12-12 04:16:35
问题 I was provided some great help in finding if a window existed in FM. Now I need to know how to restore that window , if it does exists. thanks function WindowExists(const TitleName: string): Boolean; begin Result := Winapi.Windows.FindWindow(nil, PChar(TitleName)) <> 0; end; 回答1: Call ShowWindow passing the window handle and the SW_RESTORE flag. 来源: https://stackoverflow.com/questions/34004258/sending-a-restore-message-from-fm-to-another-application

Find Window At Location Using Carbon And Carbon Problems In 64-Bit Applications

ⅰ亾dé卋堺 提交于 2019-12-11 15:39:05
问题 As I said in some questions today I´m looking for the way to get window or windowPart references at a certain location. Although I know I could use Cocoa for this purpose (I don´t know how to do it yet) I prefer (and probably need) to do this using Carbon because the entire application that needs this functionality is written in C++ but I´ve found many problems trying it. Does anyone get a valid windowPtr or windowRef using one of the following functions? FindWindow, MacFindWindow,

C++ Handle as HWND?

淺唱寂寞╮ 提交于 2019-12-11 14:49:58
问题 I was wondering whether you can convert a handle to a window "HWND". I need to call the "PostMessage" function using the "FindWindow" method. I currently have to source HANDLE mainProcess; BOOL APIENTRY ATTACH_PROCESS(int ProcessID) { mainProcess = OpenProcess(PROCESS_ALL_ACCESS, true, ProcessID); return TRUE; } BOOL APIENTRY SEND_INPUT(/*NOT USED FOR THIS SAMPLE*/ const char* String, bool Keydown) { int ToDo = WM_KEYUP; if (Keydown) ToDo = WM_KEYDOWN; return PostMessage((HWND)mainProcess,

FindWindowEx - Select textbox if there are several textboxes with same classname

坚强是说给别人听的谎言 提交于 2019-12-11 07:22:07
问题 I want to use SendMessage/PostMessage to send some keys to an applications textbox. I used Microsoft Spyxx to get class name of this textbox. Now I have the problem that there are several textboxes in this app with the same class-Name ("WindowsForms10.EDIT.app.0.2e0c681") and same Window-name. How to get the handle of the right one? PS: I'm coding in c# with Visual c# 2008 express 回答1: Well, there must be something you do know about the textboxe that you could use: For instance you could

create the function “find window…” of spy++ in C#

 ̄綄美尐妖づ 提交于 2019-12-10 17:34:52
问题 I want to create the same function "Find windows..." of spy++ in C#. I have try with this function of the WINAPI: HWND WINAPI WindowFromPoint(__in POINT Point); http://msdn.microsoft.com/en-US/library/ms633558.aspx But i don't arrive to get all element with that, because they are disabled or hidden. For example with the window 7 calculator in Programmer mode, i cannot get the "A B C D E F" with my program if they are disable then spy++ can get it. Edit: I have try this but it don't working:

FindWindow() doesn't find my window [C++]

隐身守侯 提交于 2019-12-10 17:00:56
问题 This is not a complex question. I'm having trouble finding the handle that belongs to iTunes. But although iTunes is running in the background, it keeps telling me it can't find the window. So I went on checking whether I miss typed the window name, but spy++ pointed out to me that I was using the correct window name and class name (see below). I'm sure it's a small mistake but I can't seem to find it. Does anyone have an insight? Thanks in advance. HWND hwnd; hwnd = FindWindow((LPCWSTR)

FindWindow with partial window title (Windows, C)

浪子不回头ぞ 提交于 2019-12-07 20:13:15
问题 Is there any API similar to FindWindow() but that searches the windows by partial title? The reason is that I need to the handle to a window that has a fix part on the title but the other part changes constantly. So for example the window title could be: DataBase read: XYDB or DataBase read: WZDB in the examples the fix part is "DataBase read:" Code appreciated. Thanks 回答1: An example using EnumWindows: BOOL CALLBACK WorkerProc(HWND hwnd, LPARAM lParam) { static TCHAR buffer[50];

FindWindow error 183

谁都会走 提交于 2019-12-07 07:41:43
问题 Does anybody know what would cause the FindWindow function to return the error: ALREADY_EXISTS error (183) I could understand a FILE_NOT_FOUND (2) , but why would it return a 183 ? 回答1: MSDN says, that FindWindowand FindWindowEx return NULL if the function fails and that you should check GetLastError . It seems that this documentation is wrong. Take this code fragment: SetLastError(12345); HWND h = FindWindow(L"class_name_that_does_not_exist", nullptr); cout << h << ' ' << GetLastError() <<