GRUPOS DE DISCUSSÃO PROFISSIONAL
WINDEV
,
WEBDEV
e
WINDEV Mobile
Inicio
|
Mensagens recentes
|
Conecte-se...
|
Disconnect
|
Português
Inicio
→
WINDEV 2024
→
How to Handle WM_COPYDATA
How to Handle WM_COPYDATA
Iniciado por meikl, jul., 28 2022 11:49 AM - 1 resposta
Conecte-se…
meikl
#1
Membro registado
118 mensagems
Publicado em julho, 28 2022 - 11:49 AM
Hi all,
i want forward from a not PCSoft-Application structured Data to a WinDEV-Application using the Windows-Message WM_COPYDATA.
I am able to catch this Message using the Event-Function. The LParam is a Pointer (an Address) to a COPYDATASTRUCT
CO
PYDATASTRUCT
is structure
dwData
is int
//Type C : DWORD - FormatType
cbData
is int
//Type C : DWORD - Size
lpData
is
system
int
//Type C : PVOID - Pointer to Data
END
This Structure itself has the Member lpData also a Pointer (an Address) to the needed structured Data.
How to access the COPYDATASTRUCT and then the lpData-Member there?
thanks in advance
meikl
Denunciar
0
0
meikl
#2
Membro registado
118 mensagems
Publicado em julho, 29 2022 - 9:01 AM
Hi all,
found the solution myself
will provide a small sceleton, if someone have a similar question:
//Handle Messages from Partner-App
Procedure
ManagePartnerEvents
(
pEvent
is int
,
pWParam
is int
,
pLParam
is
system
int
)
//If the Message was sent from Partner-App
IF
pWParam
=
gn
CommunicationPartnerHandle
THEN
//Examine Event
SWITCH
pEvent
//WM_Close (Partner wants to Terminate myself)
CASE
WM_CLOSE
Close
(
)
//close myself
RESULT
1
//Message handled
//WM_USER + 1300 (Partner wants a Live-Signal)
CASE
WM_ISALIVE
//TargetHandle provided in pLParam
//Signal Back, still alive, returning receiving Handle in LParam
PostMessage
(
pLParam
,
WM_USER
+
1
,
0
,
Handle
(
ST
C_MessageHandlerControl
)
)
RESULT
1
//Message handled
//WM_SETTEXT (Partner sends a string)
CASE
WM_SETTEXT
//String in this event is UniCode
s
Text
is string
=
StringRetrieve
(
pLParam
,
srUNICODEAddress
)
//Process sText ...
RESULT
1
//Message handled
//WM_COPYDATA (Partner sends structured Data)
CASE
WM_COPYDATA
//Variable of COPYDATASTRUCT-Type
cds
is
CO
PYDATASTRUCT
//Copy content from Pointer pLParam
Transfer
(
&
cds
,
pLParam
,
Dimension
(
cds
)
)
//Switch on the Structure-Type
SWITCH
cds.dwData
//in Case of Structure A
CASE
n
DataSructureAType
//Variable of Structure A
st
StructA
is
ST
_DataStructureA
//Copy content from Pointer cds.lpData
Transfer
(
&
st
StructA
,
cds.lpData
,
cds.cbData
)
//Process stStructA
RESULT
1
//Message handled
//in Case of Structure B
CASE
n
DataSructureBType
//Variable of Structure B
st
StructB
is
ST
_DataStructureB
//Copy content from Pointer cds.lpData
Transfer
(
&
st
StructB
,
cds.lpData
,
cds.cbData
)
//Process stStructB
RESULT
1
//Message handled
//Maybe more Cases
OTHER
CASE
END
OTHER
CASE
END
END
Thanks for reading
meikl
Mensagem modificada, julho, 29 2022 - 9:09 AM
Denunciar
0
0
→ Voltar para WINDEV 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (versões anteriores)
Français
English
Español
Portuguesa
Fermer cette fenêtre
Tipo de Pesquisa
Apenas tópicos
Todas as mensagens
Período de pesquisa
Qualquer momento
Última hora
Últimas 24 horas
Semana passada
Mês passado
Ano passado
Cancelar
Pré-visualização da sua mensagem
Adicionar imagem
Importar uma imagem de uma URL
Enviar uma imagem a partir do seu disco
Deixe um ficheiro ou clique em "Procurar ..."
ou
Cancelar
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Texto