View previous topic :: View next topic |
Author |
Message |
cybermat Newbie
Joined: 24 Nov 2005 Posts: 16
|
Posted: Sun Dec 18, 2005 2:35 pm Post subject: Is there a Way to close the application opened with Salling? |
|
|
Sorry for the dumb question...but if i open BS player and then i would like to open Winamp, i can't close BS player window, so after many clicks i have on the desktop Itunes, Bs player and other programs opened.
Is there a way to close them?
Thank U |
|
Back to top |
|
 |
salling Site Admin
Joined: 27 Jul 2004 Posts: 7498 Location: Stockholm, Sweden
|
Posted: Sun Dec 18, 2005 5:02 pm Post subject: Re: Is there a Way to close the application opened with Sall |
|
|
Hi,
At this time there's not.
Best.
--
Jonas
[quote="cybermat"]Sorry for the dumb question...but if i open BS player and then i would like to open Winamp, i can't close BS player window, so after many clicks i have on the desktop Itunes, Bs player and other programs opened.
Is there a way to close them?
Thank U[/quote] |
|
Back to top |
|
 |
cybermat Newbie
Joined: 24 Nov 2005 Posts: 16
|
Posted: Mon Dec 19, 2005 6:01 pm Post subject: |
|
|
Ok , so i'll make starting the mouse pointing service in order to click on "x" :D |
|
Back to top |
|
 |
daffy Junior Member
Joined: 14 Jan 2006 Posts: 36 Location: Erlangen, Germany
|
Posted: Mon Jan 16, 2006 9:28 pm Post subject: |
|
|
Now there are ways.
1. add a quit menu item
Example Windows Media Player:
In the beginning of the MediaPlayer.js file under //Initialize more Menu
add
moreMenuItems[8] = "Quit";
and
moreMenuItemUUIDs[8] = "quit";
2. to quit a program there are several ways.
2.1. one that should always work:
-check if program is open and get its handle by FindWindow()
-if it is open, then activate it by ActivateWindow() and close the program by sending the keystroke ALT+F4 by SendVirtualKeystroke(0x73,false,false,true,false);
Example for Windows Media Player:
change the function moreMenu_Value(theScreen, theProperty) to
function moreMenu_ValueUpdated(theScreen, theProperty)
{
setting_moremenu_item = theScreen.selectedItem;
writeSettings();
//----new for closing
if (moreMenuItemUUIDs[theScreen.selectedItem] == "quit") {
var wmpwh = FindWindow("WMPlayerApp", "Windows Media Player");
if (wmpwh != 0) {
theTerminal.PopTo("Windows Media Player");
player.controls.Stop();
ActivateWindow(wmpwh);
SendVirtualKeystroke(0x73,false,false,true,false);
}
} else
//---- end new
if(moreMenuItemUUIDs[theScreen.selectedItem] != "") {
theTerminal.ExecuteScript(moreMenuItemUUIDs[theScreen.selectedItem]);
}
}
2.2. if the Program "understands" a "close" command and you now it, then you can just send the "close signal".
Example BSPlayer in the file BSPlayer.js :
In the function moreMenu_ValueUpdated(theScreen, theProperty)
exchange the if-loop by
if( uuid == "quit" ) {
var bspwh = FindWindow( "BSPlayer", "" );
if( bspwh == 0 ) throw "null player";
SendMessage( bspwh, WM_BSP_CMD, BSP_Exit, 0 );
theTerminal.PopTo("BSPlayer");
return false;
} else if( uuid != "" ) {
theTerminal.ExecuteScript(moreMenuItemUUIDs[theScreen.selectedItem]);
// Force an update of the mediaplayer widget, before the next track starts
currentSong = null;
currentAlbum = null;
}
Here the variable BSP_Exit must be initialized or replaced by its value (which is 77). In my opinion and to go conform with the rest of the code, this should be done in the beginning of the file, where the other BSP_ variables are initialized by
var BSP_Exit = 77; |
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|