1. How do I do this in Euphoria? Structs and Windows Messages
- Posted by Stephen Short <smshort1 at comcast.net> May 29, 2004
- 589 views
Is there anyone who can show me how to do this with Euphoria? Windows Messages. The communications bridge will accept the WM_COMMAND Windows message with the following parameters: WORD parameter (wParam) Ordinal Value IDC_REGISTER 300 IDC_UNREGISTER 301 IDC_TXDATA 302 IDC_REGISTER: This is sent with the LONG parameter (lParam) providing a far pointer to a REGMESSAGE data structure containing the handle of the window to notify, the message to transmit and also a WORD identifier to specify uniquely identify the message. On receiving the IDC_REGISTER message, the communications bridge will add the parameters to it's current notification list. Subsequent reception of X-10 functions will then cause the current device status to be posted to the registered windows. The LONG parameter of the posted message will contain a far pointer to an array of bytes identifying the current device status. This pointer should be copied to the local memory immediately as it is volatile. The array of bytes is segmented into four groups of 256 bytes and a group of 14 bytes detailing the following information: typedef struct tagREGMESSAGE { HWND hWnd UINT uiMessage WPARAM wParam }REGMESSAGE; Group 1: Lamp brightness level (0 for off, 100 for full brightness and 254 for an undefined brightness level. Group 2: Appliance status (0 for off and 255 for on). Group 3: Number of 'On' commands that have been received for the indexed device. Group 4: Number of 'Off' commands that have been received for the indexed device. Group 5: 14 bytes detailing device specific information received from the interface. This data may be expressed in a REGDATA structure. typedef struct tagREGMESSAGE { BYTE bStatus[4][256] BYTE bDeviceData[14] }REGMESSAGE; IDC_UNREGISTER: This message should be sent before the application terminates. The message must not be posted as the application may terminate before the message is received causing invalid data to be received. As for the IDC_REGISTER message, the LONG parameter should contain a far pointer to a REGMESSAGE structure that defines the application's parameters. typedef struct tagREGMESSAGE { HWND hWnd UINT uiMessage WPARAM wParam }REGMESSAGE; IDC_TXDATA: This message is used to send a command on the power line. The LONG parameter of the message may contain a far pointer to a buffer containing the command that is to be sent, or if the high word is null, the parameter may contain a command index to cause a configuration command to be transmitted to the interface. Thanks to anyone who can help me with this!
2. Re: How do I do this in Euphoria? Structs and Windows Messages
- Posted by Stephen Short <smshort1 at comcast.net> May 30, 2004
- 528 views
Please someone who understands C/C++ and Euphoria. All I need to know is how to create the structures listed in C code within Euphoria. I know it has something to do with Types. Then I just need to know How to Send Windows Messages with Euphoria. Thanks
3. Re: How do I do this in Euphoria? Structs and Windows Messages
- Posted by Evan Marshall <1evan at sbcglobal.net> May 30, 2004
- 539 views
typedef struct tagREGMESSAGE { BYTE bStatus[4][256] BYTE bDeviceData[14] }REGDATA; }}} <eucode>--NOT REGMESSAGE</eucode> {{{ typedef struct tagREGMESSAGE { HWND hWnd UINT uiMessage WPARAM wParam }REGMESSAGE;
atom REGDATA, REGMESSAGE REGDATA = allocate(1038) REGMESSAGE = allocate(12)
4. Re: How do I do this in Euphoria? Structs and Windows Messages
- Posted by Evan Marshall <1evan at sbcglobal.net> May 30, 2004
- 553 views
Oops, should be; typedef struct tagREGDATA }}} <eucode>--misprint in comm bridge help file</eucode> {{{ { BYTE bStatus[4][256] BYTE bDeviceData[14] }REGDATA; --NOT REGMESSAGE typedef struct tagREGMESSAGE { HWND hWnd UINT uiMessage WPARAM wParam }REGMESSAGE; atom REGDATA, REGMESSAGE REGDATA = allocate(1038) REGMESSAGE = allocate(12)