pub fn current_out_handle() -> Result<Handle> {
        let utf16: Vec<u16> = "CONOUT$\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 !Self::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 screen buffer.
/// When using multiple screen buffers this will always point to the to the current screen output buffer.
///
/// On success this function returns the `HANDLE` to `STD_OUTPUT_HANDLE`.
///
/// This function uses `CONOUT$` to create a file handle to the current output 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 screen buffer.
When using multiple screen buffers this will always point to the to the current screen output buffer.

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

This function uses `CONOUT$` to create a file handle to the current output buffer.


Get the handle of the active screen buffer . When using multiple screen buffers this will always point to the to the current screen output buffer . On success this function returns the ` HANDLE ` to ` STD_OUTPUT_HANDLE ` . This function uses ` CONOUT$ ` to create a file handle to the current output buffer .
pub fn current_out_handle() -> Result<Handle> {
        let utf16: Vec<u16> = "CONOUT$\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 !Self::is_valid_handle(&handle) {
            return Err(io::Error::last_os_error());
        }
        Ok(Handle {
            handle: Arc::new(Inner::new_exclusive(handle)),
        })
    }
pub fn current_out_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 ! Self :: 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 screen buffer.
Get the handle of the active screen buffer .