findwindow

FindWindow with partial window title (Windows, C)

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 "Dat...

FindWindow vs GetActiveWindow - Why do they return differnt handles?

Anyone have an idea why this wouldn't work? IntPtr hWnd = FindWindow(null, "Calculator"); IntPtr hWnd2 = GetActiveWindow(); if(hWnd == hWnd2) { MessageBox.Show("Same"); } Invokes are: [DllImport("user32.dll")] static extern IntPtr GetActiveWindow(); [DllImport("user32.dll", SetLastError = true)] public static extern IntPtr Fin...

Capturing text from controls on a Java Applet

Is it possible to capture the text of say a Edit Box or Label control on a Java Applet? In a more traditional Win32 program this can be accomplished using FindWindow, FindWindowEx together with things like GetWindowText. I have investigated with WinSpy but the Java Applet is just one large window with no children. I am wondering if th...

Sending keystrokes from a C# application to a Java application - strange behaviour?

Hi. I'm trying to send keystrokes from my C# program to a Java application The code for sendig keys is: private void SendKeysToWindow(string WindowName, string KeysToSend) { IntPtr hWnd = FindWindow(null, WindowName); ShowWindowAsync(hWnd, SW_SHOWNORMAL); SetForegroundWindow(hWnd); SendKeys.Send(Key...

FindWindowEx giving me weird value !!

hello i've been starting some work with winAPI - Vb.net i'm using FindWindow and FindWindowEx but i'm having weird value when trying to get the handle of a control (right now i'm just trying to get the handle of button1 in my form .. economizing my ambitions :D) http://pic.leech.it/i/6ee4b/80a2540150133418.png but you can see that hCt...

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

Hello, 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 o...

How to use Control.FromHandle?

Hello there, i saw a method called Control.FromHandle wich (should) give you the access to it. Now, i wanted to try it using this code [DllImport("user32.dll", SetLastError = true)] static extern IntPtr FindWindow(string lpClassName, string lpWindowName); // Find window by Caption only. Note you must pass IntPtr.Zero as the...

how do i make this so everything can use it? C++

im somewhat new to c++ so i don't know how to do this but my main point in recoding this is to incress the speed of my program, i have been coding a project and my code is: HWND hWnd = FindWindow(NULL, L"*window's name*"); DWORD th32ProcId; HANDLE hProc; GetWindowThreadProcessId(hWnd, &th32ProcId); hProc = OpenProcess(PROCESS_VM_OPERA...

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

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 ...

Get window handle from window class name

I'm trying to get a window handle on a child window in my process and the only information I have is the window class name. Are there any win32 functions I can use for that? I'm doing this from C#. A bit more detail: This is a Visual Studio plugin, written in C#. So my process is visual studio, which has lots of windows. One of them ha...

Python Win32GUI Find Window

Hi, I have a GUI Windows application and I want to control it using the extension Win32gui in Python. How can I find the string s that I must give to the FindWindow function? I need to use the following code: import win32gui as gui gui.FindWindow(s, None) Thaks! ...

FindWindow doesn't return IntPtr.Zero, although the window is already closed

Hi. I'm trying to control a Java application from my C# program. Before the program begins to input data, it checks if there are any pervious data input windows, and tries to close them. The code for checking if a window exists is: public static bool WindowExists(string WindowName) { IntPtr hWnd = FindWindow(null, WindowName); ...

VB.net findwindow/findwindowex

Hey all, i am trying to figure out how to go about finding this window's label when the control name is the same as all the other labels on the program. WindowsForms10.STATIC.app.0.378734a WindowsForms10.STATIC.app.0.378734a WindowsForms10.STATIC.app.0.378734a All 3 labels are named the same. The one i am most interested in is a progr...

VB.net sendmessge to console box

Hey all, i am trying to send some text to a console box (dos box) from my vb program but i can not seem to get it working. Here is my current code: Dim blah As Long Private Const WM_GETTEXT As Integer = &HD Declare Auto Function SendMessage Lib "user32.dll" (ByVal hWnd As IntPtr, ByVal msg As Integer, ByVal wParam As IntPtr, ByVal lPar...

Use wildcards with FindWindow api call with mfc.

I am using FindWindow in an mfc application. HWND hWnd = ::FindWindow(NULL, _T("foobar v5")); I would like to use FindWindow with wildcards so that I can match just foobar. Thanks ...

Findwindow and SendMessage

Hey all i am trying to figure out why this is not sending a ALT+F to notepad! Private Declare Function FindWindow1 Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long Private Const WM_KEYUP = &H101 Private Const WM_KEYDOWN = &H100 Private Const WM_SYSKEYDOWN = &H104 Private Sub Command_C...