My idea is to create a transparent Form over the whole screen and capture a small predifened area around the cursor, close the transparent form for the mouse click/mouse over to perform, create the Form again before next action, etc.
This is the code I started to used to create this transparent FORM:
Code: Select all
Dialog>Dialog1
Label=g,4,4
EndDialog>Dialog1
Let>pxw=90
Let>pxh=60
Let>X1Offset=500
Let>Y1Offset=500
Let>Left1=X1Offset
Let>Top1=Y1Offset
Let>Right1=pxw+X1Offset
Let>Bottom1=pxh+Y1Offset
Let>height1=pxh+100
Let>width1=pxw+100
Let>Y1Offset=Y1Offset-5
Let>X1Offset=X1Offset-10
SetDialogProperty>Dialog1,,Position,poDesigned
SetDialogProperty>Dialog1,,Left,X1Offset
SetDialogProperty>Dialog1,,Top,Y1Offset
SetDialogProperty>Dialog1,,clientheight,height1
SetDialogProperty>Dialog1,,clientwidth,width1
SetDialogProperty>Dialog1,,Color,255
//Set Text Color (color number 234567 is a shade of green)
SetDialogObjectFont>Dialog1,msLabel1,WebDings,120,1,234567
//Removes borders
LibFunc>user32,SetWindowLongA,sres,dialog1.handle,-16,1073741824
//Open the dialog (normal appearance)
Show>Dialog1
//constants
Let>GWL_EXSTYLE=-20
Let>WS_EX_LAYERED=524288
Let>LWA_COLORKEY=1
//get style attributes of dialog1 window
LibFunc>user32,GetWindowLongA,attribs,dialog1.handle,GWL_EXSTYLE
Let>attribs={%attribs% OR %WS_EX_LAYERED%}
//make selected color transparent (color number 234567)
LibFunc>user32,SetWindowLongA,swl,dialog1.handle,GWL_EXSTYLE,attribs
LibFunc>user32,SetLayeredWindowAttributes,res,dialog1.handle,234567,0,LWA_COLORKEY
//Make the button disappear
LibFunc>User32,ShowWindow,SWres,dialog1.msbutton1.handle,0
//Show the dialog without text for a couple of seconds
CloseDialog>dialog1
ResetDialogAction>dialog1
Label>Start
Show>dialog1
Goto>Start
The two biggest chanllenges I have is to:
1. Change the g into a 16:9 ratio, but will need a different object that can be sized seperately between Heigt & Width to get this ratio.
2. Played around using different objects like panels & memos that can be set like that, but cannot get anything to go inivisble as soon as the Dialog Designer places some extra code so why does this work?
Code: Select all
Dialog>Dialog1
Label=g,4,4
EndDialog>Dialog1
Code: Select all
Dialog>Dialog1
object Dialog1: TForm
Left = 479
Top = 205
HelpContext = 5000
BorderIcons = [biSystemMenu]
Caption = 'CustomDialog'
ClientHeight = 203
ClientWidth = 586
Color = clBtnFace
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -14
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = True
ShowHint = True
OnTaskBar = False
PixelsPerInch = 120
TextHeight = 16
object msLabel1: TLabel
Left = 4
Top = 4
Width = 8
Height = 16
Caption = 'g'
end
end
EndDialog>Dialog1