NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 … 37 38 39 40 41 … 93 Next »
setPopup not working + minimize window question

 
  • 0 Vote(s) - 0 Average
setPopup not working + minimize window question
bgowland
Offline

Posting Freak

West Yorkshire, UK
Posts: 4,591
Threads: 386
Joined: Dec 2004
#1
2007-12-13, 08:49 PM
Firstly - the setPopup call isn't working in this piece of code. Everything else is fine and I see the Logger messages for 'About to set popup' then the one for creating the process....but no popup appears.

Code:
Logger.Verbose("Play invoked");
if (DVBTRadioProc == null)
{
    Logger.Verbose("About to set popup");
    setPopup(new GBPVRX2.Popups.PopupMessageBox(this, "Starting DVB-T Radio service. Please wait..."));
    try
    {
        Logger.Verbose("About to create process for Dvbtr.exe");
        DVBTRadioProc = System.Diagnostics.Process.Start(GBInstallDir + @"plugins\DVB-T Radio\Dvbtr.exe", "529834 8 9018 16384 18560");
    }
    catch (Exception e)
    {
        Logger.Verbose(e.ToString());
    }
    finally
    {
        setPopup(null);
    }
}

Second question - Dvbtr.exe is a command-line program so I get a command prompt appear on screen. How do I start this minimized? I can see the Process.MainWindowHandle property but that is an IntPtr and I can't decide how to use it. Or is there another way?

Cheers,
Brian
whurlston
Offline

Posting Freak

Posts: 7,885
Threads: 102
Joined: Nov 2006
#2
2007-12-14, 05:05 AM
Are you sure that setPopup(null) isn't being fired before the popup is displayed?

As or the minimized window, you need to set the start parameters on the process. I have some exaple code somewhere. I'll try to find it.
JavaWiz
Offline

Posting Freak

Jacksonville, FL. USA
Posts: 2,522
Threads: 141
Joined: Dec 2006
#3
2007-12-14, 05:15 AM
bgowland Wrote:Firstly - the setPopup call isn't working in this piece of code. Everything else is fine and I see the Logger messages for 'About to set popup' then the one for creating the process....but no popup appears.

Code:
Logger.Verbose("Play invoked");
if (DVBTRadioProc == null)
{
    Logger.Verbose("About to set popup");
    setPopup(new GBPVRX2.Popups.PopupMessageBox(this, "Starting DVB-T Radio service. Please wait..."));
    try
    {
        Logger.Verbose("About to create process for Dvbtr.exe");
        DVBTRadioProc = System.Diagnostics.Process.Start(GBInstallDir + @"plugins\DVB-T Radio\Dvbtr.exe", "529834 8 9018 16384 18560");
    }
    catch (Exception e)
    {
        Logger.Verbose(e.ToString());
    }
    finally
    {
        setPopup(null);
    }
}

Second question - Dvbtr.exe is a command-line program so I get a command prompt appear on screen. How do I start this minimized? I can see the Process.MainWindowHandle property but that is an IntPtr and I can't decide how to use it. Or is there another way?

Cheers,
Brian
1) GBPVR does not have a chance to render your popup. You create it and destroy it in the same thread, same unit of work.

You should create the popup, then spawn a thread to Dvbtr work. When that (Dvbtr work) thread ends, you can set popup to null.

2) Take a look a ProcessStartInfo. You should be able to use ProcessStartInfo.CreateNoWindow to hide the window. If you only want to minimize, try ProcessStartInfo.WindowStyle = ProcessWindowStyle.Minimized.
bgowland
Offline

Posting Freak

West Yorkshire, UK
Posts: 4,591
Threads: 386
Joined: Dec 2004
#4
2007-12-14, 07:45 PM
Thanks guys.

I thought about it a bit more after I posted and it is probably the case that the popup just doesn't get the chance to appear. The Process.Start method is returning almost instantaneously. I'll probably just take the code out as it isn't really neccessary to have a 'Please wait..." message for an instant action. Smile

I'd briefly looked at ProcessStartInfo but hadn't spotted the window control stuff. I'll give it a try.

Cheers,
Brian
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,789
Threads: 769
Joined: Nov 2003
#5
2007-12-14, 08:00 PM
Sorry, I somehow missed this thread otherwise I would have replied. The guys have set you on the right path with their replies above.
whurlston
Offline

Posting Freak

Posts: 7,885
Threads: 102
Joined: Nov 2006
#6
2007-12-15, 01:15 AM
ProcessStartInfo was the start parameters I was refering to but I was too lazy to fire up VS and check. Sorry.
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  Web API only_new Question Gazavant 6 2,796 2021-04-04, 06:54 PM
Last Post: sub
  Another Artwork question scJohn 15 8,384 2019-09-10, 05:33 PM
Last Post: nonob
  WEB API GuidService/Listing question(s) scJohn 6 4,407 2017-08-09, 02:18 PM
Last Post: scJohn
  skin question pBS 2 3,383 2016-06-18, 07:03 PM
Last Post: pBS
  Another SQL question bgowland 15 7,461 2014-05-21, 08:09 AM
Last Post: bgowland
  Timing.Info question mvallevand 2 2,134 2013-04-19, 03:54 AM
Last Post: mvallevand
  visible="!@hasImage & folder.jpg in Music not working Jaggy 0 1,258 2012-02-10, 10:29 PM
Last Post: Jaggy
  N-PVR db3 EPG_EVENT time format question bgowland 3 2,182 2011-03-12, 05:26 AM
Last Post: bgowland
  Ping UncleJohnsBand (question about npvr soap) ioan 2 2,116 2011-02-18, 01:12 AM
Last Post: UncleJohnsBand
  Skin question - how to centre a list UiList control on screen? McBainUK 2 1,915 2011-02-17, 08:46 AM
Last Post: McBainUK

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode