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

请问下Windows下可不可以获取进程id #127

Closed
hengkx opened this issue Apr 30, 2024 · 5 comments
Closed

请问下Windows下可不可以获取进程id #127

hengkx opened this issue Apr 30, 2024 · 5 comments
Labels
enhancement New feature or request

Comments

@hengkx
Copy link

hengkx commented Apr 30, 2024

No description provided.

@hengkx
Copy link
Author

hengkx commented Apr 30, 2024

unsafe {
                // 如果找到窗口句柄,则调用 GetWindowThreadProcessId 函数来获取进程 ID
                let mut process_id = 0;
                GetWindowThreadProcessId(window.id() as *mut HWND__, &mut process_id);
                println!("进程 ID: {}", process_id);
            }

@hengkx
Copy link
Author

hengkx commented Apr 30, 2024

我看源代码里面有用这个‎GetWindowThreadProcessId有用这个函数可否加个进程Id属性

@nashaofu
Copy link
Owner

nashaofu commented May 1, 2024

可以加

@nashaofu nashaofu added the enhancement New feature or request label May 1, 2024
@ponull
Copy link

ponull commented May 2, 2024

同求加进程id,我启动了多个窗口,截图时不知道是哪个进程启动的

@nashaofu
Copy link
Owner

#135 windows 已经支持了,其他平台还在开发

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants