Windows transparency setting

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
karimun
Newbie
Posts: 3
Joined: Sat Apr 28, 2007 7:52 pm

Windows transparency setting

Post by karimun » Sat Apr 28, 2007 8:09 pm

As it is my first post I want to first say thanks to all for your first class support in this forum.

My questions:

> I need to make specific windows transparent (alpha blending). How does this work in MS?
> Is it possible to produce mouse clicks inside of windows which are placed outside of the visible screen?

User avatar
JRL
Automation Wizard
Posts: 3501
Joined: Mon Jan 10, 2005 6:22 pm
Location: Iowa

Post by JRL » Sat Apr 28, 2007 10:52 pm

I can't answer your first question because I know nothing about transparent windows. But I would ask, how does it work outside of Macro Scheduler? This software is made to automate other software so most of the time if you can do it Macro Scheduler can do it.

For your second question. I move windows off screen all the time. Microsoft won't let the mouse move outside the visible screen. But if you can figure out a way to do keystrokes or button presses with the Pushbutton> function you can do work in windows that are placed in non visible locations.

Hope this is helpful,
Dick

karimun
Newbie
Posts: 3
Joined: Sat Apr 28, 2007 7:52 pm

Post by karimun » Sat Apr 28, 2007 11:39 pm

Right now, I use http://www.zeroherosoftware.com/alphaxp.html to make windows transparent but doing it through MS means one program less to handle.
Is there really no way to set transparency via MS ?

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Sat Apr 28, 2007 11:56 pm

Hi karimun,

Thanks for that link, I didn't know that was out there.

I too would like to know if any transparency effects can be achieved using Macro Scheduler and... perhaps a few Windows API calls?

Marcus, any possibilities? Now or in the future? With everyone moving to Vista, I would think the demand for this can only increase.

Take care :)
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Mon Apr 30, 2007 6:30 am

Just wondering - how does making a window transparent help with automation of a process?
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Mon Apr 30, 2007 7:53 am

mtettmar wrote:Just wondering - how does making a window transparent help with automation of a process?
Transparecy may not apply much to fully "unattended" automation of a process... but there are plenty of macros out there that simply automate logons and open/size/position appropriate apps for a user in the morning and get their workstation ready to go... just the way they like it.

Whether some users like transparency because they can see activity in a background window "through" a foreground semi-transparent window or just because it looks cool... doesn't much matter. Its possible, its something they want and if Macro Scheduler can automate things here for these "startup" macros, so much the better. Otherwise, people will use whatever other tools they can to do what they want to do... as karimun already seems to be doing.

Just my thoughts, feel free to add if you have further thoughts on transparency. Does anyone else out there think this is something you'd like to manipulate from within a Macro Scheduler macro? :)
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Mon Apr 30, 2007 8:13 am

Ok, run this to make Notepad transparent

Code: Select all

//constants
Let>GWL_EXSTYLE=-20
Let>WS_EX_LAYERED=524288
Let>LWA_ALPHA=2

//opacity
Let>byteOpacity=128

//run notepad and get its handle
Run>notepad.exe
WaitWindowOpen>notepad*
GetWindowHandle>notepad*,nphwnd

//get style attributes of notepad's window
LibFunc>user32,GetWindowLongA,attribs,nphwnd,GWL_EXSTYLE
Let>attribs={%attribs% OR %WS_EX_LAYERED%}

//make notepad transparent
LibFunc>user32,SetWindowLongA,swl,nphwnd,GWL_EXSTYLE,attribs
LibFunc>user32,SetLayeredWindowAttributes,res,nphwnd,0,byteOpacity,LWA_ALPHA
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
jpuziano
Automation Wizard
Posts: 1085
Joined: Sat Oct 30, 2004 12:00 am

Post by jpuziano » Mon Apr 30, 2007 8:20 am

Just tried it in XP, works great... thanks Marcus. :D
jpuziano

Note: If anyone else on the planet would find the following useful...
[Open] PlayWav command that plays from embedded script data
...then please add your thoughts/support at the above post - :-)

karimun
Newbie
Posts: 3
Joined: Sat Apr 28, 2007 7:52 pm

Post by karimun » Mon Apr 30, 2007 1:47 pm

Thank you very much for the code you posted. Yes it works (XP SP2)!
Just wondering - how does making a window transparent help with automation of a process?
I try to establish a more or less hands-free, speech controlled entertainment concept on my local pc (music, news, podcasts, slideshows..). Without MS I would have even not started to..
Why transparency? To generate mouse clicks in programs which dont support shortcuts! The result is that the screen layout doesnt get destroyed through clumsy windows.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts