SageTV Community  

Go Back   SageTV Community > SageTV Development and Customizations > SageTV Customizations
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV Customizations This forums is for discussing and sharing user-created modifications for the SageTV application created by using the SageTV Studio or through the use of external plugins. Use this forum to discuss customizations for SageTV version 6 and earlier, or for the SageTV3 UI.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 06-04-2004, 11:10 PM
Opus4's Avatar
Opus4 Opus4 is offline
Administrator
 
Join Date: Sep 2003
Location: NJ
Posts: 19,624
Arrow Utility: SendMessage v2.2

The SendMessage utility has been upgraded to version 2.2, now allowing multiple messages to be sent to multiple windows with the ability to enclose parameters with spaces in quotes. Version 1 had to be run once for each message sent; v2 can have all messages included as command line parameters to a single run of the exe. This enables 'batching' message commands to have SageTV perform an operation or go to a specific menu when neither of those options are available through a single message command.

Example:
SendMessage.exe -C SageApp -N SageWin -m 1258 -W 0 42 56 4 4 4 20

This command sends 6 messages to SageTV, resulting in arriving at the "Archived shows recorded with SageTV" menu.

For SageTVClient, use SageClientApp instead of SageApp.

For more info on the messages available for SageTV, see the complete list of all SageTV Commands in the SageTV Commands section of the PDF manual in your SageTV directory. (p. 192 for v4.1)

If you are using the Hauppauge remote and its irremote.ini file to control SageTV, then you do not need this utility; see SendMsg() in updated Hauppauge IR software

SageTV v4.1 currently ships with SendMessage v2.2.

11-22-05, new for v2.1
  • The ability to enclose parameters with spaces in quotes, such as the WindowClassName and WindowName parameters, -C and -N.
12-03-05, new for v2.2
  • The usage dialog is only shown if no parameters are used, an incorrect parameter is used, or an incomplete set of parameters is used such that no attempt was made to send a messsage.
  • At exit, the program returns the number of messages sent, or -1 if there was an error.

- Andy

Note: This utility should already be in your SageTV install directory.
Attached Files
File Type: zip SendMessageV2_2.zip (19.0 KB, 2053 views)
__________________
SageTV Open Source v9 is available.
- Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1.
- Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus
- HD Extenders: A) FAQs B) URC MX-700 remote setup
Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request.
Reply With Quote
  #2  
Old 11-06-2005, 04:18 PM
dooferlad's Avatar
dooferlad dooferlad is offline
Sage Advanced User
 
Join Date: Aug 2004
Posts: 165
Sending messages to windows with spaces in the window name

I was hoping to put together a quick network encoder for my digital TV card (no BDA drivers for it yet) based on SendMessage.exe. Unfortunately the window name is "DigiTV - ", which makes SendMessage throw up the usage window. Is there any way of geting it to search for a window with a space in the window name, or just any window of the specified class?

Thanks
Reply With Quote
  #3  
Old 11-07-2005, 12:07 AM
Opus4's Avatar
Opus4 Opus4 is offline
Administrator
 
Join Date: Sep 2003
Location: NJ
Posts: 19,624
Quote:
Originally Posted by dooferlad
Unfortunately the window name is "DigiTV - ", which makes SendMessage throw up the usage window. Is there any way of geting it to search for a window with a space in the window name, or just any window of the specified class?
You can try v2.1, attached below. I changed the way it parses the parameters, so you can place any of them in quotes now. (This attachment will be removed after this test. Once I'm fairly sure that the updated version is working satisfactorily, I will post it elsewhere.)

- Andy
__________________
SageTV Open Source v9 is available.
- Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1.
- Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus
- HD Extenders: A) FAQs B) URC MX-700 remote setup
Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request.
Reply With Quote
  #4  
Old 11-07-2005, 03:46 AM
dooferlad's Avatar
dooferlad dooferlad is offline
Sage Advanced User
 
Join Date: Aug 2004
Posts: 165
Thanks Andy - I will give it a go this evening.
Reply With Quote
  #5  
Old 11-21-2005, 07:06 PM
fafurd fafurd is offline
Sage User
 
Join Date: Feb 2004
Posts: 47
I'm trying to use this utility on the command line to close winamp, but I always get the help dialog. This is what I'm trying to send:

sendmessage -C "BaseWindow_RootWnd" -N "Winamp 1.x" -M 16 -W 0

I think I have the class name and windowname correct, but not sure. If the class and window names are incorrect, what does it do? Could this be my problem?
Reply With Quote
  #6  
Old 11-21-2005, 07:36 PM
Opus4's Avatar
Opus4 Opus4 is offline
Administrator
 
Join Date: Sep 2003
Location: NJ
Posts: 19,624
Which version of SendMessage are you trying? I removed v2.1 above, since the other person decided not to use it & I haven't tested further with it. v2.0 will not work with quotes or spaces in the window/class names.

- Andy
__________________
SageTV Open Source v9 is available.
- Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1.
- Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus
- HD Extenders: A) FAQs B) URC MX-700 remote setup
Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request.
Reply With Quote
  #7  
Old 11-21-2005, 09:33 PM
fafurd fafurd is offline
Sage User
 
Join Date: Feb 2004
Posts: 47
Ah, that's probably my problem. I'm trying to use 2.0. Would it be a lot of work to change to allow spaces? If you don't have the time, could I get the source so I can add it?
Reply With Quote
  #8  
Old 11-21-2005, 10:36 PM
Opus4's Avatar
Opus4 Opus4 is offline
Administrator
 
Join Date: Sep 2003
Location: NJ
Posts: 19,624
Attached to this post is v2.1 again. If you try it out, please let me know how it works with quoted parameters containing spaces...

If I get no feedback, I'll be removing it again in a day or so.

If you tell me that it works, I'll remove the attachment & make v2.1 generally available elsewhere.

- Andy
__________________
SageTV Open Source v9 is available.
- Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1.
- Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus
- HD Extenders: A) FAQs B) URC MX-700 remote setup
Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request.
Reply With Quote
  #9  
Old 11-21-2005, 11:40 PM
fafurd fafurd is offline
Sage User
 
Join Date: Feb 2004
Posts: 47
Well, I'm still having problems. I'm sure it works, but I'm not sure what I'm doing wrong. I'm just trying to close winamp using the following.

sendmessage -C "BaseWindow_RootWnd" -N "Winamp 1.x" -M 16 -W 0

I also tried -> sendmessage -C "BaseWindow_RootWnd" -N "Winamp 5.112" -M 16 -W 0

and still no luck; it just keeps giving me the help dialog box. I'm also using spy++ to get the window name and class name.

In what cases will the help dialog appear?

Cheers and thanks for the help.
Reply With Quote
  #10  
Old 11-22-2005, 12:28 AM
Opus4's Avatar
Opus4 Opus4 is offline
Administrator
 
Join Date: Sep 2003
Location: NJ
Posts: 19,624
The usage dialog appears if there are no parameters, an unrecognized parameter, or no message was sent for whatever reason... of course, I never added code to explain which of those conditions occurred.

Anyway: please read the usage dialog a little more closely; you are missing the lParam parameter, since it wasn't specified directly with the -L parameter or indirectly as another number at the end of the list. So, you are getting a valid dialog that is trying to point out the usage.

If it still doesn't work after that, then either there is a problem with the window and/or class names, or my changes to allow quoted params isn't working correctly.

- Andy
__________________
SageTV Open Source v9 is available.
- Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1.
- Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus
- HD Extenders: A) FAQs B) URC MX-700 remote setup
Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request.
Reply With Quote
  #11  
Old 11-22-2005, 11:24 AM
fafurd fafurd is offline
Sage User
 
Join Date: Feb 2004
Posts: 47
Well, still having problems with winamp, so I decided to try something simpler (notepad) and was successful issuing the WM_CLOSE with the spaces in the WindowName.

sendmessage -N "Untitled - Notepad" -C Notepad -M 16 0 0

This tells me that maybe I have the incorrect WindowName or ClassName...or something.

Thanks. I'll continue looking into my specific issue, but it appears to be working.

Edit:
I just figured it out. I thought the classname was the windowname and vis versa...ugh. Here they are for windows media and winamp.

Winamp: sendmessage "Winamp v1.x" "Winamp 5.11" 16 0 0
Windows Media Player: sendmessage "WMPlayerApp" "Windows Media Player" 16 0 0
Reply With Quote
  #12  
Old 11-22-2005, 01:10 PM
Opus4's Avatar
Opus4 Opus4 is offline
Administrator
 
Join Date: Sep 2003
Location: NJ
Posts: 19,624
Thanks for letting me know it works. I gave the SendMessage discussion its own thread now, with v2.1 available in the first post.

- Andy
__________________
SageTV Open Source v9 is available.
- Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1.
- Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus
- HD Extenders: A) FAQs B) URC MX-700 remote setup
Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request.
Reply With Quote
  #13  
Old 11-22-2005, 10:57 PM
fafurd fafurd is offline
Sage User
 
Join Date: Feb 2004
Posts: 47
Actually, If I can make another request.

Instead of displaying the parameter dialog box when the sendmessage fails (not because of bad params), have it just not do anything and maybe just return a dos type return code. The help dialog should probably be only reserved for poorly fomatted commands. The reason I ask is that I occasionally send a blind message, but the window may or may not be available and that's okay. The problem now is that it pops up the help dialog when the window is not available.
Reply With Quote
  #14  
Old 11-22-2005, 11:12 PM
Opus4's Avatar
Opus4 Opus4 is offline
Administrator
 
Join Date: Sep 2003
Location: NJ
Posts: 19,624
I can do something like that and/or add a 'quiet' option to never display the usage dialog -- but it will have to wait several days. Not much will get done around here over Thanksgiving.

- Andy
__________________
SageTV Open Source v9 is available.
- Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1.
- Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus
- HD Extenders: A) FAQs B) URC MX-700 remote setup
Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request.
Reply With Quote
  #15  
Old 11-22-2005, 11:21 PM
fafurd fafurd is offline
Sage User
 
Join Date: Feb 2004
Posts: 47
That would be great. I'm not in a hurry as I'll be just as busy.
Reply With Quote
  #16  
Old 12-02-2005, 11:44 PM
Opus4's Avatar
Opus4 Opus4 is offline
Administrator
 
Join Date: Sep 2003
Location: NJ
Posts: 19,624
Updated for v2.2

Now that Thanksgiving has been over for at least a couple days, I promptly got back to updating this program; see the first post for the download. Changes:

12-03-05, new for v2.2
  • The usage dialog is only shown if no parameters are used, an incorrect parameter is used, or an incomplete set of parameters is used such that no attempt was made to send a messsage.
  • At exit, the program returns the number of messages sent, or -1 if there was an error.
- Andy
__________________
SageTV Open Source v9 is available.
- Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1.
- Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus
- HD Extenders: A) FAQs B) URC MX-700 remote setup
Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request.
Reply With Quote
  #17  
Old 12-05-2005, 11:01 AM
fafurd fafurd is offline
Sage User
 
Join Date: Feb 2004
Posts: 47
Great, I'll give it a try tonight.
Reply With Quote
  #18  
Old 02-14-2006, 10:54 AM
DCipher DCipher is offline
Sage User
 
Join Date: Jun 2004
Posts: 50
OK, I'm a bit frustrated now... i can't seem to get Sage to respond to any messages. I've tried from Girder using the SendMessage plugin (Message number 1258, wparam 0, lparam 5 for example) and from SendMessage (2.2) with no luck.

Do i need to configure anything in sage to listen for windows messages?

I'm trying something very simple, just trying to use "down" a bunch of times... no luck:

SendMessage -C SageApp -N SageWin -m 1258 -W 0 5 5 5

Nothing.

I'm running sage 4.1.4 w/ the latest SageMCE 16x9 STV.

TIA,
Jeff
__________________
SageTV 4.1.10 w/ SageMC16x9
TheaterTek 2.2.1

P4 2.6 Ghz, 768 MB RAM, 80 GB
NVidia 6600GT, M-Audio Delta Dio 24/96, Sony DVD, DIGN case w/ VFD
Reply With Quote
  #19  
Old 02-14-2006, 11:41 AM
Opus4's Avatar
Opus4 Opus4 is offline
Administrator
 
Join Date: Sep 2003
Location: NJ
Posts: 19,624
Is this for a client? If so you have to use SageClientApp instead of SageApp.

There isn't anything to configure inside SageTV. If it gets a command that it knows how to respond to, it will do so.

- Andy
__________________
SageTV Open Source v9 is available.
- Read the SageTV FAQ. Older PDF User's Guides mostly still apply: SageTV V7.0 & SageTV Studio v7.1.
- Hauppauge remote help: 1) Basics/Extending it 2) Replace it 3) Use it w/o needing focus
- HD Extenders: A) FAQs B) URC MX-700 remote setup
Note: This is a users' forum; see the Rules. For official tech support fill out a Support Request.
Reply With Quote
  #20  
Old 02-14-2006, 01:09 PM
DCipher DCipher is offline
Sage User
 
Join Date: Jun 2004
Posts: 50
It's for server... actually, i rebooted my machine and now SendMessage is working fine. I think something got messed up by Girder.

Girder is not working properly. Not sure why. Time to head over to the girder forums!

Thanks
__________________
SageTV 4.1.10 w/ SageMC16x9
TheaterTek 2.2.1

P4 2.6 Ghz, 768 MB RAM, 80 GB
NVidia 6600GT, M-Audio Delta Dio 24/96, Sony DVD, DIGN case w/ VFD
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -6. The time now is 11:40 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.