Jump to content
Sign in to follow this  
circcc

re-activate last active window...

Recommended Posts

circcc

Shortly,

1) window A is active.

2) run script(or, compiled exe) shorcut from start menu.

now, window A is not active.

3) how can I re-activate window A, other than ALT-TAB ? any function?

Share this post


Link to post
Share on other sites
Davo

Hi,

WinActivate("titleOfWindowA")

Dave


---------------------------------------------------------------------------------------------------------------------------------------------------------------------------"I don't need to know everything, I just need to know where to find it when I need it"....EinsteinAnd in our case... That's the AutoIT helpfile ;) Please read before posting!!!

Share this post


Link to post
Share on other sites
circcc

Hi,

WinActivate("titleOfWindowA")

Dave

Window A means random window, so we don't know the title of window A.

Share this post


Link to post
Share on other sites
November

Window A means random window, so we don't know the title of window A.

Hi

Simulate ALT + TAB

Maybe it helps

Cheers!


Old Scriptology

Visual Ping 1.8 - Mass Ping Program with export to txt delimited.

Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code.

Desktop 2 RGB - Pick a color in the desktop and get the RGB code.

ShootIT 1.0 - Screen Capture full and partial screen

[font="'Arial Black';"]Remember Remember The Fifth of November.[/font]

Share this post


Link to post
Share on other sites
PaulIA

You will need to put the active windows into an array then use Random.

And exactly how do you use Random to activate the previous active window? :)

I'm guessing that nobody has heard of anything called the "Z-Order" in windows? Take a look at GetNextWindow on MSDN.


Auto3Lib: A library of over 1200 functions for AutoIt

Share this post


Link to post
Share on other sites
Davo

Opt("WinTitleMatchMode",4)
$windowTitle = WinGetTitle("[ACTIVE]")
WinActivate($WinTitle)

Dave


---------------------------------------------------------------------------------------------------------------------------------------------------------------------------"I don't need to know everything, I just need to know where to find it when I need it"....EinsteinAnd in our case... That's the AutoIT helpfile ;) Please read before posting!!!

Share this post


Link to post
Share on other sites
PaulIA

PaulIA, use an array, then if a certain Au3 window is activated the array will get the last window before the AU3 window.

Please educate me. Show me some code that uses Random to activate the last active window.

Auto3Lib: A library of over 1200 functions for AutoIt

Share this post


Link to post
Share on other sites
James

WTF am I on about Random for? Must be thinking of something else. Ahh I got confused. He said

Window A means random window, so we don't know the title of window A

Sorry PaulIA.

Edited by Secure_ICT

Share this post


Link to post
Share on other sites
PaulIA

WTF am I on about Random for? Must be thinking of something else. Ahh I got confused. He said

Sorry PaulIA.

No problem. I thought maybe you had discovered some new method for manipulating the Z-Order in Windows. Now that would be useful! :)

Auto3Lib: A library of over 1200 functions for AutoIt

Share this post


Link to post
Share on other sites
November

LOL

ALT + TAB still sounds better :)

Cheers


Old Scriptology

Visual Ping 1.8 - Mass Ping Program with export to txt delimited.

Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code.

Desktop 2 RGB - Pick a color in the desktop and get the RGB code.

ShootIT 1.0 - Screen Capture full and partial screen

[font="'Arial Black';"]Remember Remember The Fifth of November.[/font]

Share this post


Link to post
Share on other sites
Gif

LOL

ALT + TAB still sounds better :)

Cheers

but still the window that acrivetes when ALT + TAB are pressed will be visible and that's not "elegant"!!

Share this post


Link to post
Share on other sites
November

but still the window that acrivetes when ALT + TAB are pressed will be visible and that's not "elegant"!!

Hummm

And if :

After ALT + TAB, get window name and minimize or whatever?

Sounds good?


Old Scriptology

Visual Ping 1.8 - Mass Ping Program with export to txt delimited.

Desktop 2 RGB and YMCK - Pick a color in the desktop and get the RGB and YMCK code.

Desktop 2 RGB - Pick a color in the desktop and get the RGB code.

ShootIT 1.0 - Screen Capture full and partial screen

[font="'Arial Black';"]Remember Remember The Fifth of November.[/font]

Share this post


Link to post
Share on other sites
Gif

Hummm

And if :

After ALT + TAB, get window name and minimize or whatever?

Sounds good?

this is not what i meant , if you press now and hold for a slit second the ALT+TAB you will see that a window appears with all the programms open listed , and it cannot be hide as it has no name ... , whatever if tis the best solution then it would sound perfect

Share this post


Link to post
Share on other sites
circcc

Thanks Helge.

Finally, I got this working code.

$a = WinList()

For $i = 1 to $a[0][0]
        If $a[$i][0] <> "" AND BitAnd(WinGetState($a[$i][1]),2) Then ExitLoop
Next

WinActivate($a[$i][1])
Edited by circcc

Share this post


Link to post
Share on other sites
herewasplato

Shortly,

1) window A is active.

2) run script(or, compiled exe) shorcut from start menu.

now, window A is not active.

3) how can I re-activate window A, other than ALT-TAB ? any function?

While it looks like you have solved you problem - another option would be to start your script in a way that does not cause Window A to ever lose focus... You could start your script via an OS shortcut.

[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites
remin

While it looks like you have solved you problem - another option would be to start your script in a way that does not cause Window A to ever lose focus... You could start your script via an OS shortcut.

 

I could not make the above script of Circcc working.

I created a GUI with a few buttons to make the current active window move to a part of the screen (left, right, center, upperleft, upperright, leftdown, rightdown)

When I click on a GUI button I lose the focus of my active window.

How can I keep the focus on that window while clicking on a GUI button?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×