Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Hide Notepad but keeping it activated for text input
#1
Is it possible to hide Notepad (so that the user can scroll other applications) and still enable it to receive text input?

I tried:

Macro hidden
Code:
Copy      Help
hid "Notepad" ;;hide "Notepad"
act w

This successfully hides Notepad but doesn't keep it activated for text input.....
#2
If possible, it is difficult and/or unreliable. Maybe create a keylogger that pastes captured text into notepad when it is activated. Or try to find software that can do it.
#3
getwintext and setwintext will work while notepad is hidden i've used this before and had good results

basic example

Code:
Copy      Help
int w=win("" "Notepad")
int c=id(15 w) ;;editable text 'Text Editor'
1
hid w;; hide notepad window
str s.getwintext(c);; get existing text
if s.len
,_s.from("[]" "line1[]line2[]line3[]line4");;add new text to existing text
,_s.setwintext(c);; add text to notepad
else
,_s="line1[]line2[]line3[]line4"
,_s.setwintext(c)
1
hid- w;; unhide notepad window


I am not sure what exactly your trying to do. Was just offering this as an alternative to pasting.Works even if window is inactive or hidden. If you give us a better idea of what exactly your trying to do maybe can come up with a solution.
#4
Better not to hide the window incase something goes wrong . if function/macro errors window will remain hidden .Use minimize and restore instead
here is a quick example of getting clipboard text and transferring it to notepad
this function will run in the background and transfer text copied from the clipboard to notepad window.

Function CopyClipboardToNotepadExample
Code:
Copy      Help
int w=win("" "Notepad")
int c=id(15 w) ;;editable text 'Text Editor'
min w;; minimize notepad window
str s ss
spe -2
rep
,0.3
,ifk(`)
,,break;; break loop when the key ` is pressed
,ss.getclip;; get clipboard
,if ss.len;; if clipboard is not empty
,,s.getwintext(c);; get notepad text
,,if s.len;; if notepad text is not empty do the following
,,,,_s.from("[]" ss);;add new text to existing text
,,,,_s.setwintext(c);; put clipboard text into notepad
,,,,ss.fix(0);;  empty string ss
,,,,ss.setclip;; empty clipboard
,,else
,,,ss.setwintext(c);; put clipboard text into notepad
,,,ss.fix(0);;set string ss length to zero so can empty clipboard
,,,ss.setclip;; empty the clipboard
;; run subfunction when the loop is broken
sub.finished

#sub finished
function w
res w;; show notepad window
;act w;; if desired uncomment
;;     function ends now
#5
I do not know if this is what you wanted, but in the below tutorial it is explained how you can get and set text from/to notepad++ while notepad++ is in-active. Mind you this is not windows notepad. The explained method only works in scintilla based editors (like notepad++).

https://www.youtube.com/watch?v=OZwj1dMo5TY&t=93s
(go to the 01:33 mark if the above link doesn't navigate you to it.)
#6
Thanks for the input all! Sorry, I should've been a little bit more specific. I used Notepad as an example but it could be any application that accepts text input. 

What I'm trying to achieve is to create a possibility for speech recognition users to dictate into Notepad while it's window is (preferably) hidden (if not possible, minimized) so that they can see the full program window they are currently working in, without notepad taking up screen space. It shouldn't use a clipboard function.
Speech recognition programs will dictate into any window that is active and has focus.

Is this possible?
#7
i cannot test dragon so cant be of much help. but from looking at dragon online help maybe you could use the dictation box read its text from qm and then put it in other applications . For some apps can use getwintext,setwintext. others can use acc , others can use activex libraries .If you can read the text from the dictation box in qm you could do this but there isn't a one solution for all to put the text into inactive windows.
#8
Yes it appears that direct dictation is only possible when the active window is visible and has the focus when it comes to speech recognition. Anyway, thanks for taking the trouble, always appreciated.


Forum Jump:


Users browsing this thread: 4 Guest(s)