Paste where ever has focus - Page 2 - Forum

Forum Navigation
You need to log in to create posts and topics.

Paste where ever has focus

PreviousPage 2 of 3Next

Thanks,

Is there a function in Neo that will activate the previous window?

Right now I have this sort of working (want to avoid the AutoIT GPL license):

zmGetForegroundWindow "[MyWinHandle]"
hpwSetTransparent "[MyWinHandle]" "50"

However, that applies transparency to the Neo app itself, since that's the top window when being launched :-(.

I want to apply transparency to the window that was active before the Neo app was launched.

Is this possible?

To do this, you need to know either the name of this window, or a descriptor.

@talker

I want to apply transparency to the window that was active before the Neo app was launched.

Is this possible?

This is possible if your other application monitors the top windows in the system and, for example, writes their handles (or names) to a file that your main application can read after starting. Then the last entry in the file would be the desired descriptor.

Or your program needs a plugin that can read the existing windows queue in Windows (if I understand correctly, this is called "z-order of open windows").

You can also try to send ALT+TAB to the desktop after your program window is loaded to activate the previous window in the system and apply transparency to it, then immediately make the top window of your application in the system. I haven't tried it, I don't know how it would work. You can check it out.

There are probably other ways.

I tried Alt+Tab (and Alt+Esc) with separate executables which usually works in these cases but here it doesn't :-(.

I think it might work if Neo could send Alt+Tab globally (so not addressed to any specific window handle/title).

The other two solutions seem a little bit complex...

Nevermind, thanks for the help.

 

@talker

Here is an example where pressing the button makes the previous window in the system semi-transparent (the Alt+Tab key combination is passed to Windows Explorer with the standard SendKeys command).

The plugins used are hpwSendKeys, zmFunctions.

Subroutine text:

:SendKeys
.to switch to the previous window with the keys
SendKeys "C:\Windows\System32\explorer.exe" "{AltDn}{Tab}{Tab}{AltUp}"
.get the top window descriptor in the system
zmGetForegroundWindow "[HWND]"
.set the window transparency (0 - fully transparent, 100 - not transparent)
hpwSetTransparent "[HWND]" "[TrackBar1]"
Return

Run a test compilation of the project. Then select the degree of transparency with the slider, where 100 is opaque and 0 is fully transparent. Then click on the button. Then select another value of the slider and press the button again. You can do this as many times as you like :)

Uploaded files:
  • You need to login to have access to uploads.

Hi Vadim,

Thanks for giving this a try. I really appreciate it!

However, it is not working on my system. I tried several Explorer windows and other applications as well, but none of the windows are responding...

It could be related to some focus (Z order) issues I've been having with Windows 11. I have a dual-boot system including Windows 10. So I will try it on that OS tomorrow as well.

Meanwhile, if others would like to give this a try. Please let us know the results.

@talker

Check also the path to explorer.exe, it is possible that on your system it is in a different folder (I have not checked it).

It's still not working, even though I changed the path (I should've known that since I'm using 64-bit system) to:

C:\Windows\SysWOW64\explorer.exe

Are you using Windows 7 32-bit?

 

There is a global variable that should work the same on any system.

[WindowsDir]explorer.exe

In such cases, put an exclamation mark in front of the path ! Sometimes the system surprises and fails to find the file even though the path is spelled correctly.

SendKeys "!C: \ Windows \ System32 \ explorer.exe" "{AltDn} {Tab} {Tab} {AltUp}".

Vadim has reacted to this post.
Vadim

Thanks Mishem, I tried this as well but I'm still getting zero effect when moving the slider...

Is this project working properly on your system?

I don't see anything in TrackBar Properties - TrackBar1

Shouldn't there be something in the Value Changed or Value Changing events?

@talker

Hi! The code is in the Subprograms tab (you can open it by pressing F12, in the project editing mode, not in the compilation mode). This subprogram is called with the button. And the slider allows you to change the value of the variable that is used in the subroutine to specify the degree of transparency.

Yes, I have 32bit at the moment.

 

Is this project working properly on your system?

No, it's not working for me either.

That's how it works for me. But be careful. If the program crashes or hangs, you will be left with transparent windows.
The hpwControl plugin is also required.

Uploaded files:
  • You need to login to have access to uploads.

Very nice! This appears to work.

For testing purposes I advise to run the compiled executable instead of debugging the script from within Visual Neo (which apparently was a little bit too much for my graphics card to handle because I got a whole string of pointers on the screen when I moved the mouse).

Interesting sample project for sure. I'm going to study this some more.

Let's see if this can be merged with Vadim's sample project.

 (which apparently was a little bit too much for my graphics card to handle because I got a whole string of pointers on the screen when I moved the mouse)

When the timer is running, minimize the debugger, or switch to the Variables tab.

 

 

However, that applies transparency to the Neo app itself, since that's the top window when being launched :-(.

I want to apply transparency to the window that was active before the Neo app was launched.

I wonder if you minimize your app, apply transparency to whatever the top window is, and then restore your app... would that work?

 

Hi @fkapnist,

WinTricks has this function.  Not just last window, but ANY window

Vadim and Talker have reacted to this post.
VadimTalker

Hi rcohen,

I tried the zmwWinTricks demo (nice video by the way), but sadly it does not seem to work on the last active window. You really need to designate a window handle or title....The "Leave empty for last active window handle" function in the sample project does not seem to work.

Can you post a simpler sample project for WinTricks (need not have any buttons at all) that does nothing but apply transparency (let's say value 120) to whichever window was active prior to launching the app? Preferably also without the need to place the mouse pointer in that window (after all, you can have an active window without the mouse pointer in it).

If it works, I will be more than happy to buy the plug-in.

zmWorks7 has reacted to this post.
zmWorks7
PreviousPage 2 of 3Next