LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
mniedernhuber

Support MessageBoxA from user32.dll by Default

Status: New

The Message Box from LabVIEW doesn't look very nice. On Windows Systems user32.dll provide a better Message Box.

See also MSDN entry at: http://msdn.microsoft.com/en-us/library/windows/desktop/ms645505%28v=vs.85%29.aspx

 

It is possible to set the Buttons

  • Abort, Retry, Ignore
  • Cancel, Try Again, Continue
  • Help Button (!!!)
  • Ok
  • Ok, Cancel
  • Retry, Cancel
  • Yes, No
  • Yes, No, Cancel

Icons for

  • Error, Stop
  • Question
  • Exclamation or Warning
  • Asterisk, Information

and many more ....

 

LabVIEW should support this MessageBox on Windows Systems as additional MessageBox beside the existing.

 

Example MessageBoxA.png

11 Comments
tst
Knight of NI Knight of NI
Knight of NI

LabVIEW does support it - drop a Call Library Function Node on the BD, configure it to call the function (make sure to use the ANSI version, like you said) and you're done.

 

If you mean that LV should ship with a wrapper for this function, then that's another matter (and I'm not sure I would agree, but that's up to people to vote on).


___________________
Try to take over the world!
A-T-R
Member
LV lacks a lot of "common" features...this seems to belong to long wanted "FP overhaul" subject...
mniedernhuber
Member

@tst I already did that. I wrote a VI exactly like you suggested and the examples on the right are the results of my VI 🙂

If someone is interessted in my VI please send a PM with your email.

fabric
Active Participant

I'd definitely use this, although I imagine it will get held up at the "Windows only" part.

 

That said, I'd be more than happy to have a "Windows Functions" sub-palette that could safely be used by anyone that doesn't need to support mac/linux/whatever... which is likely most people.

 

Hopeful kudos Smiley Happy

A-T-R
Member
I guess many users wired this Windows function into their own SubVI...and so did I. To have those functionality on a native LV palette would make coding much more comfortable
JB
Trusted Enthusiast
Trusted Enthusiast
I guess many users wired this Windows function into their own SubVI...and so did I.

I'm one of those.

paulmw
Active Participant

Call MessageBox from .NET and it is much easier to use.  Drop a .NET Method, Browse to .NET class System.Windows.Forms.MessageBox and invode one of the many "Show" methods.  Wire up the inputs and your are all ready to go!

 

MessageBox.png

Technico
Member

WARNING !!!

 

When using the .NET MessageBox in a vi with multiple loops running in parallel, the other loops STOP running !!

When using the Expressvi "Prompt User" (or some other modal vi) the other loop keeps running without interruption.

 

/ WARNING !!!

(I think the behaviour is the same when using the user32.dll) 

 

I would remove user32.dll from the title because the main goal would be

to have a similar look (and functionality) for the LabVIEW boxes as the OS-dependant boxes.

... with icons

... without blocking other threads/loops.

mniedernhuber
Member
@Technico I have checked it with two parallel loops. With .NET MessageBox and rund32.dll MessageBoxA my parallel loop didn't stop running. Do you have an example?
Technico
Member

@sjunge: I had created a nice vi that nicely illustrated the loop stopped, but I seem to be only able to upload images and no vi's. Smiley Frustrated

 

In the meantime I figured out what happens:
It only seems to happen when the "Preferred Execution System" is set to "User Interface".

When selecting some of the other execution systems this did not happen and the loops continued running.

 

The background of this switch to "User Interface" was the fact that the default LV One and Two Button Dialog nicely appears in the center of the vi Smiley Happy

while the Three Button Dialog, The Prompt User and the dotNET MessageBox all appeared in the center of the screen Smiley Sad

which is NOT desirable when running a small (not full screen) application.

(Another problem with the One and Two Button Dialog Box is that there is no option to set the title of the Box)

 

For the self-made dialogboxes you can use the coordinates of the calling vi and make it appear in the center of the calling application

but this is rather complex and should be easier to do without the additional hassle, so this idea should be expanded to allow setting the position of the dialog.

 

I continued some reading on the dotNET MessageBox and the IWin32Window and there was some comment that it would center to the application

when setting the execution system to User Interface but it didn't behave as expected so I removed the IWin32Window and forgot about the execution system.