[LINUX/MAC/WINDOWS] Force single instance of XBMC, run only one copy of the executabe
#1
Lightbulb 
Are there any switches that I can include in the shortcut to make xbmc.exe behave as follows (Vista Premium)?

I realize that I could write a vbscript or possibly use this application to achieve the following, but they seem to me inelegant solutions.

On execution of xbmc.exe
If xbmc.exe is running
then switch to xbmc.exe
and maximize window
and steal focus
else
start xbmc.exe
End If

Any ideas?

Thanks!
Reply
#2
-wde- Wrote:Are there any switches that I can include in the shortcut to make xbmc.exe behave as follows (Vista Premium)?

I realize that I could write a vbscript or possibly use this application to achieve the following, but they seem to me inelegant solutions.

On execution of xbmc.exe
If xbmc.exe is running
then switch to xbmc.exe
and maximize window
and steal focus
else
start xbmc.exe
End If

Any ideas?

Thanks!

http://forum.xbmc.org/showpost.php?p=211...stcount=41
Reply
#3
Thanks clackerdacker. I don't know how I missed that one. Huh I'm already using the part posted by TechLife.
Reply
#4
Lightbulb 
-wde- Wrote:Are there any switches that I can include in the shortcut to make xbmc.exe behave as follows (Vista Premium)?

I realize that I could write a vbscript or possibly use this application to achieve the following, but they seem to me inelegant solutions.

On execution of xbmc.exe
If xbmc.exe is running
then switch to xbmc.exe
and maximize window
and steal focus
else
start xbmc.exe
End If

Any ideas?

Thanks!
Please submit a new feature request on trac if you like this feature in XBMC nativly someday:
http://trac.xbmc.org

Wink
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
Reply
#5
Done for win32 as I would call it a bug Wink -> r15700
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
Reply
#6
Does XBMC have the same problem on Linux and Mac OS X? Huh
If so then please 'trac' those as well: http://trac.xbmc.org
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
Reply
#7
WiSo Wrote:Done for win32 as I would call it a bug Wink -> r15700


Thanks for taking care of that.
Reply
#8
Hello!

Me and many others use Vista, XBMC for win and a remote control. On my remote, I have with IR Server configured so that XBMC is opened with the green button. But if XBMC is opened but not focused, I want it to be focused when I press the green button. Now it opens another instance of XBMC.

Regards
Simon
Reply
#9
SimonZ Wrote:Hello!

Me and many others use Vista, XBMC for win and a remote control. On my remote, I have with IR Server configured so that XBMC is opened with the green button. But if XBMC is opened but not focused, I want it to be focused when I press the green button. Now it opens another instance of XBMC.

Regards
Simon


That is my exact situation. The post linked above (http://forum.xbmc.org/showpost.php?p...6&postcount=41)
will solve that issue.
Reply
#10
-wde- Wrote:That is my exact situation. The post linked above (http://forum.xbmc.org/showpost.php?p...6&postcount=41)
will solve that issue.

That shouldn't be needed for win32. XBMC checks if already an instance is running and if yes brings the focus back.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
Reply
#11
Question 
Since this happens to me quite often (starting xbmc twice or more with the remote) it would be nice to have only one xbmc allowed to run.

/needtotest
Reply
#12
Easy to do using mutex .. Should apply to all OS ..
The normal XBMC log IS NOT a debug log, to enable debug logging you must toggle it on under XBMC Settings - System or in advancedsettings.xml. Use XBMC Debug Log Addon to retrieve it.
Reply
#13
what do you think is this code in XBMC_PC.cpp doing:
Code:
// check if XBMC is already running
  HWND m_hwnd = FindWindow("SDL_app","XBMC Media Center");
  if(m_hwnd != NULL)
  {
    // switch to the running instance
    ShowWindow(m_hwnd,SW_RESTORE);
    SetForegroundWindow(m_hwnd);
    return 0;
  }

Not sure how you got two instances running.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.
Reply
#14
Wiso:-

Sorry I didn't check the code, I was just stating how it can be done.

I was able to reproduce this as well yesterday via commandline. I ran it one after the other via commandline. Will investigate again today .. It looks to be timing issue ..
The normal XBMC log IS NOT a debug log, to enable debug logging you must toggle it on under XBMC Settings - System or in advancedsettings.xml. Use XBMC Debug Log Addon to retrieve it.
Reply
#15
Confirmed can reproduce this .. It is timing issue .. You must run another instance of xbmc before the first instance of xbmc is initialized. I can see that user might accidently double click it twice.
The normal XBMC log IS NOT a debug log, to enable debug logging you must toggle it on under XBMC Settings - System or in advancedsettings.xml. Use XBMC Debug Log Addon to retrieve it.
Reply

Logout Mark Read Team Forum Stats Members Help
[LINUX/MAC/WINDOWS] Force single instance of XBMC, run only one copy of the executabe0