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
11
votes
3 answers

FindWindowEx from user32.dll is returning a handle of Zero and error code of 127 using dllimport

I need to handle another windows application programatically, searching google I found a sample which handles windows calculator using DLLImport Attribute and importing the user32.dll functions into managed ones in C#. The application is running, I…
teenup
  • 7,459
  • 13
  • 63
  • 122
8
votes
4 answers

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,…
Einar Egilsson
  • 3,438
  • 9
  • 36
  • 47
6
votes
1 answer

Best way to add items to another application's modal window?

What's the best way to add items to another application's modal window? The simple example I've written for this (as a proof of concept) uses a method that I suspect is much, much too processor intensive for a trivial background process but I am…
b-p
  • 307
  • 3
  • 10
5
votes
1 answer

Spy++ doesn't reach button in Qt application

I'm trying to get the properties of a button but when I drag the spy++'s find window tool it doesn't reach the button (of caption "iniciar gravação" in that case) but rather the button grid parent, like this: Why is that and how can I get the…
user834697
  • 235
  • 6
  • 15
5
votes
2 answers

How to find a child HWND of a child window of a child window (3 levels deep) with Win32 API?

Suppose I've this Window hierarchy for one of the processes: Main Window (class name: XYZ_Widget_1) `- Child Window (class name: XYZ_Widget_0) `- Child-Child Window (class name: XYZ_Renderer) How do I find the HWND of…
bodacydo
  • 75,521
  • 93
  • 229
  • 319
4
votes
1 answer

create the function "find window..." of spy++ in C#

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…
Gat
  • 115
  • 3
  • 11
4
votes
3 answers

How can I close an app without a modal dialog box being shown?

I have an app that can optionally open PDF's after it creates them. If two reports are generated in succession with the same name, the second attempt fails if the first copy of acrobat still has the PDF open, so before I write the PDF I check (with…
rossmcm
  • 5,493
  • 10
  • 55
  • 118
4
votes
1 answer

FindWindow error 183

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?
windev
  • 49
  • 2
4
votes
1 answer

VB.net SendMessage waiting problem

I am using the following code to click a button for displaying another form to click on: Dim hwnd As Integer = FindWindow(vbNullString, "Virtual CDRom Control Panel") Dim x As Integer = FindWindowEx(hwnd, 0, vbNullString, "Driver Control…
StealthRT
  • 10,108
  • 40
  • 183
  • 342
4
votes
2 answers

How to get SunAwtFrame Window Handler

I'm trying to simulate keyboard events to a Java Application running on Firefox, checking with Spy++ I could see that the keyboard events were been sent to the handler ID X, I check it using Spy++ too and it returned that it was a "window" called…
Kyore
  • 388
  • 2
  • 7
  • 29
4
votes
3 answers

Key logger wont record key strokes without console

I created a small basic key logger in C++. For some reason when I compile and run the program with the console displayed, it will record every key stroke I make in whatever program I am using such as a browser and store it in a text file. However…
RandomGuy
  • 419
  • 4
  • 14
4
votes
3 answers

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…
nbevans
  • 7,739
  • 3
  • 27
  • 32
4
votes
1 answer

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

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,…
Rob
  • 175
  • 3
  • 3
  • 12
3
votes
1 answer

FindWindow in Powershell gives me 0 (on w11 22h2 FR) : unattended character in the title of a cmd elevated console?

8 years after this question with Windows 11 22H2 FR, in Powershell PSVersion 5.1.22621.169 the command: FindWindow("ConsoleWindowClass", "Administrateur : X:\windows\system32\cmd.exe") outputs 0. After some rechearch, I use SPY++ for reading…
3
votes
2 answers

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…
StealthRT
  • 10,108
  • 40
  • 183
  • 342
1
2 3
9 10