Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keyboard in WinPe Right Bottom (Tabtip.exe?) #167

Open
Abe-Telo opened this issue Sep 12, 2024 · 2 comments
Open

Keyboard in WinPe Right Bottom (Tabtip.exe?) #167

Abe-Telo opened this issue Sep 12, 2024 · 2 comments

Comments

@Abe-Telo
Copy link

Abe-Telo commented Sep 12, 2024

Is your feature request related to a problem? Please describe.
OSK not as responsive. Wondering if we can get a default keyboard that can be lunched directly from WinPE as microsoft has it in recovery mode in some devices.

Describe the solution you'd like
I am looking into tabtip.exe, I hope i am on the right track. Add some files in the system32 file and lunch it when Winpe lunches or by calling it.

key2
key1

@Abe-Telo
Copy link
Author

Abe-Telo commented Sep 12, 2024

I found a powershell script that works in windows, Will test soon in winpe.

You will want to use DISM and put in the tabtip.exe and possibly tabtip.exe related dll files. Will confirm that in my final test in winpe.

`Add-Type @"
    using System;
    using System.Runtime.InteropServices;

    public class TipHelper
    {
        [DllImport("user32.dll", SetLastError = false)]
        public static extern IntPtr GetDesktopWindow();

        [ComImport, Guid("4ce576fa-83dc-4F88-951c-9d0782b4e376")]
        public class UIHostNoLaunch
        {
        }

        [ComImport, Guid("37c994e7-432b-4834-a2f7-dce1f13b834b")]
        [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
        public interface ITipInvocation
        {
            void Toggle(IntPtr hwnd);
        }

        public static void ShowTouchKeyboard()
        {
            var uiHostNoLaunch = new UIHostNoLaunch();
            ITipInvocation tipInvocation = (ITipInvocation)uiHostNoLaunch;
            tipInvocation.Toggle(GetDesktopWindow());
            Marshal.ReleaseComObject(uiHostNoLaunch);
        }
    }
"@

# Call the method to show the touch keyboard
[TipHelper]::ShowTouchKeyboard()

`

Originally created in C+ Converted by AI.

Now i converted that to EXE.

And will also create a button in powershell to lunch it. THis is currently my closes that i got.

Source: https://stackoverflow.com/questions/38774139/show-touch-keyboard-tabtip-exe-in-windows-10-anniversary-edition

@Abe-Telo
Copy link
Author

Ok, so this is a finale example of how it can work.
I added wierlessconnect.exe
with a script that will open or terminate the app. (since it dot have an exit button)
then i also created a button for the keyboard to lunch. And it works.

# Load required assemblies
Add-Type -AssemblyName System.Windows.Forms
Add-Type -AssemblyName System.Drawing

# Create the main form (taskbar)
$taskbar = New-Object System.Windows.Forms.Form
$taskbar.Text = "Custom Taskbar"
$taskbar.BackColor = [System.Drawing.Color]::Blue  # Set background color to blue
$taskbar.FormBorderStyle = 'None'
$taskbar.Width = 300
$taskbar.Height = 40
$taskbar.StartPosition = 'Manual'
$taskbar.Top = [System.Windows.Forms.Screen]::PrimaryScreen.Bounds.Height - $taskbar.Height
$taskbar.Left = [System.Windows.Forms.Screen]::PrimaryScreen.Bounds.Width - $taskbar.Width

# Function to check if a process is running
function IsProcessRunning($processName) {
    Get-Process -Name $processName -ErrorAction SilentlyContinue
}

# Add C# code to invoke touch keyboard
Add-Type @"
    using System;
    using System.Runtime.InteropServices;

    public class TipHelper
    {
        [DllImport("user32.dll", SetLastError = false)]
        public static extern IntPtr GetDesktopWindow();

        [ComImport, Guid("4ce576fa-83dc-4F88-951c-9d0782b4e376")]
        public class UIHostNoLaunch
        {
        }

        [ComImport, Guid("37c994e7-432b-4834-a2f7-dce1f13b834b")]
        [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
        public interface ITipInvocation
        {
            void Toggle(IntPtr hwnd);
        }

        public static void ShowTouchKeyboard()
        {
            var uiHostNoLaunch = new UIHostNoLaunch();
            ITipInvocation tipInvocation = (ITipInvocation)uiHostNoLaunch;
            tipInvocation.Toggle(GetDesktopWindow());
            Marshal.ReleaseComObject(uiHostNoLaunch);
        }
    }
"@

# Button 1 - Open On-Screen Keyboard using the working method
$button1 = New-Object System.Windows.Forms.Button
$button1.Text = "Keyboard"
$button1.BackColor = 'White'
$button1.ForeColor = 'Black'
$button1.Width = 100
$button1.Height = 30
$button1.Top = 5
$button1.Left = 10
$button1.Add_Click({
    # Invoke the touch keyboard
    [TipHelper]::ShowTouchKeyboard()
})

# Button 2 - Toggle WirelessConnect.exe
$button2 = New-Object System.Windows.Forms.Button
$button2.Text = "WirelessConnect"
$button2.BackColor = 'White'
$button2.ForeColor = 'Black'
$button2.Width = 100
$button2.Height = 30
$button2.Top = 5
$button2.Left = 120
$button2.Add_Click({
    # Check if WirelessConnect.exe is running
    $process = IsProcessRunning "WirelessConnect"
    if ($process) {
        # If running, terminate it
        $process | Stop-Process
    } else {
        # If not running, start it
        Start-Process "C:\windows\system32\WirelessConnect.exe"
    }
})

# Add buttons to the taskbar
$taskbar.Controls.Add($button1)
$taskbar.Controls.Add($button2)

# Make the taskbar always on top
$taskbar.TopMost = $true

# Show the taskbar
$taskbar.ShowDialog()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant