It retrieves the handle to the desktop assigned to the specified thread belonging to a console application, which is going to be where the input thread of this console is.