LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Need User32.dll Messagebox To Be The Active Window

I just got to work

 

I have tried to figure out the FindWindow function before but to no avail.  I'll give it another try and will be back shortly if I get stuck.

 

20040 is in Hex. 

0 Kudos
Message 11 of 34
(2,232 Views)

I forgot to add that I have long since tried using the LV dialog and have had other application windows in the foreground besides our test software and the dialog is still not becoming the active window.

0 Kudos
Message 12 of 34
(2,229 Views)

You may find it easier to use the Windows API Function Utilities (32-bit) for LabVIEW

0 Kudos
Message 13 of 34
(2,222 Views)

@smercurio_fc wrote:

You may find it easier to use the Windows API Function Utilities (32-bit) for LabVIEW


 

I have already looked at those and all I see is a ton of vi examples of which I do not know which one to utilize.  Would you be a bit more specific?

0 Kudos
Message 14 of 34
(2,218 Views)

In that library you will find the "Get Window RefNum" VI (in WinUtil.llb). That VI calls FindWindow, returning the window handle. You indicated you were having problems getting FindWIndow to work, so you can just copy that code.

0 Kudos
Message 15 of 34
(2,210 Views)

I went to that link and it does not explain how to use the FindWindow function via LabVIEW. Help!

 

 


Matthew Kelton wrote:

 

As I mentioned in my first reply, FindWindow (http://msdn.microsoft.com/en-us/library/ms633499%28v=vs.85%29.aspx) will give you a window handle.  All you need to know is the title of the open window.

 

You can use this to make the dialog modal to your in-house software.  It is possible that this software is causing you some problems as well.  Does it behave like a normal window, or does it have a special setup, such as Always on Top, etc.?

 

If you run your VI without the other software, does the dialog work?  An example would be something that demonstrates the same problem, so someone can reproduce on their machine and can try get a solution for you without throwing ideas into the air to see if they work.

 

I am not saying to use the LV dialog permanently, just as a test to see if it behaves as you desire, as it may give some insight into what is going on.

 

Did you confirm that your 20040 constant has a radix set to hex and therefore is 0x20040 and not decimal 20,040?


 

0 Kudos
Message 16 of 34
(2,207 Views)

@smercurio_fc wrote:

In that library you will find the "Get Window RefNum" VI (in WinUtil.llb). That VI calls FindWindow, returning the window handle. You indicated you were having problems getting FindWIndow to work, so you can just copy that code.


 

I did run "Get Window RefNum" Vi but it did not return anything. 

 

I ran it from another VI window.  Was I supposed to copy it to the same window as my dialgo box code?

0 Kudos
Message 17 of 34
(2,206 Views)

Did you create the node that calls MessageBox?  It is the exact same procedure to call FindWindow.  I'm not in the office today, or I woud send my VI to do it, but this is one of the simplest DLL calls to setup.

0 Kudos
Message 18 of 34
(2,201 Views)

I've attached the vi subroutine.

 


@Matthew Kelton wrote:

Did you create the node that calls MessageBox?  It is the exact same procedure to call FindWindow.  I'm not in the office today, or I woud send my VI to do it, but this is one of the simplest DLL calls to setup.


 

0 Kudos
Message 19 of 34
(2,199 Views)

Find Window.vi is very easy to use.  I think the previous one(s) I found did not work. 

 

The one I got to work, only works in LV 9.  I have to use LV 6 for my development though.

0 Kudos
Message 20 of 34
(2,189 Views)