#winapi #windows #display #api #api-bindings #windows-settings

DisplaySettings

Small library to manage display settings on Windows with rust

3 releases

0.1.2 May 12, 2024
0.1.1 May 12, 2024
0.1.0 Apr 27, 2024

#293 in Operating systems

Download history 26/week @ 2024-07-27 6/week @ 2024-09-21 1/week @ 2024-09-28 2/week @ 2024-11-02

86 downloads per month

MIT license

14KB
119 lines

Contributors Forks Stargazers Issues MIT License

Display settings library

Small library to manage display settings on Windows
Report Bug · Request Feature

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Roadmap
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgments

Built With

Rust

(back to top)

Getting Started

Installation

  • cargo
    cargo add DisplaySettings
    
  • Cargo.toml
    DisplaySettings = "0.1.0"
    

(back to top)

Usage

use DisplaySettings;
use DisplaySettings::get_display_settings;

fn main() {
    let display_settings = get_display_settings();
    for setting in display_settings {
        println!("Width: {}, Height: {}, Refresh Rate: {}", setting.width, setting.height, setting.refresh_rate);
    }
}
use DisplaySettings::{set_display_settings, DisplaySettingsType};

fn main() {
    let settings = DisplaySettingsType {
        width: 1920,
        height: 1080,
        refresh_rate: 60,
    };
    
    let result = set_display_settings(settings);
    if result == 0 {
        println!("Display settings applied successfully!");
    } else {
        println!("Failed to apply display settings. Error code: {}", result);
    }
}

For more examples, please refer to the Documentation

(back to top)

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

(back to top)

Contact

Discord - __blur__

Project Link: https://github.com/PearuUu/DisplaySettings

(back to top)

Dependencies

~225KB