This Rust library provides a simple and safe wrapper around the Win32API for creating and managing a window textbox. It allows you to create a window, and retrieve text from it.
- Thread-safe access to shared state objects
- Window creation and management using Win32API
- Exposes a C-compatible API for interop with other languages
- Rust compiler (latest stable version recommended)
- Windows platform
- Clone :
git clone git@github.com:Kreijstal/winapi_rust_window_prompt.git
- Use the library in any code, in rust this would look like:
extern crate winapi_rust_window_prompt;
use winapi_rust_window_prompt::*;
- Create a shared state object and use it to manage the window:
fn main() {
// Create a shared state object
let shared_state_id = create_shared_state();
// Create a window using the shared state object
create_window(shared_state_id);
// Wait for the window to be done
while !is_done(shared_state_id) {
std::thread::sleep(std::time::Duration::from_millis(100));
}
// Retrieve the result of the window operation
let result = unsafe { CStr::from_ptr(get_result(shared_state_id)).to_str().unwrap() };
println!("Result: {}", result);
// Clean up the shared state object
delete_shared_state(shared_state_id);
}
Creates a new shared state object and returns its ID.
Creates a new window and associates it with the specified shared state object.
Returns true
if the window associated with the specified shared state object is done, false
otherwise.
Returns the result of the window operation associated with the specified shared state object as a null-terminated C string.
Deletes the specified shared state object.
This project is licensed under the MIT License.