LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Notepad-Window always topmost. How to revoke?

I have two VIs to test the windows-behaviour.
The first VI starts notepad.exe, gets the refnum of the window, sets it to topmost and activate it. The I revoke the topmost position.

The second vi should do the same: Get Refnum, set to topmost-position and activate it. Then Revoke it.

But what happens is, that the second VI  cant revoke the topmost-position. The windos stays always on the top.
I have to open manually the "Revoke Window always on Top.vi" (and insert the windows-name) to reset this topmost-information for the notepad-window

Whats going wrong there?
Thank you very much for your help.

Windows is 2000/XP
Labview 7.1.1
using winutil.llb & winevent.llb



Message Edited by NewOne on 08-25-2005 04:42 AM

0 Kudos
Message 1 of 8
(4,066 Views)

Hi,

I tested your vis and I had the same problem: there was no way to revoke the window on top.

I found out that the there is an error in the Revoke Window Always on Top.vi: it sets the window On top instead of Not on top, see picture attached.

But I also discovered that this bugged vi was loaded by LV from a .LLB belonging to the Advance Signal Processing toolkit installed on my pc, the original vi from Winutil.llb is correct...Smiley Happy

Hope this solved your problem,

Alberto

0 Kudos
Message 2 of 8
(4,035 Views)
Hi Alberto,
thx for your help.
i looked in my SubVis and they seem to be correct (attached picture).

It only doesnt work when i run the "Revoke....vi" togehter with other SubVis.
When i run it stand-alone then it revokes the notepad-window.

are there any other ways to do this?
0 Kudos
Message 3 of 8
(4,028 Views)
My workaround is to use the "Make window on top..vi" and "Revoke window...vi" in two different vis. This works fine for me.

My current problem now is that this (now three Vis) is not working in NI TestStand like it does when running in Labview.

M VIs/Actions are now:
1.) Start Notepad
2.) "Set Window on Top" & Activate it
3.) "Revoke Window"

This works in Labview great, but running this in TestStand as 3 Actions doesnt Activate the Window. The notepad-Window comes from behind to "TopMost" but it isnt activated.

Any idea what to do? Is TestStand a Super-TopMost-Window??

Thx for your help
0 Kudos
Message 4 of 8
(4,014 Views)

Hi again,

I found another issue: do not activate the window when you make it topmost in your Notepad_Again.vi.

It should solve the problem.

Alberto

0 Kudos
Message 5 of 8
(4,015 Views)

Sorry, I gave you my second reply before seeing your last one.

I can't give you any help with Teststand...

0 Kudos
Message 6 of 8
(4,013 Views)
Hi Alberto,
thx for your help.

I think i solved my problem. Instead of using the C-function "SetWindowPos" (which is called in the MakeWindowOnTop & RevokeWindow), I´m using now (in an other VI)  the C-function "SetForegroundWindow". Both are in user32.dll

SetForegroundWindow works very easy. Just put the refnum as Input-Parameter an then the Window comes to top. Works also great in TestStand.
0 Kudos
Message 7 of 8
(4,001 Views)
Glad you solved it! And thanks for sharing!Smiley Wink
0 Kudos
Message 8 of 8
(3,992 Views)