FindWindow() not finding the window

Posts 1–3 of 3 · Page 1 of 1
FindWindow() not finding the window
So I'm trying to find a keygen window by
Code:
HWND hWnd = FindWindow(NULL, "Keygen");
but for some reason, it's not finding the window.
I'm using winspy++ and it shows up as the correct window name. Any idea on how to fix this?


- - - Updated - - -

Also, how would I make a feature where the program is auto clicking for the user (not like turbo click), so for example would be opening up the program B and A, and B search through A for a button and click it.
Quote Originally Posted by Biesi View Post
Have you tried calling FindWindowA directly?

Also a few links that might help you with what you're trying to achieve:
EnumChildWindows function
FindWindowEx function
SendMessage function
Button Control Messages
Yea, I've tried function I can think off and none of it works. The reason why it doesnt work (i think) is because for some reason, the program doesnt have an actual name (even though it display as keygen), and when I ran the enum thing to scan through all the process, it cant pull up the program name either, so do you know how I can change an empty name?


- - - Updated - - -

Ok, FIXED (holy shit): found a Enum code online to scan product by PID but altered it to display the correct name and class
Code:
BOOL CALLBACK FindItemByPID(HWND hwnd,LPARAM lParam)
{
    DWORD lpdwProcessId;
    GetWindowThreadProcessId(hwnd,&lpdwProcessId);
    if(lpdwProcessId==lParam)
    {
        g_HWND=hwnd;
        char class_name[80];
        char title[80];
        GetClassName(hwnd,class_name, sizeof(class_name));
        GetWindowText(hwnd,title,sizeof(title));
        cout <<"Window title: "<<title<<endl;
        cout <<"Class name: "<<class_name<<endl<<endl;
        return FALSE;
    }
    return TRUE;
}
from there, I scan for the program PID, but the name came up empty EXCEPT for the class from there I been trying to find out how to change the program name, but I should have been looking for how to change TITLE name, which then found this
Code:
https://www.murgee.com/window-title-changer/
and then I locate the program by the class name found in the code and change the title. Then did a FindWindow() for the program and BAM, it catches it!


edit: The window title change isnt permanent tho
Posts 1–3 of 3 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us