show image fullscreen without border

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
matthiasR
Pro Scripter
Posts: 52
Joined: Tue Jan 20, 2004 3:45 pm
Location: Lübbecke, Germany

show image fullscreen without border

Post by matthiasR » Fri May 18, 2007 8:39 am

Hi,

i have a bmp-image, which has the same size as the desktop. What is the easiest way in MacroScheduler to display it fullscreen without border?

Matthias

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

Post by Marcus Tettmar » Fri May 18, 2007 9:13 am

Hi,

Try this:

Code: Select all

GetScreenRes>w,h
Dialog>Dialog1
   Caption=MyDialog
   Width=10
   Height=10
   Top=0
   Left=0
   Image=d:\desktop.bmp,0,0,w,h
EndDialog>Dialog1

Let>style=0
LibFunc>user32,SetWindowLongA,sres,DIALOG1.HANDLE,-16,style
LibFunc>user32,ShowWindow,sres,DIALOG1.HANDLE,3

Show>Dialog1
Wait>10
Replace d:\desktop.bmp with the path to your bitmap file.

This example captures the screen and displays it. It can be very confusing, because effectively it "freezes" the screen for 10 seconds. Clicking on it does nothing for 10 seconds:

Code: Select all

GetScreenRes>w,h
ScreenCapture>0,0,w,h,d:\desktop.bmp

Dialog>Dialog1
   Caption=MyDialog
   Width=10
   Height=10
   Top=0
   Left=0
   Image=d:\desktop.bmp,0,0,w,h
EndDialog>Dialog1

Let>style=0
LibFunc>user32,SetWindowLongA,sres,DIALOG1.HANDLE,-16,style
LibFunc>user32,ShowWindow,sres,DIALOG1.HANDLE,3

Show>Dialog1
Wait>10
Be careful if you replace the Show>Dialog1 with a modal Show. You might not be able to get out of the dialog and you will get stuck. That's why I've gone with a non-modal show and a 10 second delay, so I know this script will end. You might want a loop and an OnEvent KEY_DOWN action so that you can stop the display with a key press.

Please note that these examples will only work with 9.1 as they use the dialog handle variable. In prior versions you will need to use FindWindow to determine the handle of the dialog. Search forums for FindWindow for examples. Or just make sure you're running 9.1 - much easier!
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

matthiasR
Pro Scripter
Posts: 52
Joined: Tue Jan 20, 2004 3:45 pm
Location: Lübbecke, Germany

Post by matthiasR » Fri May 18, 2007 6:56 pm

Thanks Marcus,

that will help.

Matthias

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