Questions tagged [findwindow]

FindWindow is a Win32 API function from user32.dll retrieving a handle to the top-level window whose class name and window name match the specified strings.

FindWindow function

Please note that it works in current process only! For global search use EnumWindows and EnumWindowsProc functions.

This function does not search child windows. This function does not perform a case-sensitive search.
To search child windows, beginning with a specified child window, use the FindWindowEx function.

150 questions
2
votes
2 answers

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

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); …
Miklós
  • 223
  • 1
  • 2
  • 9
2
votes
1 answer

Click A MessageBox button programmatically

As the title suggests, I'm trying to simulate a button-click in a MessageBox programmatically. I earlier tried to close the MessageBox by finding its handle via its caption, and applying WM_CLOSE or SC_CLOSE in SendMessage(). However, due to the…
PritishC
  • 508
  • 8
  • 18
2
votes
1 answer

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…
wonderer
  • 3,487
  • 11
  • 49
  • 59
2
votes
2 answers

Get the window handle of an externally running program through C++

There is an externally running program that i need the capability to resize. The kicker for me is that part of the title is the version and other specific information related to that instance. I know the substring that should be consistent across…
Jason
  • 2,147
  • 6
  • 32
  • 40
2
votes
1 answer

c++ find process handle without FindWindow function

i tryied to find the process handle, HWND handle = FindWindow(0 ,TEXT("window title")); i need window title Let's say that I have tow process with the same title so i want to make something like: for each p as process in…
yair a
  • 41
  • 2
  • 7
1
vote
1 answer

python FindWindow by hex value

I run this code and get a list of all windows in return. def winEnumHandler(hwnd, ctx): if win32gui.IsWindowVisible(hwnd): # print(hex(hwnd), win32gui.GetWindowText(hwnd)) print( "{:} - [{:}] - {:}".format(hex(hwnd),…
1
vote
0 answers

How to find a window by FindWindowW from the unicode window title text?

I have tried to use GetWindowTextW to extract the window title text successfully, and it is a unicode text. When I use FindWindowW to find the window, it failed and the returned Hwnd is 0. The window with the unicode title: The code on VB6 is…
SuperBerry
  • 1,193
  • 1
  • 12
  • 28
1
vote
1 answer

C# Automation Click Button On Windows 10 Calculator

So I am new to C# and I would like to make an automation that will click few buttons on Win10 Calculator I downloaded LeanRunner Designer and used it's Model Manager to get Calculator button properties of number 5 and I got: Auto.getWindow({ …
1
vote
0 answers

Embarcadero findwindow Chrome

I want to copy some selected text from Chrome screen by clicking on a button on a Delphi program. I know I can do it with a code like this but I can't do it for Chrome cause I can't find the name for Chrome. Can anyone tell me how to do that on…
1
vote
2 answers

Program making use of FindWindowEx stops working on Server 2003, why?

I have a simple program that uses FindWindowEx & strncmp() inside a callback passed to EnumChildWindows, to find a dialog created by a third party application, and press a button. This code works fine on my Windows 7 Ultimate PC, but if I run it on…
sebf
  • 2,831
  • 5
  • 32
  • 50
1
vote
1 answer

ShowWindow restores the window only if is the last minimized

I'm trying to make a program in C++ that shows a minimized calculator. It works if I minimize it, but if I minimize the Calculator and then another program like firefox, the program doesn't show the calculator anymore. int main() { hwnd =…
nico marty
  • 11
  • 1
1
vote
2 answers

Unable to set FindWindow result to variable in .NET

I am attempting to use the FindWindow API using Visual Studio 2017 (.NET Framework 4.6.1) and VB.NET to retrieve the window handle for a currently running instance of Microsoft Word. I am finding that, although it has worked in the past (and is…
1
vote
1 answer

Error Getting Form Handler (Vb.net)

I have the current code: Public Declare Function FindWindow Lib "user32.dll" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long _ Private…
Freesnöw
  • 30,619
  • 30
  • 89
  • 138
1
vote
1 answer

include the GUI from another process in my qt application

Would you be kind to answer these questios ? Is there an alternative to FindWindow, but which is cross-platform ? How can I include the GUI from another process in my qt application ? Thanks.
apatras
  • 11
  • 1
1
vote
1 answer

JNA .FindWindow with regex

Hello I'm working on a program which uses JNA 4.5.1. I need to know whether a specific program is running or not. Here is my problem: hwnd = User32.INSTANCE.FindWindow (null, "Session Dev/Prod - [32 x 80]"); if (hwnd == null) { …
1 2
3
9 10