06-23-2011 12:41 PM
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.
06-23-2011 12:53 PM
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.
06-23-2011 01:17 PM
You may find it easier to use the Windows API Function Utilities (32-bit) for LabVIEW
06-23-2011 01:31 PM - edited 06-23-2011 01:31 PM
@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?
06-23-2011 02:04 PM
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.
06-23-2011 02:08 PM
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?
06-23-2011 02:11 PM
@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?
06-23-2011 02:19 PM
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.
06-23-2011 02:28 PM - edited 06-23-2011 02:30 PM
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.
06-23-2011 04:58 PM
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.