onefish Posted January 19, 2016 Posted January 19, 2016 (edited) Background I am developing a database to run on a couple Windows 10 10.1" touchscreen tablets. The database software isn't designed/optimized for touch so it doesn't play nicely with the Touch Keyboard. eg. The keyboard does not pop up when I select a text input field in the database, nor does it close/minimize when I select a non-text input based item in the database. I can easily get the keyboard to pop up by sending a simple start TabTip.exe event upon field entry. This does not require AutoIT. I can run a cmd command or AutoIt script upon leaving the text field but I cannot seem to get anything to close the keyboard. Issues I know I can killtask and this will close the touch keyboard but this is not really an acceptable approach. If the process is terminated then the touch keyboard does not become available for text entry fields elsewhere in the Windows environment. To close the keyboard manually, there is an 'X' in the top right corner but I believe that it is only minimized somehow because the process remains active. I need to replicate this behavior. Using simulated mouse clicks isn't really a viable alternative as the tablets could be in portrait or landscape orientation, and the keyboard can be undocked and moved around the screen. I have read that the Windows Touch Keyboard runs with elevated privileges. I was unable to get WinClose to work and this may be why. Window Info Running the Au3 Window Info utility indicates: Title: Class: IPTip_Main_Window Position: 0, 343 Size: 1097, 343 Style: 0x94000000 ExStyle: 0x08000088 Handle: 0x000306F6 Question Can AutoIT close the Windows 10 Touch Keyboard, and if so how? Thanks heaps (in advance) --------------------------------------------------------------------EDIT--------------------------------------------------------------------- I've been playing around some more and it appears that if I run "TASKKILL /IM TabTip.exe" in an administrator cmd prompt, it closes the keyboard but does not kill the actual process. It does not work in a standard cmd prompt. That's what I need but it seems to be nearly impossible to automate running cmd as administrator. I could probably get "runas" to work but then it's dependent upon certain users, etc which isn't ideal. So I am thinking that if AutoIT can send the same WM_CLOSE message to the target program and I compile the script into an exe, I should be able to set the exe to always run as administrator under properties/compatibility. Does that sound correct? What AutoIT function/s will send the same WM_CLOSE message? OK, bad idea. Just thought I'd try to do it with the WinClose function compiled to an exe set to always run as administrator. WinClose didn't work but more importantly Windows prompts user input to allow it to run. Edited January 20, 2016 by onefish
careca Posted January 20, 2016 Posted January 20, 2016 Hi, 2 possible options i would try WinClose('[CLASS:IPTip_Main_Window]') Opt("MouseCoordMode", 0) $aArray=WinGetPos('[CLASS:IPTip_Main_Window]') ;$aArray=WinGetPos('[CLASS:SciTEWindow]') ;$aArray[0] = X position ;$aArray[1] = Y position ;$aArray[2] = Width ;$aArray[3] = Height MouseClick('left', $aArray[2]-$aArray[2]*0.015, $aArray[3]*0.015) ;MouseMove($aArray[2]-$aArray[2]*0.015, $aArray[3]*0.015) Since you tried the first one, the second gives you a percentage of the size of the window, so whatever the size is, portrait or not, it should click the X everytime. Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe
onefish Posted January 20, 2016 Author Posted January 20, 2016 (edited) Careca, thanks for the suggestion. Unfortunately it didn't work. I am thinking that ;$aArray=WinGetPos('[CLASS:SciTEWindow]') was a mistake? Should the X and Y positions be included in the calculation? The error seems to be non accessible variable. I tried changing to mousemove instead of mouseclick so I could see what's happening and the script simply isn't completing. I don't think it's getting the window position. Edited January 20, 2016 by onefish
careca Posted January 20, 2016 Posted January 20, 2016 yea, can't find the window, try with Opt("WinTitleMatchMode", 4) Else adapt the help file example Local $hWnd = WinGetHandle("Untitled - Notepad", "")WinClose($hWnd) Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe
onefish Posted January 20, 2016 Author Posted January 20, 2016 How to get the handle without a window title or text? The touch keyboard has neither.
careca Posted January 20, 2016 Posted January 20, 2016 Local $hWnd = WinGetHandle("[CLASS:IPTip_Main_Window]", "") WinClose($hWnd) Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe
onefish Posted January 20, 2016 Author Posted January 20, 2016 (edited) Ran the results in a msgbox first and I don't think it's grabbing the handle. Says it's 0x00000000 is it possible that that is correct? The AutoIT Window Info utility picks up the handle as 0x00002022 Edited January 20, 2016 by onefish
JohnOne Posted January 20, 2016 Posted January 20, 2016 (edited) AutoIt was simply not designed to operate on tablets, despite having windows 10 on it, it will not have all the same API's as a lap or desktop. And the Applications on it will not be standard win32 windows/gui's. Edited January 20, 2016 by JohnOne AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
onefish Posted January 20, 2016 Author Posted January 20, 2016 8 minutes ago, JohnOne said: despite having windows 10 on it, it will not have all the same API's as a lap or desktop Thanks John, I'm pretty sure it is just stock standard Windows 10 though. I upgraded them myself and didn't use any cut down, or tablet specific versions of the OS. The Touch Keyboard is baked into Windows 10 and is on all laptops and desktops using the OS (unless the user has removed it somehow).
JohnOne Posted January 20, 2016 Posted January 20, 2016 Still will not install everything it does on a classic computer. What window can you close with script? AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
onefish Posted January 20, 2016 Author Posted January 20, 2016 With winclose and the window name I can close all folder windows, Edge browser window, control panel window, I haven't tried any others but I'd suggest probably all of them. The darn keyboard is just different.
onefish Posted January 20, 2016 Author Posted January 20, 2016 (edited) I am liking the idea of sending a mouse click proposed by careca more and more as the requirement for elevated privileges to send the taskkill command is turning out to be problematic. As the AutoIT v3 Window utility is able to recognize the window and provide it's handle I am wondering if its possible to wingethandle by X and Y coordinates? 90 & 570 should ensure it's in the keyboard window mostly all the time. I'm hoping that having the correct handle would enable wingetpos to work better than it does by class. Or am I way off base? Edited January 20, 2016 by onefish
ViciousXUSMC Posted January 20, 2016 Posted January 20, 2016 (edited) Couple of things: 1.) You can try working with the OSK (On Screen Keyboard) instead of the Virtual Keyboard. I usually prefer it and make it the default keyboard for tablets I have in the field. 2.) Try something like IUIAutomation Edited January 20, 2016 by ViciousXUSMC
careca Posted January 21, 2016 Posted January 21, 2016 (edited) Did you try _WinAPI_GetWindow? Im thinking if the tool can see it, there has to be a way to do it through script. i was looking at some stuff and i was thinking you could try to use advanced title format X \ Y \ W \ H - The position and size of a window Example: WinWait("[W:360]\[H:76]") Since you know the size of the window, and there is little chance there is another the same exact size.. Edited January 21, 2016 by careca Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe
onefish Posted January 24, 2016 Author Posted January 24, 2016 I think I may be running out of options here, argh! As the touch keyboard appears to run with elevated privileges, all my attempts to send messages to it to close fail unless I run as administrator, which creates a whole new set of issues. I thought that sending a mouse click to the close control coordinates of the keyboard would bypass all that but I can't get that to work either. I was able to work out that @DesktopWidth - 30 and @DesktopHeight - 316 is the center of the close control on both portrait and landscape modes as long as I don't un-dock the keyboard. But sending a mouseclick to that location moves the mouse cursor and appears to do a left click (small infinity symbol for fraction of a second) but it doesn't close the keyboard. I tried using Opt("MouseCoordMode",1) with ControlClick in that location too and still nothing. Should I admit defeat?
careca Posted January 25, 2016 Posted January 25, 2016 (edited) On 1/24/2016 at 11:14 AM, onefish said: @DesktopWidth - 30 and @DesktopHeight - 316 is the center of the close control on both portrait and landscape modes as long as I don't un-dock the keyboard. Can you get a Control ID for the close item? controlclick('[W:WindowWidth]\[H:WindowHeight]', '', ID) with Opt("WinTitleMatchMode", 4) What happens? Edited January 25, 2016 by careca typo Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe
onefish Posted January 31, 2016 Author Posted January 31, 2016 careca, thanks for persisting. I had to divert my attention to other parts of this project for a while and have just found time to try your suggestion. The window info utility doesn't indicate any control ID for the 'X'/close control on the keyboard. I think I will give up on this nicety, it isn't critical after all. Just preferred behavior.
careca Posted January 31, 2016 Posted January 31, 2016 (edited) As a test, i put up the OSK the windows has, and docked it, and similarly to you, i can't seem to close it. Tried this, it gave me weird results, different from the autoit tool. Opt("WinTitleMatchMode", 4) #include <Array.au3> #include <WinAPIProc.au3> $aData = _WinAPI_EnumProcessWindows(_WinAPI_GetProcessID('osk.exe'),0) _ArrayDisplay($aData, '_WinAPI_EnumProcessWindows') Edited January 31, 2016 by careca Spoiler Renamer - Rename files and folders, remove portions of text from the filename etc. GPO Tool - Export/Import Group policy settings. MirrorDir - Synchronize/Backup/Mirror Folders BeatsPlayer - Music player. Params Tool - Right click an exe to see it's parameters or execute them. String Trigger - Triggers pasting text or applications or internet links on specific strings. Inconspicuous - Hide files in plain sight, not fully encrypted. Regedit Control - Registry browsing history, quickly jump into any saved key. Time4Shutdown - Write the time for shutdown in minutes. Power Profiles Tool - Set a profile as active, delete, duplicate, export and import. Finished Task Shutdown - Shuts down pc when specified window/Wndl/process closes. NetworkSpeedShutdown - Shuts down pc if download speed goes under "X" Kb/s. IUIAutomation - Topic with framework and examples Au3Record.exe
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now