The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum
 Origin Forum
 How to get the active window name?

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
rezahasi1 Posted - 08/10/2005 : 07:06:53 AM
Origin Version : 7.5 SR5
Operating System:WinXP

For worksheet, I tried below
invoke(originObj, 'Execute', '%z=""; doc -e w {%z= %h};');strGraphNames = invoke(originObj, 'LTStr', '%z')

But it always gives the recently created worksheet name.
It appears that it always give the worksheet name created most recently, NOT the active one.

Any advice would be suggested
Thanks
REZA
6   L A T E S T    R E P L I E S    (Newest First)
rezahasi1 Posted - 08/14/2005 : 11:13:20 PM
Great!, Thank you very much
Mike Buess Posted - 08/11/2005 : 08:14:40 AM
Hi REZA,

The concept of the "top most worksheet" window has no meaning. There is only one active window which, as you say, can be wks, graph, matrix or layout. You can find out what type of window it is with the exist() function.

if( exist(%H,2) ) ty "%H is a wks window";
else ty "%H is not a wks window";

Mike Buess
Origin WebRing Member
rezahasi1 Posted - 08/10/2005 : 11:52:11 PM
Hi Mr Buess,
As you suggested, strGraphNames = invoke(originObj, 'LTStr', '%h'), this one works giving the top most selected window title. It almost serves my purpose, since it collects any window (Worksheet, graph, matrix whatever). I actually wanted to get the top most worksheet only.

Thank you very much for the kind help.

REZA
Mike Buess Posted - 08/10/2005 : 10:28:21 AM
quote:
interestingly %H doest not do that AT LEAST in my case.
That's odd, because it obviously worked in your original script - doc -e W {%Z=%H} - which is the usual LT method for finding the name of the most recently created window. I've never used ActiveX, but I would guess that the script could be modified like this...

strGraphNames = invoke(originObj, 'LTStr', '%h')

Mike Buess
Origin WebRing Member
rezahasi1 Posted - 08/10/2005 : 09:15:05 AM
Thanks, but interestingly %H doest not do that AT LEAST in my case.
I had to use origin as actxserver. I can get all window names but not the CURRENT ONE ONLY which are selected by mouse or on top.

Possibly, I can't use GetName property when in actxserver, right?
thanks anyway
Mike Buess Posted - 08/10/2005 : 08:51:43 AM
The LabTalk string variable %H always holds the name of the active window. Use this in OriginC...

string sName = Project.Pages().GetName();

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 08/10/2005 08:57:55 AM

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000