Results 1 to 10 of 10

Thread: PostMessage

  1. #1
    Join Date
    May 2006
    Location
    Canada
    Posts
    20,740

    PostMessage

    In a recent post you drew my attention to this feature

    - added support for control via PostMessage id=0x8007, wparam set to the keycode you want to send.

    This seems safer than sending keystrokes. How does this work to the NMT? I cannot find the hWnd to use in the call, either by the process or via a plugin in the application.

    Martin

  2. #2
    Join Date
    Nov 2003
    Location
    NextPVR HQ, Wellington, New Zealand
    Posts
    75,869
    I just looked into it, and that call is only relevant to PC frontend, not NMT/MVP.

  3. #3
    Join Date
    Dec 2004
    Location
    West Yorkshire, UK
    Posts
    4,484
    Martin - what are you trying to achieve? In other words, what is calling PostMessage and where does the message need to go?

  4. #4
    Join Date
    May 2006
    Location
    Canada
    Posts
    20,740
    I am revisiting some older code to allow wifi remote control of an NMT and a PC connected to the AVR and monitor. Wifi removes the need for line of sight and I get that with a mini wireless keyboards but that doesn't give me control from another room where I listen to a lot music.

    I can get separate programs to remote control each of them today, but not one programs, and these "remote" would not have knowledge of what NextPVR is currently doing.

    PostMessage() puts message into the Windows message queue from any "local" program that can get the programs window handle.

    Martin.

  5. #5
    Join Date
    Dec 2004
    Location
    West Yorkshire, UK
    Posts
    4,484
    PostMessage() puts message into the Windows message queue from any "local" program that can get the programs window handle.
    Yep, I get that bit - I've developed a number of Windows apps over the years which used various IPC calls.

    I am revisiting some older code to allow wifi remote control of an NMT and a PC connected to the AVR and monitor. Wifi removes the need for line of sight and I get that with a mini wireless keyboards but that doesn't give me control from another room where I listen to a lot music.

    I can get separate programs to remote control each of them today, but not one programs, and these "remote" would not have knowledge of what NextPVR is currently doing.
    Isn't it down to the user to have knowledge of what npvr is doing?

    If, for example, you're looking at having a program which receives 'commands' (for want of a better word), and you want to pass a command to an instance of nextpvr which is running as an NMT server...if your 'command' program knows which nextpvr.exe process is serving NMT-XYZ and knows its hWnd and you personally (as the human end of the action) know it has MusicBox4 running, then it could work????

  6. #6
    Join Date
    May 2006
    Location
    Canada
    Posts
    20,740
    Quote Originally Posted by bgowland View Post
    Isn't it down to the user to have knowledge of what npvr is doing?
    I often have the TV off when listening to music and still might like to have art, now playing, next song, etc.

    If, for example, you're looking at having a program which receives 'commands' (for want of a better word), and you want to pass a command to an instance of nextpvr which is running as an NMT server...if your 'command' program knows which nextpvr.exe process is serving NMT-XYZ and knows its hWnd and you personally (as the human end of the action) know it has MusicBox4 running, then it could work????
    I can't get the hWnd of an NMT instance which is what this thread is about. My original design was custom control of MB4 running as a mini server in NextPVR but I hoped it could be more generic and move it outside.

    Martin

  7. #7
    Join Date
    Dec 2004
    Location
    West Yorkshire, UK
    Posts
    4,484
    Quote Originally Posted by mvallevand View Post
    I often have the TV off when listening to music and still might like to have art, now playing, next song, etc.
    Sorry, but I don't get the bit about "art.....". But aside from that, if you know an NMT in the kitchen (for example) is connected to a nextpvr.exe instance with MusicBox active, why would it matter if the TV is off?

    I can't get the hWnd of an NMT instance which is what this thread is about.
    Hmmm, OK, possibly....perhaps I'm wrong but I always understood that even if a process is run as 'hidden' it has an hWnd through inheritance. But that's based purely on my understanding that NMT server instances of nextpvr.exe are basically hidden versions of what we normally see when starting the nextpvr.exe UI version. Perhaps hidden processes have a null hWnd. Not sure.

  8. #8
    Join Date
    Dec 2004
    Location
    West Yorkshire, UK
    Posts
    4,484
    This is my NMT server instance of NextPVR.exe. Don't know if that helps.

    Name:  winspy_nextpvr.JPG
Views: 39
Size:  81.2 KB

    WinSpy++

  9. #9
    Join Date
    May 2006
    Location
    Canada
    Posts
    20,740
    Quote Originally Posted by bgowland View Post
    Sorry, but I don't get the bit about "art.....". But aside from that, if you know an NMT in the kitchen (for example) is connected to a nextpvr.exe instance with MusicBox active, why would it matter if the TV is off?
    That was replying to your comment "Isn't it down to the user to have knowledge of what npvr is doing?" Sometimes you don't know what it is doing, but you still want to use the remote. Art - I still like to view the cover of the albums I have.

    I will try again to see if I can get the handle from a plugin.

    Martin

  10. #10
    Join Date
    May 2006
    Location
    Canada
    Posts
    20,740
    Quote Originally Posted by bgowland View Post
    This is my NMT server instance of NextPVR.exe. Don't know if that helps.
    One of the things I tried yesterday was

    hWnd = FindWindow("WindowsForms10.Window.8.app.0.33c0d9d" , "MVP Server");

    and it gets the same as the spied value, but using it for PostMessage doesn't work;

    Martin

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •