Splash Screen Example

General Macro Scheduler discussion

Moderators: Dorian (MJT support), JRL

Post Reply
User avatar
Rain
Automation Wizard
Posts: 550
Joined: Tue Aug 09, 2005 5:02 pm
Contact:

Splash Screen Example

Post by Rain » Sun Jun 01, 2008 12:52 pm

Written with version 10.1.15

Edit:
I was going to use an image in this example but the forum won't let me post the image data without adding php tags to the code.

__________________________________________________
Splash screen example with an image instead of a label

Code: Select all

Dialog>SplashScreen
   Caption=SplashScreen
   Width=270
   Height=50
   Top=CENTER
   Left=CENTER
   Max=0
   Min=0
   Close=1
   Resize=0
   Label=Splash Screen,5,0,true
EndDialog>SplashScreen

SetDialogObjectFont>SplashScreen,msLabel1,Tahoma,28,1,255

//Borderless Dialog
LibFunc>user32,SetWindowLongA,sres,SplashScreen.handle,-16,1073741824

//Make Dialog Transparent
Let>ByteOpacity=0
Let>GWL_EXSTYLE=-20
Let>WS_EX_LAYERED=524288
Let>LWA_ALPHA=2

//Get Style Attributes of Dialog Window
LibFunc>user32,GetWindowLongA,attribs,SplashScreen.handle,GWL_EXSTYLE
Let>attribs={%attribs% OR %WS_EX_LAYERED%}

LibFunc>user32,SetWindowLongA,swl,SplashScreen.handle,GWL_EXSTYLE,attribs
LibFunc>user32,SetLayeredWindowAttributes,res,SplashScreen.handle,0,ByteOpacity,LWA_ALPHA
show>SplashScreen


Let>ByteOpacity=0
let>KK=0
label>splash loop
wait>.02
add>KK,2
//Time to display Splash screen
if>KK>350,splash done
//Increase Dialog Opacity
add>ByteOpacity,2
if>ByteOpacity>254
Let>ByteOpacity=255
endif
//Change Dialog Opacity
LibFunc>user32,SetWindowLongA,swl,SplashScreen.handle,GWL_EXSTYLE,attribs
LibFunc>user32,SetLayeredWindowAttributes,res,SplashScreen.handle,0,ByteOpacity,LWA_ALPHA
goto>splash loop

label>splash done
cdg>SplashScreen

//Main Script Starts Here
mdl>Start of main script
Last edited by Rain on Mon Jun 02, 2008 5:07 pm, edited 3 times in total.

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

Post by JRL » Mon Jun 02, 2008 5:09 am

Nice one Rain. :D
I wish more members would volunteer cool script samples like this one AND this one.
Thank you for both of them.

I was going to use an image in this example but the forum won't let me post the image data without adding php tags to the code.
Isn't that irritating. :(

User avatar
Rain
Automation Wizard
Posts: 550
Joined: Tue Aug 09, 2005 5:02 pm
Contact:

Post by Rain » Mon Jun 02, 2008 1:32 pm

You welcome JRL.
Isn't that irritating. :(
It sure is.

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 Jun 02, 2008 3:10 pm

What's the issue with PHP tags? NOTHING should add PHP tags. Are you sure about that? Please explain. You must mean something else - PHP is not a tag based language.

You can post images to the forum - your sig has one. If you mean you want to include it in your script did you ensure you checked "Disable HTML in this post" and "Disable Smilies in this post".
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
Rain
Automation Wizard
Posts: 550
Joined: Tue Aug 09, 2005 5:02 pm
Contact:

Post by Rain » Mon Jun 02, 2008 3:48 pm

Hi Marcus,
I'm talking about posting the bitmap data imported by Macro Scheduler. Sorry, I meant the forum is displaying HTML tags and not PHP tags.

This is what I'm talking about.

Code: Select all

Let>APP_TITLE=SplashScreen

Dialog>SplashScreen
   Caption=SplashScreen
   Width=270
   Height=60
   Top=CENTER
   Left=CENTER
   Max=0
   Min=0
   Close=1
   Resize=0
   Label=|,-6658,-6420,true
   Image=YOURLOGO_DATA,0,0,270,60,msImage1,0
EndDialog>SplashScreen

//Borderless Dialog
LibFunc>user32,SetWindowLongA,sres,SplashScreen.handle,-16,1073741824

//Make Dialog Transparent
Let>ByteOpacity=0
Let>GWL_EXSTYLE=-20
Let>WS_EX_LAYERED=524288
Let>LWA_ALPHA=2

//Get Style Attributes of Dialog Window
LibFunc>user32,GetWindowLongA,attribs,SplashScreen.handle,GWL_EXSTYLE
Let>attribs={%attribs% OR %WS_EX_LAYERED%}

LibFunc>user32,SetWindowLongA,swl,SplashScreen.handle,GWL_EXSTYLE,attribs
LibFunc>user32,SetLayeredWindowAttributes,res,SplashScreen.handle,0,ByteOpacity,LWA_ALPHA
show>SplashScreen


Let>ByteOpacity=0
let>KK=0
label>splash loop
wait>.02
add>KK,2
//Time to display Splash screen
if>KK>350,splash done
//Increase Dialog Opacity
add>ByteOpacity,2
if>ByteOpacity>254
Let>ByteOpacity=255
endif
//Change Dialog Opacity
LibFunc>user32,SetWindowLongA,swl,SplashScreen.handle,GWL_EXSTYLE,attribs
LibFunc>user32,SetLayeredWindowAttributes,res,SplashScreen.handle,0,ByteOpacity,LWA_ALPHA
goto>splash loop

label>splash done
cdg>SplashScreen

//Main Script Starts Here
mdl>Start of main script






YOURLOGO_DATA:
424D56FD00000000000snip

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 Jun 02, 2008 3:55 pm

Nothing is being added. What is happening is that that data is ENORMOUS. It is FAR too big for the data field in the forum database. So what is happening is the post is truncated. Since it is truncated the final textarea tag is missing and so the rest of the HTML in the source of the forum page is shown inside the textarea and the page looks all odd.

The forum isn't designed for storing that much text. I could increase the size of the field, but it might not be a good idea. What you could do is upload the script as a text file somewhere else and link to it, and in the forum post SNIP the data.
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
Rain
Automation Wizard
Posts: 550
Joined: Tue Aug 09, 2005 5:02 pm
Contact:

Post by Rain » Mon Jun 02, 2008 4:02 pm

Thank you for your quick reply and answer, Marcus.

I don't know of a free service that allows you to permanently store files on their server. The ones I found will delete files that haven't been downloaded in X number of days.

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

Post by JRL » Mon Jun 02, 2008 4:14 pm

Google blog pages seem to hold up. Apparently access to them expires if you don't login and edit them in 30 days but I have one I created in 2005 that has one stupid entry. I can't get to it to add or edit but the page still exists. I don't know if you can store files there but you can post a script with base64 encoding.

See an example here

Just a thought,
Dick

User avatar
Bob Hansen
Automation Wizard
Posts: 2475
Joined: Tue Sep 24, 2002 3:47 am
Location: Salem, New Hampshire, US
Contact:

Post by Bob Hansen » Mon Jun 02, 2008 4:25 pm

You can also set up a free public folder on SkyDrive.
Hope this was helpful..................good luck,
Bob
A humble man and PROUD of it!

User avatar
Rain
Automation Wizard
Posts: 550
Joined: Tue Aug 09, 2005 5:02 pm
Contact:

Post by Rain » Mon Jun 02, 2008 5:04 pm

Thanks Dick and Bob. I've decided to go with Bob's suggestion.

Here is the same script with an image
Splash Screen with image

Aaron
Pro Scripter
Posts: 113
Joined: Mon Apr 09, 2007 1:35 am
Location: Wyoming

Image with transparent background ?

Post by Aaron » Mon Sep 01, 2008 5:12 am

Is there a way to have a borderless dialog with a transparent background.
Aaron

Aaron
Pro Scripter
Posts: 113
Joined: Mon Apr 09, 2007 1:35 am
Location: Wyoming

transparent with image not button

Post by Aaron » Mon Sep 01, 2008 5:28 pm

I found the post - http://www.mjtnet.com/forum/viewtopic.p ... ght=#15951 Posted: Sat Apr 21, 2007 9:36 am, where it talks about a button showing transparent when you don't have a border of another color, but this dose not appear to work with images.
Can someone direct me to a help page or post that explains how I could make the color outside the main image transparent.

Thank You
Aaron

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