I recommend to not using self-defined message, but the standard MS
Windows's one, ie WM_COPYDATA.
Scenario:
1. Your Delphi App is to send WM_COPYDATA msg to your Harbour app. along
with data to be processed by your Harbour app.
2. Your Harbour app should be able to handle the message. You should
define a sub routine to handle WM_COPYDATA sent by your Delphi app. in
your Harbour app message handling routine.
Some docs:
The WM_COPYDATA message is sent when an application passes data to another application.
WM_COPYDATA
wParam = (WPARAM) (HWND) hwnd; // handle of sending window
lParam = (LPARAM) (PCOPYDATASTRUCT) pcds; // pointer to structure with data
Parameters
hwnd
Identifies the window passing the data.
pcds
Points to a COPYDATASTRUCT structure that contains the data to be passed.
Return Values
If the receiving application processes this message, it should return TRUE; otherwise, it should return FALSE.
Remarks
An application must use the SendMessage function to send this message, not the PostMessage function.
The data being passed must not contain pointers or other references to objects not accessible to the application receiving the data.
While this message is being sent, the referenced data must not be changed by another thread of the sending process.
The receiving application should consider the data read-only. The pcds parameter is valid only during the processing of the message. The receiving application should not free the memory referenced by pcds. If the receiving application must access the data after SendMessage returns, it must copy the data into a local buffer.
Andi
In cases like yours, I usually use WM_COPYDATA message to pass data from
one app to another, but I do not know the GTWVW side and how Harbour app
can handle these messages at prg level.
Regards,
Mindaugas
Hi Fabio
WM_COPYDATA is a very fast and efficient way to inter-app
communications. Much faster than COM.
But AFAIK nobody has yet made a wrapper for that in harbour.
HTH
Angel
> Ok, but I do not know how handle incoming data. How to inform a
> function to handle incoming data? In HWGUI I can use "ON OTHER
> MESSAGES", but GTWVW I do not know how to work. I tried using
> SetInkeyAfterBlock() and SetInkeyBeforeBlock(), but without success.
The scenario to handle incoming msg is as follow:
---8<---
// File: gtwvw.c
HB_EXPORT BOOL CALLBACK hb_gt_wvwDlgProcMLess
.....
switch( message )
{ ..........
case WM_COPYDATA:
{
// your handling routine here
}
HB_EXPORT BOOL CALLBACK hb_gt_wvwDlgProcModal
.....
switch( message )
{ ...........
case WM_COPYDATA:
{
// your handling routine here
}
---8<---
HTH
Andi