Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getWindowClassName bug #62

Open
hadaGit opened this issue May 8, 2024 · 6 comments
Open

getWindowClassName bug #62

hadaGit opened this issue May 8, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@hadaGit
Copy link

hadaGit commented May 8, 2024

    function watchWindowForeground() {
        const fWinHwnd = hmc.getForegroundWindow();

        if (fWinHwnd && fWinHwnd.pid) {
            const processName = hmc.getProcessName(fWinHwnd.pid);
            const windowTitle = fWinHwnd.title;
            const className = hmc.getWindowClassName(fWinHwnd);
            // const className = fWinHwnd.className;
            console.log('进程名:', processName, ' 窗口标题:', windowTitle, ' 类名:', className);
        }

        setTimeout(watchWindowForeground, 1000);
    }
    watchWindowForeground();
    这样子调用  这个窗口类名   有时可以获取到有时获取不到
@hadaGit
Copy link
Author

hadaGit commented May 8, 2024

image

@kihlh
Copy link
Owner

kihlh commented May 8, 2024

在其他软件下显示是正常的嘛,有些窗口没有类名很正常

@kihlh
Copy link
Owner

kihlh commented May 8, 2024

目前测试 相对正常
image

@hadaGit
Copy link
Author

hadaGit commented May 9, 2024

不是获取不到 是有很大概率会获取不到 同一个窗口,有时候一直可以获取到 但是有时候就获取不到,感觉不稳定窗口一直都是同一个,我看下能不能录视频

@hadaGit
Copy link
Author

hadaGit commented May 9, 2024

20240509_093328.mp4

@kihlh kihlh added the bug Something isn't working label May 9, 2024
@hadaGit
Copy link
Author

hadaGit commented May 10, 2024

谢谢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants