Sign in to follow this  
Followers 0
sandin

Alt+Tab replacement

40 posts in this topic

#1 ·  Posted (edited)

This script can be used to replace win's default alt+tab program, but the hotkey for this script is: ALT+` (the key above TAB)

I still need your help on these issues:

http://www.autoitscript.com/forum/index.ph...c=90979&hl= - to make the screen-shot window in real-time

http://www.autoitscript.com/forum/index.ph...c=90764&hl= - doesn't detect alt-up allways

Screen-Shot of this program here

Edit: fixed "_WinAPI_DestroyIcon: Cannot destroy object created by another thread." error.

check here and help me decide which way for switching icons is the best out of those 2 and the one here

Alt_Tab.au3

Edited by sandin

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

pretty good replacement.

I had 1 problem, quick fix was to comment out

_WinAPI_DestroyIcon($hIcon) in the _display_icon for it to work,error said "_Winapi_DestroyIcon: Cannot destroy object created by another thread."

also would be cool if you could add blur background instead of a black one when on vista/7.

Edit: Realtime update works great when aero is disabled, and if aero is enable there is a function for getting the window thumbnail.

Edited by Alek

[font="Impact"]Never fear, I is here.[/font]

Share this post


Link to post
Share on other sites

Really awesome, Same issue as Alek though. As for your issues, I haven't gone through your code, and am probably no where near experianced enough to help but, is there a way to check to see if the image is blank, and if so than to repeat the print process?


Giggity

Share this post


Link to post
Share on other sites

@sandin

Prety nice !  Good job :P

Keep it up

Cheers, FireFox.


 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

I can't get this to work. The script just crashes when I press Alt+Tab:

!>22:43:07 AutoIT3.exe ended.rc:-1073741819

Any ideas?

WBD

Share this post


Link to post
Share on other sites

@Alek:

another thread? hum, maybe this could be fixed if I make $hIcon var as global, instead of local.

And as for Vista, I'm not Vista's user, I still use WinXP SP3, I can't test any of those vista features.

and tnx for feedback :(

@JamesBrooks:

Thank you :P And ya, HotKeySet("!{TAB}", "_nothing") should block win xp's default alt+tab, but if you are using other application or vista's alt+tab func: _KeyboardProc should block it, actually "Return -1" should block it's alt+tab, but before "return -1" there are lots of stuff, if those stuff aren't done quickly enough you still get default alt+tab :D and I can't make "return -1" and then write the action :unsure: (I tried with adlibenable, but that was too slow)

@youknowwho4eva:

The problem is bigger then it seems, the picture doesn't get "blank" but only one single part of the window's screen shot get's blank, for example in Winamp it's playlist, in Firefox, it's main part where net content is displayed, for Total Commander are upper icons, etc... and I can't check that with pixels, cuz every window has different flaw in taking it's picture :D

@FireFox:

Tnx for positive feedback ;)

@WideBoyDixon:

Are you using latest AutoIt?

Share this post


Link to post
Share on other sites

I get a crash too as soon as I try the first ALT-TAB:

I see the dark GUI form with some icons at the bottom & the caption of the current window, but then but I get a message box with:

_WinAPI_DestroyIcon: Cannot destroy object created by another thread.

:P

I'm on XP Pro with SP3 and AutoIt 3.3.0.0

Share this post


Link to post
Share on other sites

Very Nice! Thanks! It crashed on me but I opened in Scite and since then seems to work...

Share this post


Link to post
Share on other sites

@WideBoyDixon:

Are you using latest AutoIt?

Yes I am on both machines. I've just tried on my work machine and it works fine. Strange. It's a very nice script! I did notice, however, that the screenshot of my IE8 window didn't look right; is this because IE8 uses multiple iexplore threads to prevent one thread from crashing the whole application?

WBD

Share this post


Link to post
Share on other sites

#12 ·  Posted (edited)

update: fixed "_WinAPI_DestroyIcon: Cannot destroy object created by another thread" error.

@JamesBrooks:

enable 283 and 284 instead of 285 line in the script, that will eliminate picture's slide, and reduce time to send "return -1" to win's ALT+TAB, and won't detect win's ALT+TAB anymore, but it's not as pretty as with slider :P

@WideBoyDixon

I fixed that error you had before (exceeded array), and tested IE8, and ya, I noticed the same bug, it's cuz IE uses layered window with transparency, and therefore user32.dll "print window" function capture it as black square.

Edited by sandin

Share this post


Link to post
Share on other sites

Right now I'm using your alt tab script with my windows transitions script. Looks almost like a futuristic OS. Only thing is my screenshots of my programs is just the title bar. I could fix it.... Damn hitting x closed my script.... but anyways. To work around the screenshot issue your having, I think it would look nice if it were like the mac task bar. Where the program you have selected has a large icon, and the to next to it are slightly larger then the others on the list. That way you don't have to worry about Microsofts built in blocks.


Giggity

Share this post


Link to post
Share on other sites

I get a crash too as soon as I try the first ALT-TAB:

I see the dark GUI form with some icons at the bottom & the caption of the current window, but then but I get a message box with:

:P

I'm on XP Pro with SP3 and AutoIt 3.3.0.0

Exactly the same problem, XP sp2 here


-jaenster

Share this post


Link to post
Share on other sites

update: fixed "_WinAPI_DestroyIcon: Cannot destroy object created by another thread" error.

Thanks sandin, works great now!

Share this post


Link to post
Share on other sites

@JamesBrooks:

update: The white line should be fixed now :P

@youknowwho4eva

Ya, the "printWindow" function can print window in it's current state, if it's resized to minimum size, then you'll get only Screen shot of a title bar, also if your window is minimized, you'll get only title bar. Btw, I like the idea about larger icons, but icon will not be so pretty if it's resized.

@jaenster:

Ernnnm, I could use extra info, how many windows you had running on your desktop? Cuz I noticed there was crash error with number of windows less then 4, but I fixed this in last update.

@ResNullius:

I'm glad it worked :unsure:

Share this post


Link to post
Share on other sites

Still get the "_WinAPI_DestroyIcon: Cannot destroy object created by another thread" error.

I'm running the german version of Windows XP SP2 with Autoit 3.3.0


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2017-04-18 - Version 1.4.8.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (NEW 2017-02-27 - Version 1.3.1.0) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2015-04-01 - Version 0.4.0.0) - Download - General Help & Support - Example Scripts
Excel - Example Scripts - Wiki
Word - Wiki
PowerPoint (2015-06-06 - Version 0.0.5.0) - Download - General Help & Support

Tutorials:
ADO - Wiki

 

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  
Followers 0