How to (Re-)Focus XY window?

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

How to (Re-)Focus XY window?

Post by bdeshi »

Is there anything in scripting to focus an inactive XY window, ie, bring it to front ?
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

admin
Site Admin
Posts: 66302
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: How to (Re-)Focus XY window?

Post by admin »

<hwnd> will return the window handle. Maybe you can do something with it.

bdeshi
Posts: 4256
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612
Contact:

Re: How to (Re-)Focus XY window?

Post by bdeshi »

Not entirely in XYScript though.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

klownboy
Posts: 4459
Joined: 28 Feb 2012 19:27
Location: Windows 11, 25H2 Build 26200.8037 at 100% 2560x1440

Re: How to (Re-)Focus XY window?

Post by klownboy »

It does seem a bit odd to me anyway, that you can't get the original XY window in focus or should I say "activated" after running a new or fresh instance of XY without resorting to other external methods. At least I haven't been able to do it. Obviously if you click on it, it will become active. I've tried many variations of simple scripts like the following and it just doesn't happen (i.e., the original XY window will be on top but not focused or be the active window). If the new or fresh XY window is closed sure then the original is active, but not if it's still around or existing.

Code: Select all

   perm $hwnd=<hwnd>;
   run """<xy>"" /fresh /win=min", , 0, 1;
   run """<xy>"" /flg=2 /hwnd=$hwnd", , 0, 1;

Post Reply