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

Black image captured on most handles when using _GlobalImgCapture() #6

Open
salaamdev opened this issue Sep 2, 2023 · 4 comments
Open

Comments

@salaamdev
Copy link
Contributor

Certain applications, such as File Explorer, are captured flawlessly, while others like Visual Studio Code, Discord, netflix, steam, settings app, web browsers like Firefox and many many others result in a black image when captured. I am not sure why this is happening, maybe something to do with win32api? idk, i hope you can check into it.

#include "..\HandleImgSearch\HandleImgSearch.au3"

Sleep(1000) ; alt+tab
$hwnd = WinGetHandle("[ACTIVE]")
_GlobalImgInit($hwnd, 0, 0, -1, -1, False, True, 0, 0, 1)
_GlobalImgCapture()```
@lamnhan066
Copy link
Owner

@redscorpionx You can try setting the $_HandleImgSearch_IsUser32 to True, it will work in some cases. In some browsers, you need to turn off the Hardware Acceleration feature.

@salaamdev
Copy link
Contributor Author

Here's what I've tried and found:

  1. I tested $_HandleImgSearch_IsUser32 = True, but it didn't fix the black image issue.
  2. Disabling hardware acceleration in my browser and Discord resolved the screen capture problem. However, some apps like games, Bluestacks, and Windows Settings app don't have this option and still produce black images.
  3. As a temporary fix, I disabled my GPU drivers, which worked for most apps (all non windows apps) but not for certain Windows apps like Settings, Snipping Tool, and Windows App Store.

In summary, disabling the GPU temporarily fixes the problem, but it's not a practical solution since some apps rely on it. The UDF isn't the problem; it's about resolving the hardware acceleration issue per application which i feel stuck.

@lamnhan066
Copy link
Owner

@redscorpionx In some windows, we have to capture a specific HWND of its child window, the parent HWND might return a black window. However, in some windows, I cannot capture even using the child HWND and still have no idea how to completely solve it.

@salaamdev
Copy link
Contributor Author

i will leave this issue open for a while before closing it, just in case someone has a solution

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

No branches or pull requests

2 participants