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
Development
General Development (no feature request here!)
Remote Call To Close MP
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="colbsure" data-source="post: 572672" data-attributes="member: 88588"><p>Okay - I know it's a bit mad responding to my own post but it may help somebody...</p><p></p><p>I was wanting to use the Multishortcut plugin to start Maximus Arcade (an emulator front end) - this worked fine but I didn't want media portal hanging around in the background. </p><p></p><p>Initially, I wrote a small program which took as parameters a string and an executable path. The program then searched out all windows containing the string and sent a WM_CLOSE to each - afterwards it ran the specified executable (in my case MaximusArcade).</p><p></p><p>Unfortunately, testing revealed that the WM_CLOSE didn't seem to be doing the job consistently (I'm not sure why). I was not overly keen on using the TerminateProcess API as it is not generally recommended. Whilst researching I came across this Dr Dobbs article: </p><p>h??p://www.drdobbs.com/windows/184416547?pgno=1 </p><p>...it offers a "safer" alternative to TerminateProcess (see the article for details - it's quite interesting).</p><p></p><p>So... I have modified my program to send the WM_CLOSE, wait a user specified number of milliseconds and then check if the window is still present... if it is then a SafeTerminateProcess is used to kill the darn thing. It all seems to be working fine thus far and I am able to switch between Maximus Arcade and Mediaportal cleanly. Next on the list is Comic Rack.</p><p></p><p>If anybody wants the source code they are welcome - just PM me.</p></blockquote><p></p>
[QUOTE="colbsure, post: 572672, member: 88588"] Okay - I know it's a bit mad responding to my own post but it may help somebody... I was wanting to use the Multishortcut plugin to start Maximus Arcade (an emulator front end) - this worked fine but I didn't want media portal hanging around in the background. Initially, I wrote a small program which took as parameters a string and an executable path. The program then searched out all windows containing the string and sent a WM_CLOSE to each - afterwards it ran the specified executable (in my case MaximusArcade). Unfortunately, testing revealed that the WM_CLOSE didn't seem to be doing the job consistently (I'm not sure why). I was not overly keen on using the TerminateProcess API as it is not generally recommended. Whilst researching I came across this Dr Dobbs article: h??p://www.drdobbs.com/windows/184416547?pgno=1 ...it offers a "safer" alternative to TerminateProcess (see the article for details - it's quite interesting). So... I have modified my program to send the WM_CLOSE, wait a user specified number of milliseconds and then check if the window is still present... if it is then a SafeTerminateProcess is used to kill the darn thing. It all seems to be working fine thus far and I am able to switch between Maximus Arcade and Mediaportal cleanly. Next on the list is Comic Rack. If anybody wants the source code they are welcome - just PM me. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
MediaPortal 1
Development
General Development (no feature request here!)
Remote Call To Close MP
Contact us
RSS
Top
Bottom