From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

WINAPI MESSAGE: Show touch keyboard (TabTip.exe) in Windows 10 Anniversary edition

Solved!
Go to solution
Hi Everyone,

I want to open the windows touchscreen keyboard when the user press a button on the GUI. I'm not an expert with using windows dlls and send API messages, so I thought maybe you guys can help me to recreate the following C# code functionality in LabVIEW. I found the code here "http://stackoverflow.com/questions/38774139/show-touch-keyboard-tabtip-exe-in-windows-10-anniversary-edition"

Thank you,


[
DllImport("user32.dll", CharSet = CharSet.Unicode)] private static extern IntPtr FindWindow(string sClassName, string sAppName); [DllImport("user32.dll", CharSet = CharSet.Unicode)] static extern IntPtr FindWindowEx(IntPtr parentHandle, IntPtr childAfter, string lclassName, string windowTitle); [DllImport("User32.Dll", EntryPoint = "PostMessageA")] static extern bool PostMessage(IntPtr hWnd, uint msg, int wParam, int lParam); var trayWnd = FindWindow("Shell_TrayWnd", null); var nullIntPtr = new IntPtr(0); if (trayWnd != nullIntPtr) { var trayNotifyWnd = FindWindowEx(trayWnd, nullIntPtr, "TrayNotifyWnd", null); if (trayNotifyWnd != nullIntPtr) { var tIPBandWnd = FindWindowEx(trayNotifyWnd, nullIntPtr, "TIPBand", null); if (tIPBandWnd != nullIntPtr) { PostMessage(tIPBandWnd, (UInt32)WMessages.WM_LBUTTONDOWN, 1, 65537); PostMessage(tIPBandWnd, (UInt32)WMessages.WM_LBUTTONUP, 1, 65537); } } } public enum WMessages : int { WM_LBUTTONDOWN = 0x201, WM_LBUTTONUP = 0x202, WM_KEYDOWN = 0x100, WM_KEYUP = 0x101, WH_KEYBOARD_LL = 13, WH_MOUSE_LL = 14, }

 

0 Kudos
Message 1 of 4
(8,076 Views)

Hi mbadizi,

 

can't you simply call the TIPBAND exe using the wellknown SysExec function?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 4
(8,032 Views)

Hi GerdW,

 

No, it will run in background if you just use SysExec waiting for WINAPI Message to show up (the keyboard icon on the taskbar). This is the new keyboard for windows 10 touch screen and it's more responsive than OSK.exe, so I am trying to find a way to open when people press on string control boxes. People have already done it in C and C#, but I really don't understand how to use user32.dll to send WINAPI Messages. I found a few samples that are doing other windows messages like muting and volume up and down, but I could not find anything for this one.

 

Best Regards,

mbadizi,

0 Kudos
Message 3 of 4
(8,013 Views)
Solution
Accepted by topic author mbadizi

If all you need is bring the other application to the front, you don't have to reinvent the wheel.

You can download:

Windows API Function Utilities (32-bit) for LabVIEW

http://www.ni.com/example/29935/en/

 

 

George Zou
0 Kudos
Message 4 of 4
(8,005 Views)