kihlh / hmc-win32

HMC Easier Access to System APIs 简化连接winapi的过程的node c++模块
https://kihlh.gitbook.io/hmc/
MIT License
74 stars 10 forks source link

getWindowClassName bug #62

Open hadaGit opened 2 months ago

hadaGit commented 2 months ago
    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 commented 2 months ago

image

kihlh commented 2 months ago

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

kihlh commented 2 months ago

目前测试 相对正常 image

hadaGit commented 2 months ago

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

hadaGit commented 2 months ago

https://github.com/kihlh/hmc-win32/assets/20510333/006ee630-4397-4ba2-8fcd-4c6618737412

hadaGit commented 1 month ago

谢谢