Unfortunately, I can't save back to 7.1 since that requires me to have
8.0 and I only have 7.1 and 8.2. All that I had done was use the Code
Interface node to call the "RegisterWindowMessage" and "PostMessage".
The "RegisterWindowMessage" function simply tells Windows that you plan
to use a specific message in your application, and you're asking
Windows for a unique ID so you can identify the message when it gets
sent around.
The "PostMessage" function is used to send a message to a specific
window or to send it to everybody by setting the hWnd parameter to
"HWND_BROADCAST", a constant that's -1. This is used by the example
application to send the "start" and "stop" commands to ushape, for
example.
Based on what I could see, I believe the reception of the messages from
ushape works like this: uShape sends out a broadcast message. That
means everybody gets it. In the example code the dialog box's
"PreTranslateMessage" is used to trap these broadcast messages and
determine if it's a ushape message based on the message ID (those lines
that are "if(pMsg->message == OMMSG_SEND_STATUS)". The
"PreTranslateMessage" function is a dialog box specific function. It is
used to pre-process Windows messages that are received by the dialog
box. You won't find that function in user32.dll since it's not a
generic API function. It's specific to MFC, which is the framework used
to create that example given to you. In MFC a dialog is a class, and
"PreTranslateMessage" is one of the members of the dialog class.
Do other methods exist for LabVIEW? You can probably use the
"WaitMessage" or "GetMessage" functions in user32.dll in an equivalent
matter. This would require you to call these functions in a loop until
the message you get is one of the ones you initially registered. A
little clumsier than using a callback method, but it should work.
Attached is a simple example in 7.1. Note that all the code interface
nodes are set to use the "stdcall" calling convention. I suspect that's
why the example you tried to create didn't work. Whether or not this works for you I have no idea since I don't have the uShape component. You should follow-up with the company that sold you the component to see if you can get more help.