
Quote from Talker on June 9, 2024, 1:10 amI am working on an application that makes it easier to copy text from any text application to any other application that can receive text. I am using global keyboard hooks that perform global Neo SendKeys operations.
It works fairly well in text applications. However, if the user mistakingly presses any of the global Hotkeys in Windows Explorer (and several other applications) then it will cause serious havoc...
Starting with Windows Explorer. Is there any way Neo can detect whether it concerns an Explorer window before sending keys, and then Return(don't do anything)? If so, how do I implement that?
For instance, in the Subroutine I'm using:
:Bring Over SendKeys "" "{CtrlDn}a{CtrlUp}{CtrlDn}x{CtrlUp}" SendKeys "" "{AltDn}{Esc}{AltUp}" Delay "250" SendKeys "" "{CtrlDn}v{CtrlUp} " SendKeys "" "{Right}" Delay "150" SendKeys "" "{AltDn}{Tab}{AltUp}" Return
I am working on an application that makes it easier to copy text from any text application to any other application that can receive text. I am using global keyboard hooks that perform global Neo SendKeys operations.
It works fairly well in text applications. However, if the user mistakingly presses any of the global Hotkeys in Windows Explorer (and several other applications) then it will cause serious havoc...
Starting with Windows Explorer. Is there any way Neo can detect whether it concerns an Explorer window before sending keys, and then Return(don't do anything)? If so, how do I implement that?
For instance, in the Subroutine I'm using:
:Bring Over
SendKeys "" "{CtrlDn}a{CtrlUp}{CtrlDn}x{CtrlUp}"
SendKeys "" "{AltDn}{Esc}{AltUp}"
Delay "250"
SendKeys "" "{CtrlDn}v{CtrlUp} "
SendKeys "" "{Right}"
Delay "150"
SendKeys "" "{AltDn}{Tab}{AltUp}"
Return
Quote from mishem on June 9, 2024, 12:18 pmObserve the [NameClass] variable as you navigate through windows. And then you can use if.
zmFunctions plugin.
Observe the [NameClass] variable as you navigate through windows. And then you can use if.
zmFunctions plugin.

Quote from Talker on June 10, 2024, 4:47 pmThanks Mishem,
Yes, I have the zmFunctions plug-in and I understand the timer approach. I found the ClassName of Windows Explorer to be any of the following (but the first is probably the correct one):
CabinetWClass
ExplorerWClass
ExploreWClassIn my app there is no need to determine a specific Explorer window name (like Documents, My Music, My pictures etc.), instead I want my SendKeys script to not work as soon as any Windows Explorer window is encountered. So basically I would just need to "blacklist" CabinetWClass in my app?
Would it be possible to give me a working example of this in my above SendKeys script?
Thanks Mishem,
Yes, I have the zmFunctions plug-in and I understand the timer approach. I found the ClassName of Windows Explorer to be any of the following (but the first is probably the correct one):
CabinetWClass
ExplorerWClass
ExploreWClass
In my app there is no need to determine a specific Explorer window name (like Documents, My Music, My pictures etc.), instead I want my SendKeys script to not work as soon as any Windows Explorer window is encountered. So basically I would just need to "blacklist" CabinetWClass in my app?
Would it be possible to give me a working example of this in my above SendKeys script?
Quote from mishem on June 10, 2024, 7:22 pmIt can be done in different ways.
You can then add other window classes to the blacklist if problems arise with them too.
It can be done in different ways.
You can then add other window classes to the blacklist if problems arise with them too.
Uploaded files:
Quote from Talker on June 11, 2024, 3:07 amThanks Mishem,
But for some reason, this is not working. I made it part of the Subroutine (because the Timer caused a bit of a ruckus)... Like so:
:Bring Over zmGetForegroundWindow "[HNWD]" zmGetWindowTitle "[HNWD]" "[NameClass]" "[Title]" SearchStr "[NameClass]" "[blacklist]" "[Result]" "" If "[Result]" "=" "0" SendKeys "" "{CtrlDn}a{CtrlUp}{CtrlDn}c{CtrlUp}" SendKeys "" "{AltDn}{F4}{AltUp}" SendKeys "" "{Right}" SendKeys "" "{Enter}" Delay "500" SendKeys "" "{CtrlDn}v{CtrlUp} " ReturnBut it seems to completely ignore the blacklist, even though it's in the PubDir. It just performs the SendKeys every time...
Thanks Mishem,
But for some reason, this is not working. I made it part of the Subroutine (because the Timer caused a bit of a ruckus)... Like so:
:Bring Over
zmGetForegroundWindow "[HNWD]"
zmGetWindowTitle "[HNWD]" "[NameClass]" "[Title]"
SearchStr "[NameClass]" "[blacklist]" "[Result]" ""
If "[Result]" "=" "0"
SendKeys "" "{CtrlDn}a{CtrlUp}{CtrlDn}c{CtrlUp}"
SendKeys "" "{AltDn}{F4}{AltUp}"
SendKeys "" "{Right}"
SendKeys "" "{Enter}"
Delay "500"
SendKeys "" "{CtrlDn}v{CtrlUp} "
Return
But it seems to completely ignore the blacklist, even though it's in the PubDir. It just performs the SendKeys every time...
Quote from mishem on June 11, 2024, 12:47 pm
@talkerHow is the subroutine launched? Through a button? When you click a button, the top window at that moment becomes the one in which the button is located.
How is the subroutine launched? Through a button? When you click a button, the top window at that moment becomes the one in which the button is located.

Quote from Talker on June 12, 2024, 1:26 amI uploaded the project for you to test. It's a tray application.
Once it's running Open up WordPad and then Notepad. Type something in Notepad and then press:
Shift+` (this is a global hotkey via NeoBookKB plug-in).
You will see that the Notepad contents will be pasted into Wordpad (and closing Notepad). At least, that's what it should do.
Even though, both applications are in the blacklist...
I also tried using the [Title] variable to see if that would make a difference, but it does not appear to work either...
I added some additional classes to the blacklist to try.
I uploaded the project for you to test. It's a tray application.
Once it's running Open up WordPad and then Notepad. Type something in Notepad and then press:
Shift+` (this is a global hotkey via NeoBookKB plug-in).
You will see that the Notepad contents will be pasted into Wordpad (and closing Notepad). At least, that's what it should do.
Even though, both applications are in the blacklist...
I also tried using the [Title] variable to see if that would make a difference, but it does not appear to work either...
I added some additional classes to the blacklist to try.
Uploaded files:Quote from mishem on June 12, 2024, 10:17 am1. Your result will always be 0, since the [blacklist] variable is empty. Do you need to first load a list from a file into a variable?
FileRead "[PubDir]blacklist.txt" "All" "[blacklist]" kbAddHotKey "Shift+`" "Bring Over"2. VisualNeoWin does not work with UTF-16 encoding. Therefore, the blacklist must be in ANSI encoding.
1. Your result will always be 0, since the [blacklist] variable is empty. Do you need to first load a list from a file into a variable?
FileRead "[PubDir]blacklist.txt" "All" "[blacklist]" kbAddHotKey "Shift+`" "Bring Over"
2. VisualNeoWin does not work with UTF-16 encoding. Therefore, the blacklist must be in ANSI encoding.
Uploaded files:
Quote from Talker on June 13, 2024, 4:01 pmThanks so much Mishem! Indeed now it works :-).
One final request. For users to be able to modify the blacklist text file themselves, it would be handy if it was automatically placed in a subfolder of their Documents folder:
"C:\Users\username\Documents\Bring Over App\blacklist.txt"
Is it possible to make the application check on boot up if that file exists? If not, could it write the text file to that location (including the current blacklist entries)?
From that point on users would be able to add new entries on their own.
Thanks so much Mishem! Indeed now it works :-).
One final request. For users to be able to modify the blacklist text file themselves, it would be handy if it was automatically placed in a subfolder of their Documents folder:
"C:\Users\username\Documents\Bring Over App\blacklist.txt"
Is it possible to make the application check on boot up if that file exists? If not, could it write the text file to that location (including the current blacklist entries)?
From that point on users would be able to add new entries on their own.
Quote from mishem on June 13, 2024, 5:40 pmLike that. You need to solve such simple problems yourself.
I provided an example with the ability to add to the blacklist directly from the system tray.
Like that. You need to solve such simple problems yourself.
I provided an example with the ability to add to the blacklist directly from the system tray.

Quote from Talker on June 13, 2024, 11:50 pmGreat idea to be able to edit the blacklist directly from the system tray :-).
It all works.Thanks again. A great lesson!
Great idea to be able to edit the blacklist directly from the system tray :-).
It all works.
Thanks again. A great lesson!