caramen Posted July 16, 2018 Share Posted July 16, 2018 (edited) Hello everyone,I want to maximize an application when it is minimized.the problem is: it's the virtual keyboard.How to simply detect the fact that the keyboard is minimized? Func OSK () If ProcessExists ("osk.exe") Then Sleep (1000) Else Run ("osk.exe") EndIf If ProcessExists ("osk.exe") Then WinActivate ( "Clavier" ) Else Sleep (100) EndIf EndFunc Here everything work perfectly but... i am not stoping to get the focus on the keyboard so we cannot type in a windows with that. Thanks Edited July 16, 2018 by caramen My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted July 16, 2018 Share Posted July 16, 2018 Good morning @caramen Have you took a look in the Help file about Win* functions? Best Regards. Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
caramen Posted July 16, 2018 Author Share Posted July 16, 2018 (edited) Yeah ofc. The probleme is probably about my understanding of these fonction... i am familiar with autoit but if you can provide me a logical help i am gonna do the rest hihi I think i am gonna stay closed anything if i try anything. Becose i need to activate the windows if it s minimised only. I mean if the virtual keyboard is not active but not minimised it s ok for me. It s more complicated than it looks. becose my main windows is in full screen mode. so i think this is my real probleme. becose i am gonna loose focus of the virtual keyboard anyway hmmmmmmmmmmmm. Edited July 16, 2018 by caramen My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to comment Share on other sites More sharing options...
badcoder123 Posted July 16, 2018 Share Posted July 16, 2018 WinGetState() Func OSK () If Not ProcessExists("osk.exe") Then Run("osk.exe") Do If ProcessExists("osk.exe") Then WinActivate("Clavier") Sleep(200) Until WinGetState("osk.exe") = 8 ;Returns 8 when Clavier is active EndFunc Some thing like this? Link to comment Share on other sites More sharing options...
caramen Posted July 16, 2018 Author Share Posted July 16, 2018 Yeah much much better than mine i do not know that wingetstate function Ty I am trying. My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to comment Share on other sites More sharing options...
caramen Posted July 16, 2018 Author Share Posted July 16, 2018 (edited) 13 minutes ago, badcoder123 said: WinGetState() Func OSK () If Not ProcessExists("osk.exe") Then Run("osk.exe") Do If ProcessExists("osk.exe") Then WinActivate("Clavier") Sleep(200) Until WinGetState("osk.exe") = 8 ;Returns 8 when Clavier is active EndFunc Some thing like this? 13 minutes ago, badcoder123 said: Some thing like this? It's same as my script it is constantly activating the focus on the keyboard even if it s not minimised BTW i changed the return value of wingetstat 8 to 16 Edited July 16, 2018 by caramen My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to comment Share on other sites More sharing options...
badcoder123 Posted July 16, 2018 Share Posted July 16, 2018 1 minute ago, caramen said: It's same as my script it is constantly activating the focus on the keyboard even if it s not minimised BTW i changed the return value of wingetstat 8 to 16 Sorry I didn't read your comment; only your primary post. Yes is working as intended now? Link to comment Share on other sites More sharing options...
caramen Posted July 16, 2018 Author Share Posted July 16, 2018 Nop i want to send my WinActive function only when the Virtual keyboard is minimised ONLY. That should work with the return value 16 but it s not working as intented. My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted July 16, 2018 Share Posted July 16, 2018 @caramen Did you try WinSetState()? I just tried to minimize osk.exe, and I got 23 as WinGetState() result badcoder123 1 Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
caramen Posted July 16, 2018 Author Share Posted July 16, 2018 The help file is saying : $WIN_STATE_EXISTS (1) = Window exists $WIN_STATE_VISIBLE (2) = Window is visible $WIN_STATE_ENABLED (4) = Window is enabled $WIN_STATE_ACTIVE (8) = Window is active $WIN_STATE_MINIMIZED (16) = Window is minimized $WIN_STATE_MAXIMIZED (32) = Window is maximized I have to change 16 to 23 ? My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted July 16, 2018 Share Posted July 16, 2018 @caramen If you try WinGetState() of the "osk.exe" process, what is the result? Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
caramen Posted July 16, 2018 Author Share Posted July 16, 2018 1 minute ago, FrancescoDiMuro said: @caramen If you try WinGetState() of the "osk.exe" process, what is the result? Duuuh Just noticed about WinGet and WinSet So to get the stat on a msg box or console i have to do what ? I tryed to msgBox myself but i make crashe on my TeamViewer session . My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted July 16, 2018 Share Posted July 16, 2018 1 minute ago, caramen said: So to get the stat on a msg box or console i have to do what ? Global $intWindowState = WinGetState("TitleoftheWindow") ConsoleWrite("The Window state is: " & intWindowState & @CRLF) Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
caramen Posted July 16, 2018 Author Share Posted July 16, 2018 (edited) 1 minute ago, FrancescoDiMuro said: Global $intWindowState = WinGetState("TitleoftheWindow") ConsoleWrite("The Window state is: " & intWindowState & @CRLF) Just had it with that Wait i am trying on my minimised keyboard $state = WinGetState ("osk.exe") MsgBox($MB_SYSTEMMODAL, "test", $state&"" ) Edited July 16, 2018 by caramen My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted July 16, 2018 Share Posted July 16, 2018 And what's the result? Try ConsoleWrite() if MsgBox() let your TW crashes Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
caramen Posted July 16, 2018 Author Share Posted July 16, 2018 (edited) 4 minutes ago, FrancescoDiMuro said: Global $intWindowState = WinGetState("TitleoftheWindow") ConsoleWrite("The Window state is: " & intWindowState & @CRLF) Error Btw i corrected your syntax with a $ 0 Edited July 16, 2018 by caramen My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted July 16, 2018 Share Posted July 16, 2018 @caramen Post the code which gives you the error Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
caramen Posted July 16, 2018 Author Share Posted July 16, 2018 (edited) @FrancescoDiMuro Here it is #Include <Array.au3> #include <AutoItConstants.au3> #include <MsgBoxConstants.au3> Opt ("WinTitleMatchMode", 2 ) While (1) OSK () WEnd Func OSK () Global $intWindowState = WinGetState("TitleoftheWindow") ConsoleWrite("The Window state is: " & $intWindowState & @CRLF) EndFunc Just noticed : ("TitleoftheWindow") lol it s working now ty i am gonna try that and come back here if i got some more problem. Edited July 16, 2018 by caramen My video tutorials : ( In construction ) || My Discord : https://discord.gg/S9AnwHw How to Ask Help || UIAutomation From Junkew || WebDriver From Danp2 || And Water's UDFs in the Quote Spoiler Water's UDFs:Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsPowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & SupportExcel - Example Scripts - WikiWord - Wiki Tutorials:ADO - Wiki Link to comment Share on other sites More sharing options...
FrancescoDiMuro Posted July 16, 2018 Share Posted July 16, 2018 @caramen Don't declare Global variables in Functions... They will be declared in Local scope anyway Ok, let us know Best Regards. Click here to see my signature: Spoiler ALWAYS GOOD TO READ: Forum Rules Forum Etiquette Link to comment Share on other sites More sharing options...
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