From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Windows messaging


smercurio_fc wrote:
I think that poster is probably accessing the forums through a newsreader and not a web browser.

 

Isn't that ancient technology?

If they were able to figure out how to use something that old, you'd think they'd be smart enough to find the real website, or at least know it exists.

0 Kudos
Message 11 of 25
(1,381 Views)

<OT>


Ravens Fan wrote:

smercurio_fc wrote:
I think that poster is probably accessing the forums through a newsreader and not a web browser.

 

Isn't that ancient technology?


Indeed. If you think about it so is HTML, but it's so entrenched I don't know it it will ever go away.

 

</OT>

 

0 Kudos
Message 12 of 25
(1,370 Views)

Jason,

 

You're right.  I had skipped over Muks' reply.  Thanks for calling my attention to it.

The zip file, Windows Message Library_8_5.zip, does not include

Windows Messages for LabVIEW.dll.  I downloaded the zip file that contains the 

DLL and extracted the DLL file.  My antivirus software claims that it is infected with 

the Trojan horse BackBoor.RBot.FM.  I tried to compile the source code, but 

Microsoft Visual C++ 6.0 reports:

 

error C2373: 'Occur' : redefinition; different type modifiers
        c:\program files\national instruments\labview 8.5\cintools\extcode.h(854) : see declaration of 'Occur' 

 

Also, this DLL appears to be able to receive messages, but not post them.

 

Thanks,

Hamilton Woods

 

 

0 Kudos
Message 13 of 25
(1,363 Views)

Okay.  I confess.  I posted to a usenet news group.  Then someone

thankfully directed me to this forum.

 

I'm not very smart.  That's why I'm having to post my question.  My 

excuse is that I'm from Alabama.

 

Hamilton Woods

0 Kudos
Message 14 of 25
(1,361 Views)

Hamilton Woods wrote:
I downloaded the zip file that contains the DLL and extracted the DLL file.  My antivirus software claims that it is infected with the Trojan horse BackBoor.RBot.FM. 

I do not get that with my antivirus software. I suspect you are seeing a false positive. You might want to try an online scanner from another company.

 

The DLL you have is limited to receiving messages. If you want to post messages then you need to modify the DLL or just write a new one. What you are asking to do is handled by the operating system, and you have to write your own interface for that since LabVIEW doesn't handle that. 

0 Kudos
Message 15 of 25
(1,351 Views)

Hamilton Woods wrote:

Jason,

 

error C2373: 'Occur' : redefinition; different type modifiers
        c:\program files\national instruments\labview 8.5\cintools\extcode.h(854) : see declaration of 'Occur' 

 

Also, this DLL appears to be able to receive messages, but not post them.

 


Occur() was not defined in earlier extcode.h files so it is defined in the headers of the example DLL. Just remark that declaration out from the example DLL file and you should not see that error anymore

 

And yes this example won't do what you need. In fact it does the much more complicated thing of the two, hence the need for an external DLL.

 

For what you need you can simply use the Call Library node to call into the RegisterWindowMessageA() API to register your messages and then use SendMessageA() or PostMessageA()to send the message. You do need to find the window handle of your target application somehow to pass to Send/PostMessageA() but that should be obvious from your Delphi example how they suggest to do it. This could be for instance a call to the FindWindowA() API.

 

 

Rolf Kalbermatter
My Blog
0 Kudos
Message 16 of 25
(1,339 Views)

And here's where I have to admit I missed the part about posting messages rather than just receiving.  The Windows API call is also something I hadn't thought of (palm slaps forehead).  Thanks Rolf - I'll have to remember that one in the future...

 

Jason

0 Kudos
Message 17 of 25
(1,333 Views)

Jason P wrote:

The Windows API call is also something I hadn't thought of (palm slaps forehead).  Thanks Rolf - I'll have to remember that one in the future...


Errr.... Those Windows messaging VIs that you looked at do precisely that. How do you think they worked? Rolf is suggesting to call the Windows API functions directly from LabVIEW using the Call Library Function Node, which you can easily do as well. Sometimes, though, the Windows API functions require complex parameters that cannot be easily handled in LabVIEW, which is why you must sometimes resort to using a wrapper DLL. 

0 Kudos
Message 18 of 25
(1,313 Views)

It's the direct call part that I hadn't thought of, which made me realize I had a bit of a blind spot in my thinking.  My background is in physics, not programming - I got into LV long before I understood what was under the hood... and I still have a bad habit of using the crutches I used in the beginning.  Getting stuck with DLLs that aren't strictly necessary is part of that.  Speaking as someone who spends a significant amount time working on installers, I'm happy any time I can strip away extra parts. 

 

Jason

0 Kudos
Message 19 of 25
(1,308 Views)
In that case I would suggest looking at the lvwutil library. It contains a lot of VIs that call the Windows API, so you can see how it's done.
0 Kudos
Message 20 of 25
(1,301 Views)