The Unofficial Macro Scheduler Puzzler of the Week 7

Anything Really. Just keep it clean!

Moderators: Dorian (MJT support), JRL

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

The Unofficial Macro Scheduler Puzzler of the Week 7

Post by JRL » Sat Oct 26, 2013 4:05 am

Is it Friday already? I took the week off from work to try and start getting things at home ready for winter. Seems I've gotten a lot done but in the midst of it all I almost forgot the puzzler...

But I didn't.

Whew! (I'm sure you're relieved too.)

We... many of us anyway... often use ScreenCapture> to save the current screen image to a file. What is missing from that screen capture is the mouse pointer. I'm very puzzled how adding the mouse pointer to the ScreenCapture> screen capture might be accomplished. 30 points and bragging rights for the best solution submitted before puzzler 8 gets posted.

User avatar
PepsiHog
Automation Wizard
Posts: 517
Joined: Wed Apr 08, 2009 4:19 pm
Location: Florida

Post by PepsiHog » Sun Oct 27, 2013 3:50 pm

JRL,

I'm a little fuzzy on what you're asking. With ScreenCapture you specify a coordinate where to capture from. Do you want the cursor to be captured within the pic? Or do you want a screen capture macro that you can use the cursor to select the image?

I can go on and on with questions about this puzzler. Will you please clarify the puzzler?

I am using v12. Is this puzzler aimed at a certain version or versions?

PepsiHog
Windows 7

PepsiHog. Yep! I drink LOTS of Pepsi (still..in 2024) AND enjoy programming. (That's my little piece of heaven!)

The immensity of the scope of possibilities within Macro Scheduler pushes the user beyond just macros!

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

Post by JRL » Mon Oct 28, 2013 3:19 am

PepsiHog wrote:I'm a little fuzzy...
Don't you mean fizzy?

Hi PepsiHog,

I am intentionally vague. I don't want to influence and thwart creativity with detailed rules.

What's puzzling me is how one might use the Macro Scheduler ScreenCapture> function to create a jpg or bmp file that contains a screen image in which a mouse pointer is displayed at the location the mouse was in when the screen was captured.
PepsiHog wrote:Or do you want a screen capture macro that you can use the cursor to select the image?
Already did that one here.

PepsiHog wrote:I can go on and on with questions about this puzzler.
Go for it. All questions are welcome.

PepsiHog wrote:I am using v12. Is this puzzler aimed at a certain version or versions?
My belief is that this weeks puzzler could be solved using any version greater then version 6. So version 12 should be adequate.

User avatar
Grovkillen
Automation Wizard
Posts: 1131
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

Post by Grovkillen » Mon Oct 28, 2013 11:39 am

Okay, here's my solution to the "none cursor in print screen". I have only captured the three (in my opinion) most common types of cursor. These are "IBEAM", "HAND", and "NORMAL". If you try to print a screen with something else than these types the standard "NORMAL" is picked.

Code: Select all

Let>APP_TITLE=CURSOR_TO_PRINT_SCREEN
Dialog>CURSOR_TO_PRINT_SCREEN
object CURSOR_TO_PRINT_SCREEN: TForm
  Left = 255
  Top = 104
  HelpContext = 5000
  BorderIcons = [biSystemMenu]
  Caption = 'X'
  ClientHeight = 60
  ClientWidth = 116
  Color = clWhite
  TransparentColor = True
  TransparentColorValue = clWhite
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = True
  ShowHint = True
  OnTaskBar = False
  PixelsPerInch = 96
  TextHeight = 13
  object CURSOR_NORMAL: tMSImage
    Left = 0
    Top = 0
    Width = 17
    Height = 25
    Picture.Data = {
      07544269746D6170C6030000424DC60300000000000036000000280000000C00
      000013000000010020000000000090030000130B0000130B0000000000000000
      0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000C0C
      0CFF0F0F0FFFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
      FF00FFFFFF00FFFFFF000C0C0CFFF5F5F9FFF5F5F9FF171717FFFFFFFF00FFFF
      FF00000000FF010101FFFFFFFF00FFFFFF00FFFFFF00FFFFFF000F0F0FFFF5F5
      F9FFF5F5F9FF1A1A1AFFFFFFFF00FFFFFF00010101FFF3F3F6FF060606FFFFFF
      FF00FFFFFF000F0F0FFFF5F5F9FFF5F5F9FF1B1B1BFFFFFFFF00FFFFFF00FFFF
      FF00030303FFF5F5F9FFF5F5F9FF0C0C0CFFFFFFFF00131313FFF5F5F9FFF5F5
      F9FF1F1F1FFFFFFFFF00FFFFFF00FFFFFF00060606FFF5F5F9FFF5F5F9FFF5F5
      F9FF131313FFF5F5F9FFF5F5F9FF1E1E1EFFFFFFFF00FFFFFF00FFFFFF00FFFF
      FF00090909FFF5F5F9FFF5F5F9FFF5F5F9FFF5F5F9FFF5F5F9FFF5F5F9FF2222
      22FF272727FF2B2B2BFF2F2F2FFF333333FF0C0C0CFFF5F5F9FFF5F5F9FFF5F5
      F9FFF5F5F9FFF5F5F9FFF5F5F9FFF5F5F9FFF5F5F9FFF5F5F9FFF5F5F9FF3737
      37FF0F0F0FFFF5F5F9FFF5F5F9FFF5F5F9FFF5F5F9FFF5F5F9FFF5F5F9FFF5F5
      F9FFF5F5F9FFF5F5F9FF373737FFFFFFFF00141414FFF5F5F9FFF5F5F9FFF5F5
      F9FFF5F5F9FFF5F5F9FFF5F5F9FFF5F5F9FFF5F5F9FF393939FFFFFFFF00FFFF
      FF00181818FFF5F5F9FFF5F5F9FFF5F5F9FFF5F5F9FFF5F5F9FFF5F5F9FFF5F5
      F9FF393939FFFFFFFF00FFFFFF00FFFFFF001C1C1CFFF5F5F9FFF5F5F9FFF5F5
      F9FFF5F5F9FFF5F5F9FFF5F5F9FF393939FFFFFFFF00FFFFFF00FFFFFF00FFFF
      FF00202020FFF5F5F9FFF5F5F9FFF5F5F9FFF5F5F9FFF5F5F9FF393939FFFFFF
      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00242424FFF5F5F9FFF5F5F9FFF5F5
      F9FFF5F5F9FF393939FFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
      FF00282828FFF5F5F9FFF5F5F9FFF5F5F9FF393939FFFFFFFF00FFFFFF00FFFF
      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF002C2C2CFFF5F5F9FFF5F5F9FF3939
      39FFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
      FF00313131FFF5F5F9FF393939FFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00353535FF393939FFFFFFFF00FFFF
      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
      FF00393939FFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00}
  end
  object CURSOR_BEAM: tMSImage
    Left = 20
    Top = 0
    Width = 17
    Height = 25
    Picture.Data = {
      07544269746D6170C6030000424DC60300000000000036000000280000000C00
      000013000000010020000000000090030000130B0000130B0000000000000000
      0000000000FF000000FF000000FF000000FFFFFFFFFF000000FF000000FF0000
      00FF000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
      FFFF000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
      FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000FFFFFFFFFFFFFFFFFFFFFF
      FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
      FFFF000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
      FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000FFFFFFFFFFFFFFFFFFFFFF
      FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
      FFFF000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
      FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000FFFFFFFFFFFFFFFFFFFFFF
      FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
      FFFF000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
      FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000FFFFFFFFFFFFFFFFFFFFFF
      FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
      FFFF000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
      FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000FFFFFFFFFFFFFFFFFFFFFF
      FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
      FFFF000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
      FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000FFFFFFFFFFFFFFFFFFFFFF
      FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
      FFFF000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
      FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000FFFFFFFFFFFFFFFFFFFFFF
      FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
      FFFF000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
      FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000FFFFFFFFFFFFFFFFFFFFFF
      FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
      FFFF000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
      FFFF000000FF000000FF000000FF000000FFFFFFFFFF000000FF000000FF0000
      00FF000000FFFFFFFFFFFFFFFFFFFFFFFFFF}
  end
  object CURSOR_HAND: tMSImage
    Left = 40
    Top = 0
    Width = 17
    Height = 25
    Picture.Data = {
      07544269746D6170C6030000424DC60300000000000036000000280000000F00
      000013000000010018000000000090030000130B0000130B0000000000000000
      0000FFFFFFFFFFFFFFFFFFFFFFFF0505050707070909090C0C0C0F0F0F121212
      1515151818181B1B1BFFFFFFFFFFFF000000FFFFFFFFFFFFFFFFFFFFFFFF0707
      07F5F5F9F5F5F9F5F5F9F5F5F9F5F5F9F5F5F9F5F5F91F1F1FFFFFFFFFFFFF00
      0000FFFFFFFFFFFFFFFFFFFFFFFF0A0A0AF5F5F9F5F5F9F5F5F9F5F5F9F5F5F9
      F5F5F9F5F5F9222222FFFFFFFFFFFF000000FFFFFFFFFFFFFFFFFF0A0A0AF5F5
      F9F5F5F9F5F5F9F5F5F9F5F5F9F5F5F9F5F5F9F5F5F9F5F5F9292929FFFFFF00
      0000FFFFFFFFFFFFFFFFFF000000F5F5F9F5F5F9F5F5F9F5F5F9F5F5F9F5F5F9
      F5F5F9F5F5F9F5F5F92D2D2DFFFFFF000000FFFFFFFFFFFFFFFFFF000000F5F5
      F9F5F5F9F5F5F9F5F5F9F5F5F9F5F5F9F5F5F9F5F5F9F5F5F9F5F5F934343400
      0000FFFFFFFFFFFF0F0F0FF5F5F9F5F5F9F5F5F9F5F5F9F5F5F9F5F5F9F5F5F9
      F5F5F9F5F5F9F5F5F9F5F5F9363636000000FFFFFF000000F5F5F9F5F5F9F5F5
      F9F5F5F9F5F5F9F5F5F9F5F5F9F5F5F9F5F5F9F6F6FAF6F6FAF6F6FA3B3B3B00
      0000000000F5F5F9F5F5F9F5F5F9F5F5F9F5F5F9F5F5F9F5F5F9F5F5F9F5F5F9
      F5F5F9F7F7FAF9F9FBF7F7FA3E3E3E000000121212F5F5F9F5F5F91C1C1CF5F5
      F9F5F5F9F5F5F9F5F5F9F5F5F9F5F5F9F6F6FA383838F9F9FBF7F7FA41414100
      00001616161919191C1C1C202020F5F5F9F5F5F92A2A2AF5F5F9F5F5F9343434
      F5F5F93B3B3BF7F7FAF6F6FA444444000000FFFFFFFFFFFFFFFFFF232323F5F5
      F9F5F5F92E2E2EF5F5F9F5F5F9383838F5F5F93E3E3EF5F5F9444444FFFFFF00
      0000FFFFFFFFFFFFFFFFFF272727F5F5F9F5F5F9313131F5F5F9F5F5F93B3B3B
      F5F5F9414141444444FFFFFFFFFFFF000000FFFFFFFFFFFFFFFFFF2A2A2AF5F5
      F9F5F5F9353535F5F5F9F5F5F93E3E3E414141FFFFFFFFFFFFFFFFFFFFFFFF00
      0000FFFFFFFFFFFFFFFFFF2E2E2EF5F5F9F5F5F93838383B3B3B3E3E3EFFFFFF
      FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000FFFFFFFFFFFFFFFFFF313131F5F5
      F9F5F5F93B3B3BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00
      0000FFFFFFFFFFFFFFFFFF353535F5F5F9F5F5F93F3F3FFFFFFFFFFFFFFFFFFF
      FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000FFFFFFFFFFFFFFFFFF383838F5F5
      F9F5F5F9424242FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00
      0000FFFFFFFFFFFFFFFFFFFFFFFF3F3F3F424242FFFFFFFFFFFFFFFFFFFFFFFF
      FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000}
  end
end
EndDialog>CURSOR_TO_PRINT_SCREEN
SetDialogProperty>CURSOR_TO_PRINT_SCREEN,,Caption,%APP_TITLE%
SetDialogProperty>CURSOR_TO_PRINT_SCREEN,CURSOR_HAND,Left,0
SetDialogProperty>CURSOR_TO_PRINT_SCREEN,CURSOR_BEAM,Left,0

//Remove border of window...
LibFunc>user32,SetWindowLongA,sres,CURSOR_TO_PRINT_SCREEN.handle,-16,1073741824

//CRTL+SHIFT+S=Print Screen, ESC=Exit app
OnEvent>KEY_DOWN,s,6,CAPTURE_SCREEN
OnEvent>KEY_DOWN,VK27,0,EXIT_APP

Label>WAITING_FOR_A_WHILE
Wait>0.02
Goto>WAITING_FOR_A_WHILE

SRT>CAPTURE_SCREEN
  GetCursorPos>MOUSE_X,MOUSE_Y,CURSOR_TYPE
  GetScreenRes>SCREEN_X,SCREEN_Y
  GoSub>SET_CURSOR_PIC
  Let>SCREENCAP_CLIPBOARD=0
  Show>CURSOR_TO_PRINT_SCREEN
  //I havent 1-to-1 mapped the mouse position vs window position (it's a couple of pixels off)
  MoveWindow>%APP_TITLE%,%MOUSE_X%,%MOUSE_Y%
  ScreenCapture>0,0,%SCREEN_X%,%SCREEN_Y%,%SCRIPT_DIR%\SCREEN_PRINT.PNG
  CloseDialog>CURSOR_TO_PRINT_SCREEN
  ExecuteFile>%SCRIPT_DIR%\SCREEN_PRINT.PNG
END>CAPTURE_SCREEN

SRT>SET_CURSOR_PIC
Let>CURSOR_FOUND=False
  If>CURSOR_TYPE=crHAND
    SetDialogProperty>CURSOR_TO_PRINT_SCREEN,CURSOR_HAND,Visible,True
    SetDialogProperty>CURSOR_TO_PRINT_SCREEN,CURSOR_BEAM,Visible,False
    SetDialogProperty>CURSOR_TO_PRINT_SCREEN,CURSOR_NORMAL,Visible,False
    Let>CURSOR_FOUND=True
  Endif>
  If>CURSOR_TYPE=crIBEAM
    SetDialogProperty>CURSOR_TO_PRINT_SCREEN,CURSOR_HAND,Visible,False
    SetDialogProperty>CURSOR_TO_PRINT_SCREEN,CURSOR_BEAM,Visible,True
    SetDialogProperty>CURSOR_TO_PRINT_SCREEN,CURSOR_NORMAL,Visible,False
    Let>CURSOR_FOUND=True
  Endif>
  If>CURSOR_TYPE=crNORMAL
    SetDialogProperty>CURSOR_TO_PRINT_SCREEN,CURSOR_HAND,Visible,False
    SetDialogProperty>CURSOR_TO_PRINT_SCREEN,CURSOR_BEAM,Visible,False
    SetDialogProperty>CURSOR_TO_PRINT_SCREEN,CURSOR_NORMAL,Visible,True
    Let>CURSOR_FOUND=True
  Endif>
  //If cursor not found...
  If>CURSOR_FOUND=False
    SetDialogProperty>CURSOR_TO_PRINT_SCREEN,CURSOR_HAND,Visible,False
    SetDialogProperty>CURSOR_TO_PRINT_SCREEN,CURSOR_BEAM,Visible,False
    SetDialogProperty>CURSOR_TO_PRINT_SCREEN,CURSOR_NORMAL,Visible,True
  Endif>
END>SET_CURSOR_PIC

SRT>EXIT_APP
  Exit>0
END>EXIT_APP
Save script file before run!

CTRL+SHIFT+S = Take a screen shot
ESC = Exit app

EDIT: Fixed JRL's comment about "/" when it should have been "\"! Thanks JRL :)
Last edited by Grovkillen on Mon Oct 28, 2013 2:03 pm, edited 1 time in total.
Let>ME=%Script%

Running: 15.0.27
version history

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

Post by JRL » Mon Oct 28, 2013 1:51 pm

Grovkillen,

Nice concept. I like the multiple cursor type idea. We only asked for a pointer but if you can go the extra step that's great.

A couple of issues with the script. You have some forward slashes where there should be back slashes. I'm guessing your computer allows this? My computer does not so until the slash change was made the script did not work. The other problem is that I'm getting a dialog border in my screen capture. The border surrounds the mouse pointer. I think you can fix that and "//I havent 1-to-1 mapped the mouse position vs window position (it's a couple of pixels off)" with the same small change to your dialog.

Thank you for submitting your script. I like it, it just needs a little tweaking.

User avatar
Grovkillen
Automation Wizard
Posts: 1131
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

Post by Grovkillen » Mon Oct 28, 2013 2:05 pm

Thanks for the feedback JRL, I changed the "\" issue but will continue to tweak. I might submit an update later in the week :)

EDIT: I couldn't hold myself from testing and I'm not able to reproduce the border issue. But I have removed the Libfunc and made the boarder itself invisible. Please try it again. The offset is now fixed to but be aware that it also depends on your cursor (it might be different between XP, 7 and 8).

Code: Select all

Let>APP_TITLE=CURSOR_TO_PRINT_SCREEN
Dialog>CURSOR_TO_PRINT_SCREEN
object CURSOR_TO_PRINT_SCREEN: TForm
  Left = 255
  Top = 104
  HelpContext = 5000
  BorderIcons = [biSystemMenu]
  BorderStyle = bsNone
  Caption = 'X'
  ClientHeight = 60
  ClientWidth = 116
  Color = clWhite
  TransparentColor = True
  TransparentColorValue = clWhite
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = True
  ShowHint = True
  OnTaskBar = False
  PixelsPerInch = 96
  TextHeight = 13
  object CURSOR_NORMAL: tMSImage
    Left = 0
    Top = 0
    Width = 17
    Height = 25
    Picture.Data = {
      07544269746D6170C6030000424DC60300000000000036000000280000000C00
      000013000000010020000000000090030000130B0000130B0000000000000000
      0000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000C0C
      0CFF0F0F0FFFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
      FF00FFFFFF00FFFFFF000C0C0CFFF5F5F9FFF5F5F9FF171717FFFFFFFF00FFFF
      FF00000000FF010101FFFFFFFF00FFFFFF00FFFFFF00FFFFFF000F0F0FFFF5F5
      F9FFF5F5F9FF1A1A1AFFFFFFFF00FFFFFF00010101FFF3F3F6FF060606FFFFFF
      FF00FFFFFF000F0F0FFFF5F5F9FFF5F5F9FF1B1B1BFFFFFFFF00FFFFFF00FFFF
      FF00030303FFF5F5F9FFF5F5F9FF0C0C0CFFFFFFFF00131313FFF5F5F9FFF5F5
      F9FF1F1F1FFFFFFFFF00FFFFFF00FFFFFF00060606FFF5F5F9FFF5F5F9FFF5F5
      F9FF131313FFF5F5F9FFF5F5F9FF1E1E1EFFFFFFFF00FFFFFF00FFFFFF00FFFF
      FF00090909FFF5F5F9FFF5F5F9FFF5F5F9FFF5F5F9FFF5F5F9FFF5F5F9FF2222
      22FF272727FF2B2B2BFF2F2F2FFF333333FF0C0C0CFFF5F5F9FFF5F5F9FFF5F5
      F9FFF5F5F9FFF5F5F9FFF5F5F9FFF5F5F9FFF5F5F9FFF5F5F9FFF5F5F9FF3737
      37FF0F0F0FFFF5F5F9FFF5F5F9FFF5F5F9FFF5F5F9FFF5F5F9FFF5F5F9FFF5F5
      F9FFF5F5F9FFF5F5F9FF373737FFFFFFFF00141414FFF5F5F9FFF5F5F9FFF5F5
      F9FFF5F5F9FFF5F5F9FFF5F5F9FFF5F5F9FFF5F5F9FF393939FFFFFFFF00FFFF
      FF00181818FFF5F5F9FFF5F5F9FFF5F5F9FFF5F5F9FFF5F5F9FFF5F5F9FFF5F5
      F9FF393939FFFFFFFF00FFFFFF00FFFFFF001C1C1CFFF5F5F9FFF5F5F9FFF5F5
      F9FFF5F5F9FFF5F5F9FFF5F5F9FF393939FFFFFFFF00FFFFFF00FFFFFF00FFFF
      FF00202020FFF5F5F9FFF5F5F9FFF5F5F9FFF5F5F9FFF5F5F9FF393939FFFFFF
      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00242424FFF5F5F9FFF5F5F9FFF5F5
      F9FFF5F5F9FF393939FFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
      FF00282828FFF5F5F9FFF5F5F9FFF5F5F9FF393939FFFFFFFF00FFFFFF00FFFF
      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF002C2C2CFFF5F5F9FFF5F5F9FF3939
      39FFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
      FF00313131FFF5F5F9FF393939FFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00353535FF393939FFFFFFFF00FFFF
      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
      FF00393939FFFFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
      FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00}
  end
  object CURSOR_BEAM: tMSImage
    Left = 20
    Top = 0
    Width = 17
    Height = 25
    Picture.Data = {
      07544269746D6170C6030000424DC60300000000000036000000280000000C00
      000013000000010020000000000090030000130B0000130B0000000000000000
      0000000000FF000000FF000000FF000000FFFFFFFFFF000000FF000000FF0000
      00FF000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
      FFFF000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
      FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000FFFFFFFFFFFFFFFFFFFFFF
      FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
      FFFF000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
      FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000FFFFFFFFFFFFFFFFFFFFFF
      FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
      FFFF000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
      FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000FFFFFFFFFFFFFFFFFFFFFF
      FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
      FFFF000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
      FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000FFFFFFFFFFFFFFFFFFFFFF
      FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
      FFFF000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
      FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000FFFFFFFFFFFFFFFFFFFFFF
      FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
      FFFF000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
      FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000FFFFFFFFFFFFFFFFFFFFFF
      FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
      FFFF000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
      FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000FFFFFFFFFFFFFFFFFFFFFF
      FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
      FFFF000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
      FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000FFFFFFFFFFFFFFFFFFFFFF
      FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
      FFFF000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
      FFFF000000FF000000FF000000FF000000FFFFFFFFFF000000FF000000FF0000
      00FF000000FFFFFFFFFFFFFFFFFFFFFFFFFF}
  end
  object CURSOR_HAND: tMSImage
    Left = 40
    Top = 0
    Width = 17
    Height = 25
    Picture.Data = {
      07544269746D6170C6030000424DC60300000000000036000000280000000F00
      000013000000010018000000000090030000130B0000130B0000000000000000
      0000FFFFFFFFFFFFFFFFFFFFFFFF0505050707070909090C0C0C0F0F0F121212
      1515151818181B1B1BFFFFFFFFFFFF000000FFFFFFFFFFFFFFFFFFFFFFFF0707
      07F5F5F9F5F5F9F5F5F9F5F5F9F5F5F9F5F5F9F5F5F91F1F1FFFFFFFFFFFFF00
      0000FFFFFFFFFFFFFFFFFFFFFFFF0A0A0AF5F5F9F5F5F9F5F5F9F5F5F9F5F5F9
      F5F5F9F5F5F9222222FFFFFFFFFFFF000000FFFFFFFFFFFFFFFFFF0A0A0AF5F5
      F9F5F5F9F5F5F9F5F5F9F5F5F9F5F5F9F5F5F9F5F5F9F5F5F9292929FFFFFF00
      0000FFFFFFFFFFFFFFFFFF000000F5F5F9F5F5F9F5F5F9F5F5F9F5F5F9F5F5F9
      F5F5F9F5F5F9F5F5F92D2D2DFFFFFF000000FFFFFFFFFFFFFFFFFF000000F5F5
      F9F5F5F9F5F5F9F5F5F9F5F5F9F5F5F9F5F5F9F5F5F9F5F5F9F5F5F934343400
      0000FFFFFFFFFFFF0F0F0FF5F5F9F5F5F9F5F5F9F5F5F9F5F5F9F5F5F9F5F5F9
      F5F5F9F5F5F9F5F5F9F5F5F9363636000000FFFFFF000000F5F5F9F5F5F9F5F5
      F9F5F5F9F5F5F9F5F5F9F5F5F9F5F5F9F5F5F9F6F6FAF6F6FAF6F6FA3B3B3B00
      0000000000F5F5F9F5F5F9F5F5F9F5F5F9F5F5F9F5F5F9F5F5F9F5F5F9F5F5F9
      F5F5F9F7F7FAF9F9FBF7F7FA3E3E3E000000121212F5F5F9F5F5F91C1C1CF5F5
      F9F5F5F9F5F5F9F5F5F9F5F5F9F5F5F9F6F6FA383838F9F9FBF7F7FA41414100
      00001616161919191C1C1C202020F5F5F9F5F5F92A2A2AF5F5F9F5F5F9343434
      F5F5F93B3B3BF7F7FAF6F6FA444444000000FFFFFFFFFFFFFFFFFF232323F5F5
      F9F5F5F92E2E2EF5F5F9F5F5F9383838F5F5F93E3E3EF5F5F9444444FFFFFF00
      0000FFFFFFFFFFFFFFFFFF272727F5F5F9F5F5F9313131F5F5F9F5F5F93B3B3B
      F5F5F9414141444444FFFFFFFFFFFF000000FFFFFFFFFFFFFFFFFF2A2A2AF5F5
      F9F5F5F9353535F5F5F9F5F5F93E3E3E414141FFFFFFFFFFFFFFFFFFFFFFFF00
      0000FFFFFFFFFFFFFFFFFF2E2E2EF5F5F9F5F5F93838383B3B3B3E3E3EFFFFFF
      FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000FFFFFFFFFFFFFFFFFF313131F5F5
      F9F5F5F93B3B3BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00
      0000FFFFFFFFFFFFFFFFFF353535F5F5F9F5F5F93F3F3FFFFFFFFFFFFFFFFFFF
      FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000FFFFFFFFFFFFFFFFFF383838F5F5
      F9F5F5F9424242FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00
      0000FFFFFFFFFFFFFFFFFFFFFFFF3F3F3F424242FFFFFFFFFFFFFFFFFFFFFFFF
      FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF000000}
  end
end
EndDialog>CURSOR_TO_PRINT_SCREEN
SetDialogProperty>CURSOR_TO_PRINT_SCREEN,,Caption,%APP_TITLE%
SetDialogProperty>CURSOR_TO_PRINT_SCREEN,CURSOR_HAND,Left,0
SetDialogProperty>CURSOR_TO_PRINT_SCREEN,CURSOR_BEAM,Left,0

//CRTL+SHIFT+S=Print Screen, ESC=Exit app
OnEvent>KEY_DOWN,s,6,CAPTURE_SCREEN
OnEvent>KEY_DOWN,VK27,0,EXIT_APP

Label>WAITING_FOR_A_WHILE
Wait>0.02
Goto>WAITING_FOR_A_WHILE

SRT>CAPTURE_SCREEN
  GetCursorPos>MOUSE_X,MOUSE_Y,CURSOR_TYPE
  GetScreenRes>SCREEN_X,SCREEN_Y
  GoSub>SET_CURSOR_PIC
  Let>SCREENCAP_CLIPBOARD=0
  Show>CURSOR_TO_PRINT_SCREEN
  MoveWindow>%APP_TITLE%,%MOUSE_X%,%MOUSE_Y%
  ScreenCapture>0,0,%SCREEN_X%,%SCREEN_Y%,%SCRIPT_DIR%\SCREEN_PRINT.PNG
  CloseDialog>CURSOR_TO_PRINT_SCREEN
  ExecuteFile>%SCRIPT_DIR%\SCREEN_PRINT.PNG
END>CAPTURE_SCREEN

SRT>SET_CURSOR_PIC
Let>CURSOR_FOUND=False
  If>CURSOR_TYPE=crHAND
    SetDialogProperty>CURSOR_TO_PRINT_SCREEN,CURSOR_HAND,Visible,True
    SetDialogProperty>CURSOR_TO_PRINT_SCREEN,CURSOR_BEAM,Visible,False
    SetDialogProperty>CURSOR_TO_PRINT_SCREEN,CURSOR_NORMAL,Visible,False
    Let>MOUSE_X=%MOUSE_X%-3
    Let>CURSOR_FOUND=True
  Endif>
  If>CURSOR_TYPE=crIBEAM
    SetDialogProperty>CURSOR_TO_PRINT_SCREEN,CURSOR_HAND,Visible,False
    SetDialogProperty>CURSOR_TO_PRINT_SCREEN,CURSOR_BEAM,Visible,True
    SetDialogProperty>CURSOR_TO_PRINT_SCREEN,CURSOR_NORMAL,Visible,False
    Let>MOUSE_Y=%MOUSE_Y%-9
    Let>CURSOR_FOUND=True
  Endif>
  If>CURSOR_TYPE=crNORMAL
    SetDialogProperty>CURSOR_TO_PRINT_SCREEN,CURSOR_HAND,Visible,False
    SetDialogProperty>CURSOR_TO_PRINT_SCREEN,CURSOR_BEAM,Visible,False
    SetDialogProperty>CURSOR_TO_PRINT_SCREEN,CURSOR_NORMAL,Visible,True
    Let>CURSOR_FOUND=True
  Endif>
  //If cursor not found...
  If>CURSOR_FOUND=False
    SetDialogProperty>CURSOR_TO_PRINT_SCREEN,CURSOR_HAND,Visible,False
    SetDialogProperty>CURSOR_TO_PRINT_SCREEN,CURSOR_BEAM,Visible,False
    SetDialogProperty>CURSOR_TO_PRINT_SCREEN,CURSOR_NORMAL,Visible,True
  Endif>
END>SET_CURSOR_PIC

SRT>EXIT_APP
  Exit>0
END>EXIT_APP
Let>ME=%Script%

Running: 15.0.27
version history

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

Post by JRL » Wed Oct 30, 2013 4:20 pm

Grovkillen,

Sorry, you edited your last post and it didn't bump the thread so I didn't know that you had submitted a change.

Yes, removing the dialog border was the "fix" I'd anticipated. Good job!

Anyone else have a better way?

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

Post by JRL » Fri Nov 01, 2013 2:56 pm

Here it is Friday already and Grovkillen has the only attempt to solve this week's puzzler. It is a very good solution, would have been hard to beat. Congratulations Grovkillen! You have 30 rep points heading your way.

User avatar
Grovkillen
Automation Wizard
Posts: 1131
Joined: Fri Aug 10, 2012 2:38 pm
Location: Bräcke, Sweden
Contact:

Post by Grovkillen » Fri Nov 01, 2013 7:46 pm

Thanks JRL! I'm really happy for the recognition and thank you for the points! Your puzzles are awesome and I'm always excited to see what you come up with next. :)
Let>ME=%Script%

Running: 15.0.27
version history

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