-
Notifications
You must be signed in to change notification settings - Fork 22
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
Enabling displays does not work #12
Comments
Hey, This is the I will take a look at that. Thanks for reporting. |
Yes, sorry for not specifying that. Let me know if I can be of any help with this. |
I checked the v1.3.0.13 release and it does not work either. No exception is raised, but the disabled display is not enabled. In v1.2.0.2 it works fine. |
What you are trying to do? The I suggest using classes inside the I gave more descriptive information in the following issues: |
I have a display that is "disconnected" (in the terminology of Windows display settings) - it is connected, but disabled. Calling |
I don't think I change anything related to this with the last release, give me a moment to check it on my device. So the v1.2 or the v1.1 works but v1.3 fails? What are the values of the unattached display's properties? Does it have a valid display name? ("//DISPLAY1", "//DISPLAY2" ...) And is there an already attached display that has the same name? |
I found the bug. In previous versions (tested on v1.1 and v1.2) the attached displays had names "//DISPLAY1", "//DISPLAY2", "//DISPLAY3" and the unattached display had name "//DISPLAY4". In the new release (v1.3), the attached display names stay the same, but the unattached display has the name "//DISPLAY2" (so there is a duplicity in the naming). |
Ok, the only change between the version that might be remotely related is the changes to the Thanks for reporting this issue |
[DllImport("user32")]
public static extern Win32Status DisplayConfigGetDeviceInfo(
ref DisplayConfigSupportVirtualResolution targetSupportVirtualResolution
); Does it work well? This is the Windows api: WINUSERAPI LONG WINAPI DisplayConfigGetDeviceInfo( Inout_ DISPLAYCONFIG_DEVICE_INFO_HEADER* requestPacket); And How convert |
Yes, that part is correct. It is not the source of the problem. Check here: Line 11 in 62e27b3
And here: https://github.com/falahati/WindowsDisplayAPI/blob/62e27b37dd1a3aa4e49a36286ae39b5aee7f3671/WindowsDisplayAPI/Native/DisplayConfig/Structures/DisplayConfigDeviceInfoHeader.cs |
end of 2024, trying to enable a display on the latest nuget package still does not work |
Hello,
I tried to use the new version of Your library and it seems that enabling displays stopped working.
The sample throws an exception for "DeviceContext: Enable All" in
var validSetting = display.DisplayScreen.GetPreferredSetting();
because display.DisplayScreen is null. I tried to enable displays in my code via API call but it did not work either.
The text was updated successfully, but these errors were encountered: