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
1
vote
2 answers

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…
Dave
1
vote
1 answer

FindWindow FindWindowEx

I have written a program that is to find a box in another program and set focus to it. Once this is done it will sendkeys and save to this box. I am using Findwindow and FindwindowEx to locate the box, but I have a bit of an issue. if you notice…
user1946138
  • 13
  • 1
  • 1
  • 3
1
vote
2 answers

Finding a MessageBox in a specific app?

We have implemented a solution to give our internal users a nag message that they need to redeploy our application. We are using the filesystem watcher to monitor the network and look for a change in a specific file which has worked very well. Most…
coding4fun
  • 8,038
  • 13
  • 58
  • 85
1
vote
2 answers

How to `FindWindow` a window that doesn't show up in Spy++?

I'm debugging a Windows application with IDA Pro and I see that at one point it calls FindWindowA and successfully locates a window with the given class name. However when I use Spy++ to locate the windows with the given class name, it just doesn't…
bodacydo
  • 75,521
  • 93
  • 229
  • 319
1
vote
1 answer

Local Hook not working

I have an application and wish to monitor MSWord keypressing (LOCAL HOOK), but I cant figure out how to find the pid to be used! The bellow CODE WORKS GOOD with global hook (pid = 0) and with (pid = GetCurrentThreadId). But doesn´t work with…
sgm
  • 196
  • 3
  • 14
1
vote
0 answers

Find Specific Open File Dialog and populate

I'm trying to find a method to identify a Open File Dialog and send a message to the "file name" field. Afterwards it needs to send an "Enter" key or "Open" command to the button. I'm doing this in VB, but I'm sure I can cope if someone can help in…
1
vote
2 answers

C++ Handle as HWND?

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) { …
Rasmus Søborg
  • 3,597
  • 4
  • 29
  • 46
1
vote
1 answer

findwindow text

Hey all i am trying to get some text form an external program. Currently i am using this code: Dim lngHWND As Long Dim lngHWNDF As Long Dim lngID As Long Dim lngChild As Long Dim lngRet As Long lngHWND = FindWindow(vbNullString, "Client -…
StealthRT
  • 10,108
  • 40
  • 183
  • 342
0
votes
1 answer

Simulating a click through Windows API using C++ doesn't seem to work

so I have been trying to simulate a click on my file explorer window to get back from my open folder to the previous directory. Straight forward. So I used SpyXX to know the window's names, so I can simulate this click. Here is my code: int main(int…
Bializm
  • 1
  • 4
0
votes
2 answers

Send Text to Another Application C# WPF Runnable on Windows

I have simple TCP/IP Server Windows and Client Android. How I can send received text to another appilication for example notepad or excel cell, any window application with input field. Data Received in background private void…
Mike
  • 1
  • 1
0
votes
2 answers

FindWindow is not working?

I just want to know why this code is not working? HWND hWnds = FindWindow(NULL,(LPCTSTR)"Calculator"); It always returns NULL for the hWnds.... Any idea how to fix this? Thank you :)
zia
  • 117
  • 3
  • 7
0
votes
1 answer

Accessing buttons on the Internet Explorer 11 View downloads form

I have a piece of code in vb.net to open a web link for an application and to download a file from the page. The web browser loads the page and the program auto clicks the link on the page to download the file which then makes the "View Downloads -…
0
votes
0 answers

How can I convert vba macro with findwindow api into google app script?

I'd like to convert VBA macro to Google Apps script but I think this particular one is impossible to convert as I am totally lost where to begin with this. I couldn't find anyway to do what "findwindow" does on APP script. Does anyone have any idea…
0
votes
1 answer

Windows API function FindWindow returns always 0 when exe is executed within PHP exec() function

I have made a command line app to do some tasks on the server. For example, it 'tracks' a window and send keys to it. I use the windows API function findWindow() to find the window. When i run the exe from the command line it is working great except…
Codebeat
  • 6,501
  • 6
  • 57
  • 99
0
votes
1 answer

Python - Trying to find if a sikuli script is running at the moment

So I have a sikuli script running which monitors and executes a said action every 10 minutes continuously. However for various reasons sometimes the run is interrupted and there is no way to alert if the script stops running. So I tried running a…
Dennis
  • 19
  • 3