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

How to use Control.FromHandle?

I saw a method called Control.FromHandle which (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…
FBSC
  • 191
  • 2
  • 9
3
votes
1 answer

How to use win32gui FindWindow with Wildcard

I am trying to find if Microsoft excel has an open window import win32ui import time def WindowExists(windowname): try: win32ui.FindWindow(None, windowname) except win32ui.error: return False else: return…
77120
  • 865
  • 1
  • 14
  • 27
3
votes
1 answer

Find a specific control on a window

Im trying to find the value of a specific ProgressBar (msctls_progress32) on a window, I have found the window with: [DllImport("User32.dll")] public static extern IntPtr FindWindow(string strClassName, string strWindowName); But i cant get the…
string.Empty
  • 10,393
  • 4
  • 39
  • 67
3
votes
1 answer

Redirect from console window(C++ app) to textbox(C# app)

I'm creatin application(C#) that need run another app. This. app is game(C++,Directx7,GDI, I don't have source) that show console window for debugging from dll(static). For show console window this dll has this…
3
votes
2 answers

Is it safe to change TCreateParams.WinClassName or how to find a form handle of another own application?

I have two applications, where the first one needs to find a handle of the form from the second (also my own) but different application (not instance, but different application). I've seen some techniques, but I would like to know if it's safe what…
Martin Reiner
  • 2,167
  • 2
  • 20
  • 34
2
votes
2 answers

WinApi FindWindow by a part of title

How I can get a window's descriptor if I know only a part of its title and its className?
HelloWorld
  • 1,061
  • 2
  • 15
  • 25
2
votes
1 answer

Is the window handle (HWND) of a window persistent across hibernation?

Is the window handle (HWND) of a window (especially Windows Notepad) persistent during the lifetime of the window, especially across hibernation? Say I write a programm that retrieves (eg using FindWindowEx-function) and saves the handle of a…
user
  • 33
  • 4
2
votes
0 answers

How can pickup window class of non active/visible window?

I need obtain a list of a class of all windows in order to pickup window handle of a hidden non visible child window. Using spy++ I can find the windows and see the windows not have setup a window name/caption, only a class and appear appear like…
MrBi
  • 308
  • 1
  • 14
2
votes
2 answers

VBA - Find a window handle knowing its caption, class and its owner

It should be easy but it doesn't work in the way I imagined... It is about "Print Merge Wizard" window of Corel DRAW. I can find the window with Spy++, its Caption and its Class. I cannot find its handle using API. Using FindWindow I can only obtain…
FaneDuru
  • 38,298
  • 4
  • 19
  • 27
2
votes
2 answers

Desktop Icon manipulation - how to get a handle to SysListView32 when themes with picture rotation are enabled

I'm trying to move icons around the desktop, everything works well until a theme that has picture rotation is picked. With a basic Windows 7 theme, the SysListView32 is child of SHELLDLL_DefView which is in turn child of Progman. But when a picture…
user594650
  • 51
  • 1
  • 5
2
votes
2 answers

Click a button programmatically C#

I am looking for a way to click a button programmatically (Winform). I have a form (say Form2) and button (Button2) of my project. When I click my button it should click Button1 (which is in another project), but both are in same solution. This…
sjohnson
  • 315
  • 1
  • 3
  • 7
2
votes
1 answer

FindWindow( ... ) is not 'finding' created message window

In my code I have a message class that I would like to 'Find' from another process. class MyWindow : public CWnd { public: MyWindow::MyWindow(LPCTSTR pszClassName) { auto wcn = ::AfxRegisterWndClass(NULL); auto created =…
Simon Goodman
  • 1,174
  • 1
  • 8
  • 35
2
votes
1 answer

Python Win32GUI Find Window

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,…
yassin
  • 6,529
  • 7
  • 34
  • 39
2
votes
2 answers

Click on button in another program - FindWindow, C#

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…
phawresl
  • 95
  • 1
  • 1
  • 5
2
votes
1 answer

C++ SendMessage / PostMessage WM_KEYDOWN WM_KEYUP doesn't work

I'm attempting to press the Left arrow key button and Right arrow key button. The Window Handle I'm passing in is correct. (see screenshot below) I used Microsoft Spy++ to figure out the correct PostMessage when I press Left/Right keys. Here are the…
SSpoke
  • 5,656
  • 10
  • 72
  • 124
1
2
3
9 10