Message to the program from Excel

Post Reply
Natter
Posts: 524
Joined: Mon May 14, 2007 9:49 am

Message to the program from Excel

Post by Natter »

I need to send a message to the program from Excel Run the macro
.................
hW=findwindow(Header_MtApp)
PostMessage(hW, WM_USER, 50000, 0)

The main window of my program - TDialog I'm trying to handle external messages through its Handleevent method (by Daniel)

CLASS TMyDialog FROM TDialog
...............................
ENDCLASS

METHOD HandleEvent( nMsg, nWParam, nLParam ) CLASS TMyDialog

if nMsg == 50000
MsgBeep()
endif
return Super:HandleEvent( nMsg, nWParam, nLParam )

Everything works, but message sending is not happening. What I am wrong ?
Post Reply