View Full Version : Feature Request - Send Messages other than WM_COMMAND
JeffK
October 13th, 2002, 03:55 PM
Subject pretty much says it all. One app in particular I'd like to control is dTV, and they've published the messages used for getting/setting various configuration items, but since they're not WM_COMMAND messages I can't use them from Girder. (Unless I'm missing something). Basically what I'd need is an extra textbox on that tab that would let me enter the numeric value of the message, or maybe a WM_USER option that I could specify the offset from the WM_USER values (ie. WM_USER + 3)
Thanks for a great product.
Jeff
Ron
October 13th, 2002, 03:55 PM
Jeff,
There is actually some code in Girder that
does this but i'm not happy with it because
most of the time the WM_USER numbers change
when an application restarts thus making
it a very dangerous function. I'll reconsider
putting it back in.
-Ron
wesc
October 13th, 2002, 03:55 PM
Would be good to do this for WM_USER as well as registered "text" window messages.
As long as any app that has called RegisterWindowMessage is active, that window message will be constant (actually not sure if windows even garbage collects registered window messages...) As for WM_USER+n, those are also constant. the #define for WM_USER has been constant since windows 1.0...
-Wes
JeffK
October 13th, 2002, 03:55 PM
Yeah, I don't think you have to worry about WM_USER changing. But if I could just enter the numeric value of the message I want to send, that would be pretty useful, and I'm guessing would take very few changes to the code since you already have the capability to send predefined messages.
Jeff
Ron
October 13th, 2002, 03:55 PM
I was refering to the RegisterWindowMessage
this one gives back a different number
everytime windows restarts, and if im
not mistaking it also is a number about
WM_USER.
-Ron
Yvonus
October 13th, 2002, 03:55 PM
Jeff .. I'm the one who's posted a sample Girder export group for dTV as I'm a day to day user of Girder and the FAQ maintainer for dTV.
I have not the knowledge you have about the types of messages you've got but it seems to me that captured messages are the most efficient/compatible way to trigger events from one machine to one another.
Your statement, despite myself not understanding it fully, does not concur that point of view does it ?
My 2 cents ; despite the group export feautre, it would be great to provide "items" or "codes" to trigger a specific action. We could maintain, for dTV or for another platform, a list of keyboard shortcuts and a list of "event codes" that one could type in by hand rather than importing.
JeffK
October 13th, 2002, 03:55 PM
Sorry I haven't been back to this board in a while, but let me clarify. Although registered window messages can change value, WM_USER is a specific value defined in <windows.h> that is not going to change any time in the foreseeable future, so there should be no problem with this. But I don't necessarily think we should be limited to WM_USER if this feature were to be added. What I think would be cool is to be able to send any message I want. That way, if Girder doesn't directly support doing something I want to do, I can do it myself as long as I know the messages involved.
To give you an idea of why I think this would be useful, here's a snipped from dtv_control.h, which dTV publishes to allow other programs to control their software. It would be pretty cool if I could use this information to send messages directly to dTV from Girder.
/////////////////////////////////////////////////////////////////////////////
// dTV_Control.h
/////////////////////////////////////////////////////////////////////////////
// Copyright (c) 2000 John Adcock. All rights reserved.
/////////////////////////////////////////////////////////////////////////////
//
// Notes for writers of external apps
//
// To use control dTV using an external app you can use SendMessage to
// perform both commands and to get/set all the settings
//
// To perform commands use the WM_COMMAND message
// e.g. SendMessage(hWndDTV, WM_COMMAND, IDM_OSD_SHOW, 0);
//
// To get settings use the appropriate WM_XXX_GETVALUE
// e.g. Brightness = SendMessage(hWndDTV, WM_BT848_GETVALUE, BRIGHTNESS, 0);
//
// To set settings use the appropriate WM_XXX_SETVALUE
// e.g. SendMessage(hWndDTV, WM_BT848_SETVALUE, HUE, NewHueValue);
//
// The dTV window handle can be obtained using
// hWndDTV = FindWindow("dTV", NULL);
//
/////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////
// Control Messages passed using WM_COMMAND
/////////////////////////////////////////////////////////////////////////////
#ifdef DTV_EXTERNAL
#define IDM_VT_RESET 261
#define IDM_RESET 280
#define IDM_TAKESTILL 485
#define IDM_OVERLAY_STOP 590
#define IDM_OVERLAY_START 591
#define IDM_HIDE_OSD 592
#define IDM_SHOW_OSD 593
// IDM_SET_OSD_TEXT the lParam must be the handle of a global atom
#define IDM_SET_OSD_TEXT 594
#define IDM_SASPECT_COMPUTE 731
#endif
/////////////////////////////////////////////////////////////////////////////
// Control settings contained in AspectRatio.c
/////////////////////////////////////////////////////////////////////////////
typedef enum
{
OVERSCAN,
SOURCE_ASPECT,
CUSTOM_SOURCE_ASPECT,
TARGET_ASPECT,
CUSTOM_TARGET_ASPECT,
ASPECT_MODE,
LUMINANCETHRESHOLD,
IGNORENONBLACKPIXELS,
AUTODETECTASPECT,
ZOOMINFRAMECOUNT,
ASPECTHISTORYTIME,
ASPECTCONSISTENCYTIME,
VERTICALPOS,
HORIZONTALPOS,
ASPECT_SETTING_LASTONE,
} ASPECT_SETTING;
#define WM_ASPECT_GETVALUE (WM_USER + 1)
#define WM_ASPECT_SETVALUE (WM_USER + 100)
/////////////////////////////////////////////////////////////////////////////
// Control settings contained in Bt848.c
/////////////////////////////////////////////////////////////////////////////
typedef enum
{
BRIGHTNESS = 0,
CONTRAST,
HUE,
SATURATION,
SATURATIONU,
SATURATIONV,
BDELAY,
BTAGCDISABLE,
BTCRUSH,
BTEVENCHROMAAGC,
BTODDCHROMAAGC,
BTEVENLUMAPEAK,
BTODDLUMAPEAK,
BTFULLLUMARANGE,
BTEVENLUMADEC,
BTODDLUMADEC,
BTEVENCOMB,
BTODDCOMB,
BTCOLORBARS,
BTGAMMACORRECTION,
BTCORING,
BTHORFILTER,
BTVERTFILTER,
BTCOLORKILL,
BTWHITECRUSHUP,
BTWHITECRUSHDOWN,
CURRENTX,
CUSTOMPIXELWIDTH,
VIDEOSOURCE,
TVFORMAT,
BT848_SETTING_LASTONE,
} BT848_SETTING;
#define WM_BT848_GETVALUE (WM_USER + 2)
#define WM_BT848_SETVALUE (WM_USER + 102)
Ron
October 13th, 2002, 03:55 PM
JeffK,
Its your lucky day, I have a plugin ready that does just that. I hope to release the stuff tomorrow.
-Ron
Ron
October 13th, 2002, 03:55 PM
Its released check out Girder 3.0.22pre2
-Ron
JeffK
October 13th, 2002, 03:55 PM
Ron,
Thanks a lot! This is very good news. I'll give it a try this weekend.
Turns out this will be useful not only dTV, but for the ATI MMC app that is used for TV, CD, and DVD playback. ATI just released a document and DLL that provide a SendMessage()-based programmatic interface to their software.
With your new plugin I should be able to accomplish control of the ATI MMC without writing my own control app.
Thanks again,
Jeff
JeffK
October 13th, 2002, 03:55 PM
Well, things got busy for me and I just now got around to trying out the SendMessage plugin.
At first, I couldn't get it to work. Then I discovered that by swapping the values for lparam and wparam I was able to get the expected behavior. Is it possible that there's a bug in the plug-in causing it to inadvertantly swap these values?
Jeff
Ron
October 13th, 2002, 03:55 PM
Jeff,
I just rechecked in the source code and with a spy tool and the values are correct. Are you sure you entered the values correctly the first time ?
-Ron
JeffK
October 13th, 2002, 03:55 PM
RonB wrote:
Jeff,
I just rechecked in the source code and with a spy tool and the values are correct. Are you sure you entered the values correctly the first time ?
-Ron
You're right, I don't think the problem is Girder, but rather the app I'm trying to control or my understanding of that app. I have to play with it some more I guess.
Thanks,
Jeff
vBulletin® v3.7.4, Copyright ©2000-2008, Jelsoft Enterprises Ltd.