IanN1990 Posted August 14, 2012 Posted August 14, 2012 (edited) I am trying to close skype when i hit a hotkey, that makes my system script end. ControlSend("Windows Live Messenger", "", "[CLASS:WLXDUI; INSTANCE:2]", "^{F4}") Works for MSN but ControlSend("[Class:tSkMainForm]", "", "[CLASS:TConversationsControl; INSTANCE:1]", ^{F4}") doesn't seam to work for skype. Not does any other controlsend combenation i tryed. I cant use Winclose or Winkill as they make the application Log-out, which isnt what i am after. **I am aware of Mouseclick and Send commands, but they are very unrealiable. Are there any other ways of closing an application ? Edited September 8, 2012 by IanN1990
water Posted August 14, 2012 Posted August 14, 2012 There is a Skype UDF available. I'm sure there is a function to close Skype. My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
RedneckTech Posted August 14, 2012 Posted August 14, 2012 skype doesnt close with a close command, the process runs in the background. you have to run the following in the script: Run("taskkill /im skype.exe /f /t") its the same as going into the task manager and right clicking the process and killing it. it does not log you out
Moderators JLogan3o13 Posted August 14, 2012 Moderators Posted August 14, 2012 Hi, IanN1990. As Water mentioned, the Skype COM UDF located has a _skype_shutdown function. Should be a lot more smooth than just killing the process. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
RedneckTech Posted August 14, 2012 Posted August 14, 2012 Just used it that way in my experience. Seems clear cut because even in non scripting use, skype is just a pain in the ass because it never really closes unless you kill the process. Just wrote a SKYDIE.bat for my friends. (all win7 64-bit)
IanN1990 Posted August 14, 2012 Author Posted August 14, 2012 Thanks for everyones input on the topic. @Redneck Run("taskkill /im skype.exe /f /t"). I tryed this but it kills the application rather then closing the window. Which is what i am after, an example might be if i alt + f4 the msn window closes but it doesn't log me out of msn. As that kills the skype.exe when i re-run the application, instead of showing the window it needs to reconnect to skype @Water I tryed the UDF on the laptop downstairs but had a nightmare trying to get it to work "not the fault of the UDF but rather then laptop, so when i carmed down as something big kinda happened i will see if i can try again" but i do fear it would prob kill the skype.exe rather then just closing the application window.
RedneckTech Posted August 14, 2012 Posted August 14, 2012 OK. so you want to leave it open rather than kill it. I thought you meant as in alt+f4 just closes the window and you wanted to kill the process. If thats the case just:$Title = "Skype"WinActivate ($Title)Sleep (50)If WinActive ($Title) <> 0 Then WinClose ($Title)Else MsgBox (0, "", "window was not active")EndIfTry that. If it doesnt work try replacing: $Title = "Skype" with $Title = "Skype - *" and if that still doesnt work try $Title = "Skype - Username" where Username is your skype logon name.If none of those work then were back to the drawing board
IanN1990 Posted August 15, 2012 Author Posted August 15, 2012 (edited) I tryed that WinClose("[Class:tSkMainForm]") but this closes skype and makes the application exit. Alt + F4 just makes the window close "while in the trayicon skype remains active" **EDIT i dont suppose there is a quick-fix to this topic with the controlsend idea and maybe i have just used the function wrong ? Edited August 15, 2012 by IanN1990
AdamUL Posted August 16, 2012 Posted August 16, 2012 (edited) When you minimize the window, does it go to the tray? If so, try this. WinSetState("[Class:tSkMainForm]", "", @SW_MINIMIZE) Adam Edited August 16, 2012 by AdamUL
JohnOne Posted August 16, 2012 Posted August 16, 2012 Worth a go to try just this.ControlSend("[Class:tSkMainForm]", "", "", ^{F4}") AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
IanN1990 Posted August 16, 2012 Author Posted August 16, 2012 @Adam Tryed your code but it just minimizes the window. Doesnt close it @John I ran your code but got an error message D:DesktopNew AutoIt v3 Script.au3 (1) : ==> Unterminated string.: ControlSend("[Class:tSkMainForm]", "", "", ^{F4}") I changed it to ControlSend("[Class:tSkMainForm]", "", "", "^{F4}") but all it does is make the menu system a bit bigger. Doesn;t close the application I Thank everyone for their help, but i think skype is just too troublesome so i will put this idea to rest and try something else.
November Posted August 16, 2012 Posted August 16, 2012 (edited) @Adam Tryed your code but it just minimizes the window. Doesnt close it @John I ran your code but got an error message D:DesktopNew AutoIt v3 Script.au3 (1) : ==> Unterminated string.: ControlSend("[Class:tSkMainForm]", "", "", "^{F4}") I changed it to ControlSend("[Class:tSkMainForm]", "", "", "^{F4}") but all it does is make the menu system a bit bigger. Doesn;t close the application I Thank everyone for their help, but i think skype is just too troublesome so i will put this idea to rest and try something else. Missing something there an ", i tried the code and it's running. Cheers ControlSend("[Class:tSkMainForm]", "", "", "^{F4}") Edited August 16, 2012 by November Old Scriptology Visual Ping 1.8 - Mass Ping Program with export to txt delimited. Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code. Desktop 2 RGB - Pick a color in the desktop and get the RGB code. ShootIT 1.0 - Screen Capture full and partial screen [font="'Arial Black';"]Remember Remember The Fifth of November.[/font]
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