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

Improved code for supporting multiple Windows versions #93

Open
wants to merge 12 commits into
base: feature/windows-10-support
Choose a base branch
from

Conversation

Lej77
Copy link

@Lej77 Lej77 commented Apr 2, 2024

Hi again, I read your comment in my previous PR #92 and supporting multiple Windows versions definitively complicates the code so it makes sense to limit the scope of the project.

Anyway, I made some improvements to the code for supporting multiple Windows versions and I guess you can merge them into the same branch as the other Windows 10 support:

  • Added a multiple-windows-versions feature flag without which the code uses the previous approach of only supporting the latest COM interfaces.
    • Nearly no changes were made to the code outside of interfaces.rs (compared to the code in the main branch).
    • Support for multiple Windows versions is done via interfaces_multi.rs which works as a drop in replacement for interfaces.rs when the feature flag is used.
  • Support same Windows versions as mzomparelli/VirtualDesktop: C# wrapper for the Virtual Desktop API on Windows 11..
  • Minimized work for adding new Windows versions.
    1. Add new module in interfaces_multi.rs
    2. In the new module declare the new COM interfaces.
    3. If the code in comobjects.rs or the other files uses new methods then add those to the definitions in build_dyn.rs.

DLL Size

I checked the size of the DLL (built in release mode) with and without the multiple-windows-versions feature:

  • Multiple Windows versions: 363 KB
  • Latest Windows version only: 342 KB

Tests

I also ran all the tests and they did pass on Windows 10 (well, except for the ones using features that weren't supported):

running 12 tests
test tests::test_desktop_count ... ok
test tests::test_desktop_get ... ok
test tests::test_kill_explorer_exe_manually ... ok
test tests::test_listener_manual ... ok
test tests::test_desktop_moves ... ok
test tests::test_errors ... ok
test tests::test_move_notepad_between_desktops ... ok
test tests::test_switch_desktops_rapidly_manual ... ok
test tests::test_pin_notepad ... ok
test tests::test_pin_notepad_app ... ok
test tests::test_rename_desktop ... FAILED
test tests::test_threads ... FAILED

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

Successfully merging this pull request may close these issues.

None yet

2 participants