/// Get the handle of the active input screen buffer.
/// When using multiple screen buffers this will always point to the to the current screen input buffer.
///
/// On success this function returns the `HANDLE` to `STD_INPUT_HANDLE`.
///
/// This function uses `CONIN$` to create a file handle to the current input buffer.
///
/// Wraps the underlying function call: [CreateFileW]
/// link: [https://docs.microsoft.com/en-us/windows/desktop/api/fileapi/nf-fileapi-createfilew]

Get the handle of the active input screen buffer.
When using multiple screen buffers this will always point to the to the current screen input buffer.

On success this function returns the `HANDLE` to `STD_INPUT_HANDLE`.

This function uses `CONIN$` to create a file handle to the current input buffer.


Get the handle of the active input screen buffer . When using multiple screen buffers this will always point to the to the current screen input buffer . On success this function returns the ` HANDLE ` to ` STD_INPUT_HANDLE ` . This function uses ` CONIN$ ` to create a file handle to the current input buffer .
pub fn current_in_handle() -> Result<Handle> {
        let utf16: Vec<u16> = "CONIN$\0".encode_utf16().collect();
        let utf16_ptr: *const u16 = utf16.as_ptr();
        let handle = unsafe {
            CreateFileW(
                utf16_ptr,
                GENERIC_READ | GENERIC_WRITE,
                FILE_SHARE_READ | FILE_SHARE_WRITE,
                null_mut(),
                OPEN_EXISTING,
                0,
                null_mut(),
            )
        };
        if !Handle::is_valid_handle(&handle) {
            return Err(io::Error::last_os_error());
        }
        Ok(Handle {
            handle: Arc::new(Inner::new_exclusive(handle)),
        })
    }
pub fn current_in_handle ( ) -> Result < Handle > { let utf16 : Vec < u16 > = " \0 " . encode_utf16 ( ) . collect ( ) ; let utf16_ptr : * const u16 = utf16 . as_ptr ( ) ; let handle = unsafe { CreateFileW ( utf16_ptr , GENERIC_READ | GENERIC_WRITE , FILE_SHARE_READ | FILE_SHARE_WRITE , null_mut ( ) , OPEN_EXISTING , 0 , null_mut ( ) , ) } ; if ! Handle :: is_valid_handle ( & handle ) { return Err ( io :: Error :: last_os_error ( ) ) ; } Ok ( Handle { handle : Arc :: new ( Inner :: new_exclusive ( handle ) ) , } ) }
Get the handle of the active input screen buffer.
Get the handle of the active input screen buffer .