home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
MediaPortal 1
Support
Input / Output interfaces
Green Button do not restore MP1 anymore
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Sebastiii" data-source="post: 1173810" data-attributes="member: 60104"><p>Before the code was : </p><p>[code=csharp]private static void OnClick(object sender, RemoteEventArgs e)</p><p>{</p><p>Process[] processes = Process.GetProcessesByName("mediaportal");</p><p></p><p> if (processes.Length != 0)</p><p> {</p><p> if (processes.Length > 1)</p><p> {</p><p> Log.Write("MPTray: More than one window named \"MediaPortal\" has been found!");</p><p> foreach (Process procName in processes)</p><p> {</p><p> Log.Write("MPTray: {0} (Started: {1}, ID: {2})", procName.ProcessName,</p><p> procName.StartTime.ToShortTimeString(), procName.Id);</p><p> }</p><p> }</p><p> Log.Write("MPTray: MediaPortal is already running - switching focus.");</p><p> SwitchFocus();</p><p>.....</p><p>}[/code]</p><p></p><p>We have the SwitchFocus(); call <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite1" alt=":)" title="Smile :)" loading="lazy" data-shortname=":)" /> so i think here when green button was pressed -> switchfocus.</p><p>The switch code didn't change but now we have the -> private void DoStart()</p><p></p><p>Maybe : </p><p>public void HandleHidEvent(object aSender, SharpLib.Hid.Event aHidEvent) need to be reworked ?</p><p></p><p>This was not here before, so if i understand if MP is in tray, it will be focused.</p><p>[code=csharp]if (aHidEvent.IsStray)</p><p> {</p><p> //Stray event just ignore it</p><p> return;</p><p> }[/code]</p></blockquote><p></p>
[QUOTE="Sebastiii, post: 1173810, member: 60104"] Before the code was : [code=csharp]private static void OnClick(object sender, RemoteEventArgs e) { Process[] processes = Process.GetProcessesByName("mediaportal"); if (processes.Length != 0) { if (processes.Length > 1) { Log.Write("MPTray: More than one window named \"MediaPortal\" has been found!"); foreach (Process procName in processes) { Log.Write("MPTray: {0} (Started: {1}, ID: {2})", procName.ProcessName, procName.StartTime.ToShortTimeString(), procName.Id); } } Log.Write("MPTray: MediaPortal is already running - switching focus."); SwitchFocus(); ..... }[/code] We have the SwitchFocus(); call :) so i think here when green button was pressed -> switchfocus. The switch code didn't change but now we have the -> private void DoStart() Maybe : public void HandleHidEvent(object aSender, SharpLib.Hid.Event aHidEvent) need to be reworked ? This was not here before, so if i understand if MP is in tray, it will be focused. [code=csharp]if (aHidEvent.IsStray) { //Stray event just ignore it return; }[/code] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
Support
Input / Output interfaces
Green Button do not restore MP1 anymore
Contact us
RSS
Top
Bottom