rsiebler | 3 Mar 2006 21:27

Determining which window is active

I have a script I only want to run if a a key combination is pressed 
while a particular window is active.  If the window is not active, I 
want the key press to be treated normally.  How do I determine if a 
window is active?  I know how to wait for a window to become active, 
but I don't want to wait, per se.

PowerPro can be found here: http://www.ppro.org/
and here: http://ppro.pcrei.com/ 
davidt.pproyg | 3 Mar 2006 21:36
Favicon

RE: Determining which window is active

> I have a script I only want to run if a a key combination is pressed 
> while a particular window is active.  If the window is not active, I 
> want the key press to be treated normally.  How do I determine if a 
> window is active?  I know how to wait for a window to become active, 
> but I don't want to wait, per se.

Under the hotkey item, put something to identify the window in the field
called "Blank for all windows, enter caption *xxx* of target window, or
mouse position". You can use:
Caption name*
=exename
~ is used to say not

David Troesch  |  Atlanta, GA  |  ICQ# 2333123
Hollywood lost in court, but is still trying in the senate.
http://www.eff.org/broadcastflag/
Funstuff: Clones are people two.

PowerPro can be found here: http://www.ppro.org/
and here: http://ppro.pcrei.com/ 
rsiebler | 3 Mar 2006 21:40

Re: Determining which window is active

Thanks! I actually -just- found that after about 5 minutes of searching 
the help.

PowerPro can be found here: http://www.ppro.org/
and here: http://ppro.pcrei.com/ 
Richard D. Farley | 4 Mar 2006 00:01

Re: Determining which window is active

I'm very much a beginner myself, but I might be able to answer this.

You need to know the class or the caption of the window in question.

I for example use C++Builder6, and I put the following in the 'enter more 
commands' box of one of my key macros:

if (activewindow "=bcb")
keys /* the keys I want */
endif

It works for me. If referencing the caption doesn't work, you'll need to try 
using the window's classname. There's another recent email from Ted Wall on 
this list that includes info on how to do that.

   / R

----- Original Message ----- 
From: "rsiebler" <robinsiebler@...>
To: <powerpro-beginners@...>
Sent: Friday, March 03, 2006 2:27 PM
Subject: [ppro-b] Determining which window is active

>I have a script I only want to run if a a key combination is pressed
> while a particular window is active.  If the window is not active, I
> want the key press to be treated normally.  How do I determine if a
> window is active?  I know how to wait for a window to become active,
> but I don't want to wait, per se.
>
>
(Continue reading)

Richard D. Farley | 4 Mar 2006 23:25

how to save file and close an app when its window loses focus?

I'd like powerpro to save whatever changes may have been made to a text file (i.e., if the text file loaded is one of a short list of different filenames) that is in notepad (to pre-existing filenames) and exit notepad automatically any time notepad loses focus based on its caption, i.e., if notepad is no longer the active window. I figure all I have to do is know the window is active with one of the files in question loaded and wait for it to become inactive and then send the keys Ctrl+S and Alt+F and X to the window. Simple, no?
 
I think I ought to know how to do this. But unfortunately I'm still very much a beginner, and I seem to be drawing a mental blank. Does anyone on the list have some suggestions as to how to get this implemented?
 
Thanks.
 
   / R
 
 
(\__/)
(='.'=) This is Bunny. Copy and paste bunny into your
(")_(") signature to help him gain world domination.


PowerPro can be found here: http://www.ppro.org/
and here: http://ppro.pcrei.com/



SPONSORED LINKS
Affiliate program software Construction software program Medical software program
Accounting software program Estate program real software Software development program

YAHOO! GROUPS LINKS



--
SpyderNethas scanned this message for viruses and
dangerous content.
chunwaihome | 6 Mar 2006 01:59
Picon
Favicon

How i make clip txt to a file in different txt file?

Hello,

Command
Clip

Clip Action
to file

Enter path to clip
"C:\Program Files\PowerPro\clip\SkinTemplate1.txt"

My hope is that the path can be the folder so that it can produce txt
itself  e.g. 1.txt ,2.txt.......

PowerPro can be found here: http://www.ppro.org/
and here: http://ppro.pcrei.com/ 
Ted Wall | 6 Mar 2006 14:36
Picon
Favicon

Re: how to save file and close an app when its window loses focus?

> ... Simple, no? ...

Difficult for a beginner. I'm just outlining one method here...

You'll set up an autorun Commandlist with a label "*".

This autorun will run a script comparing caption names that you want to 
automatically save. If this name is in the list, then you'll start an 
EVENT with "NOT ACTIVEWINDOW("++ handle++ ")"

This EVENT will test to be sure the window still exists, if so then 
hide the window and:
WIN.keys ("{toany "++ handle++ "}^s{w2}%f")
to save and then close then window.

Very difficult for a beginner.

Good luck,  Ted

--- In powerpro-beginners@..., "Richard D. Farley" wrote:
>
> I'd like powerpro to save whatever changes may have been made to a 
text file (i.e., if the text file loaded is one of a short list of 
different filenames) that is in notepad (to pre-existing filenames) and 
exit notepad automatically any time notepad loses focus based on its 
caption, i.e., if notepad is no longer the active window. I figure all 
I have to do is know the window is active with one of the files in 
question loaded and wait for it to become inactive and then send the 
keys Ctrl+S and Alt+F and X to the window. Simple, no?
> ...

PowerPro can be found here: http://www.ppro.org/
and here: http://ppro.pcrei.com/ 
Ted Wall | 6 Mar 2006 15:18
Picon
Favicon

Re: How i make clip txt to a file in different txt file?

I probably need more info here to know exactly what you are doing and 
wanting.

See pathToPowerPro\PowerPro\plugins\clip.txt for more info. Looks 
like you are already looking at PowerPro.hlp. See "Clipboard history 
tracking".

These will all work:

CLIP ToFile C:\Program Files\PowerPro\clip\Test1.txt
CLIP.ToFile (?"C:\Program Files\PowerPro\clip\MySaved\Test2.txt")
CLIP.ToFile (?"C:\Program Files\PowerPro\clip\Test3.txt", 1)

CLIP.FromFile (?"C:\Program Files\PowerPro\clip\Test3.txt")
CLIP.SetPaste(FILE.ReadAll( ?"C:\Program Files\PowerPro"++ ;;+
?"\clip\Test3.txt"))

CLIP Menu
CLIP Menu MySaved

MySaved is an existing subfolder of PowerPro's \clip folder.

Set up a different hotkey for 1.txt, 2.txt, ... n.txt or use a 
script. If you use a script, then you can tweak the filenames to make 
them more descriptive.

Good luck,

Ted

--- In powerpro-beginners@..., "chunwaihome" wrote:
> 
> Command
> Clip
> 
> Clip Action
> to file
> 
> Enter path to clip
> "C:\Program Files\PowerPro\clip\SkinTemplate1.txt"
> 
> My hope is that the path can be the folder so that it can produce 
txt
> itself  e.g. 1.txt ,2.txt.......
>

PowerPro can be found here: http://www.ppro.org/
and here: http://ppro.pcrei.com/ 
Richard D. Farley | 6 Mar 2006 21:00

Re: Re: how to save file and close an app when its window loses focus?

Well ... I'm discouraged now. I think I'll procrastinate for a while.

   / R

----- Original Message ----- 
From: "Ted Wall" <TedWall@...>
To: <powerpro-beginners@...>
Sent: Monday, March 06, 2006 7:36 AM
Subject: [ppro-b] Re: how to save file and close an app when its window 
loses focus?

>> ... Simple, no? ...
>
> Difficult for a beginner. I'm just outlining one method here...
>
>
> You'll set up an autorun Commandlist with a label "*".
>
>
> This autorun will run a script comparing caption names that you want to
> automatically save. If this name is in the list, then you'll start an
> EVENT with "NOT ACTIVEWINDOW("++ handle++ ")"
>
>
> This EVENT will test to be sure the window still exists, if so then
> hide the window and:
> WIN.keys ("{toany "++ handle++ "}^s{w2}%f")
> to save and then close then window.
>
>
> Very difficult for a beginner.
>
> Good luck,  Ted
>
>
>
> --- In powerpro-beginners@..., "Richard D. Farley" wrote:
>>
>> I'd like powerpro to save whatever changes may have been made to a
> text file (i.e., if the text file loaded is one of a short list of
> different filenames) that is in notepad (to pre-existing filenames) and
> exit notepad automatically any time notepad loses focus based on its
> caption, i.e., if notepad is no longer the active window. I figure all
> I have to do is know the window is active with one of the files in
> question loaded and wait for it to become inactive and then send the
> keys Ctrl+S and Alt+F and X to the window. Simple, no?
>> ...
>
>
>
>
>
>
> PowerPro can be found here: http://www.ppro.org/
> and here: http://ppro.pcrei.com/
> Yahoo! Groups Links
>
>
>
>
>
>
>
>
> -- 
> Spydernet has scanned this message for viruses and
> dangerous content.
>
>
> !DSPAM:440c3e47246111342414689!
>
> 

--

-- 
Spydernet has scanned this message for viruses and
dangerous content.

PowerPro can be found here: http://www.ppro.org/
and here: http://ppro.pcrei.com/ 
chunwaihome | 7 Mar 2006 00:54
Picon
Favicon

Re: How i make clip txt to a file in different txt file?

THX REPLY
I achieve my way before i forget how to do.
When i copy "abc.......",press hotkey, then it will make a abc.txt 
in clip folder.
Or when i copy "hkbb....",press hotkey,it will make hkbb.txt in clip 
folder.

--- In powerpro-beginners@..., "Ted Wall" <TedWall <at> ...> 
wrote:
>
> I probably need more info here to know exactly what you are doing 
and 
> wanting.
> 
> See pathToPowerPro\PowerPro\plugins\clip.txt for more info. Looks 
> like you are already looking at PowerPro.hlp. See "Clipboard 
history 
> tracking".
> 
> These will all work:
> 
> CLIP ToFile C:\Program Files\PowerPro\clip\Test1.txt
> CLIP.ToFile (?"C:\Program Files\PowerPro\clip\MySaved\Test2.txt")
> CLIP.ToFile (?"C:\Program Files\PowerPro\clip\Test3.txt", 1)
> 
> CLIP.FromFile (?"C:\Program Files\PowerPro\clip\Test3.txt")
> CLIP.SetPaste(FILE.ReadAll( ?"C:\Program Files\PowerPro"++ ;;+
> ?"\clip\Test3.txt"))
> 
> CLIP Menu
> CLIP Menu MySaved
> 
> MySaved is an existing subfolder of PowerPro's \clip folder.
> 
> 
> Set up a different hotkey for 1.txt, 2.txt, ... n.txt or use a 
> script. If you use a script, then you can tweak the filenames to 
make 
> them more descriptive.
> 
> 
> Good luck,
> 
> Ted
> 
> 
> --- In powerpro-beginners@..., "chunwaihome" wrote:
> > 
> > Command
> > Clip
> > 
> > Clip Action
> > to file
> > 
> > Enter path to clip
> > "C:\Program Files\PowerPro\clip\SkinTemplate1.txt"
> > 
> > My hope is that the path can be the folder so that it can 
produce 
> txt
> > itself  e.g. 1.txt ,2.txt.......
> >
>

PowerPro can be found here: http://www.ppro.org/
and here: http://ppro.pcrei.com/ 

Gmane