Here is a clock with a few more features.
Start this and after a couple of screen gyrations a clock should appear in the middle of your screen. Double click on the clock and a menu will appear giving you the options to Minimize, Resize, Move, Stay-On_Top, Close the Clock or Close This Menu.
If you pick Resize the screen will go semi white. At this time you can draw a circle on the screen by picking a point and dragging to make the circle any size you like. When you release the mouse the screen will return to normal and the clock will fill the circle you just drew.
If you pick Move you will be able to click on the clock and drag it to a new location on the screen. When you release the mouse the clock will reside in the location to which you dragged it.
If you pick Stay-On-Top the clock will remain visible over the top of most other windows. See the remarks in the script if you intend to compile this.
If you pick Close the Clock the program will end saving your current size and location settings.
If you pick Close This Menu the menu will close without making any changes to the clock.
Code: Select all
StringReplace>Command_Line,",,Command_Line
ExtractFileName>Command_Line,strFileName
ExtractFileExt>Command_Line,strFileExt
StringReplace>strFileName,strFileExt,,strFileName
Trim>strFileName,strFileName
Let>APP_TITLE=%strFileName%
Dialog>Dialog1
object Dialog1: TForm
Left = 534
Top = 289
AlphaBlend = True
AlphaBlendValue = 255
BorderStyle = bsNone
HelpContext = 5000
Caption = 'Analog'
ClientHeight = 400
ClientWidth = 400
Color = 3
Font.Charset = DEFAULT_CHARSET
Font.Color = clWindowText
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
OldCreateOrder = True
Position = poScreenCenter
ShowHint = True
PixelsPerInch = 96
TextHeight = 13
object Panel1: TPanel
Left = 0
Top = 0
Width = 400
Height = 400
BevelOuter = bvNone
Caption = 'o'
Color = clWhite
Font.Charset = DEFAULT_CHARSET
Font.Color = clWhite
Font.Height = -5
Font.Name = 'MS Sans Serif'
Font.Style = []
ParentFont = False
TabOrder = 0
object Label1: TLabel
Left = 257
Top = 68
Width = 17
Height = 36
Caption = '1'
Font.Charset = ANSI_CHARSET
Font.Color = clWindowText
Font.Height = -31
Font.Name = 'Arial'
Font.Style = [fsBold]
ParentFont = False
end
object Label2: TLabel
Left = 306
Top = 116
Width = 17
Height = 36
Caption = '2'
Font.Charset = ANSI_CHARSET
Font.Color = clWindowText
Font.Height = -31
Font.Name = 'Arial'
Font.Style = [fsBold]
ParentFont = False
end
object Label3: TLabel
Left = 324
Top = 182
Width = 17
Height = 36
Caption = '3'
Font.Charset = ANSI_CHARSET
Font.Color = clWindowText
Font.Height = -31
Font.Name = 'Arial'
Font.Style = [fsBold]
ParentFont = False
end
object Label4: TLabel
Left = 306
Top = 248
Width = 17
Height = 36
Caption = '4'
Font.Charset = ANSI_CHARSET
Font.Color = clWindowText
Font.Height = -31
Font.Name = 'Arial'
Font.Style = [fsBold]
ParentFont = False
end
object Label5: TLabel
Left = 260
Top = 296
Width = 17
Height = 36
Caption = '5'
Font.Charset = ANSI_CHARSET
Font.Color = clWindowText
Font.Height = -31
Font.Name = 'Arial'
Font.Style = [fsBold]
ParentFont = False
end
object Label6: TLabel
Left = 192
Top = 316
Width = 17
Height = 36
Caption = '6'
Font.Charset = ANSI_CHARSET
Font.Color = clWindowText
Font.Height = -31
Font.Name = 'Arial'
Font.Style = [fsBold]
ParentFont = False
end
object Label7: TLabel
Left = 122
Top = 296
Width = 17
Height = 36
Caption = '7'
Font.Charset = ANSI_CHARSET
Font.Color = clWindowText
Font.Height = -31
Font.Name = 'Arial'
Font.Style = [fsBold]
ParentFont = False
end
object Label8: TLabel
Left = 78
Top = 248
Width = 17
Height = 36
Caption = '8'
Font.Charset = ANSI_CHARSET
Font.Color = clWindowText
Font.Height = -31
Font.Name = 'Arial'
Font.Style = [fsBold]
ParentFont = False
end
object Label9: TLabel
Left = 61
Top = 182
Width = 17
Height = 36
Caption = '9'
Font.Charset = ANSI_CHARSET
Font.Color = clWindowText
Font.Height = -31
Font.Name = 'Arial'
Font.Style = [fsBold]
ParentFont = False
end
object Label10: TLabel
Left = 69
Top = 120
Width = 34
Height = 36
Caption = '10'
Font.Charset = ANSI_CHARSET
Font.Color = clWindowText
Font.Height = -31
Font.Name = 'Arial'
Font.Style = [fsBold]
ParentFont = False
end
object Label11: TLabel
Left = 119
Top = 68
Width = 32
Height = 36
Caption = '11'
Font.Charset = ANSI_CHARSET
Font.Color = clWindowText
Font.Height = -31
Font.Name = 'Arial'
Font.Style = [fsBold]
ParentFont = False
end
object Label12: TLabel
Left = 183
Top = 50
Width = 34
Height = 36
Caption = '12'
Font.Charset = ANSI_CHARSET
Font.Color = clWindowText
Font.Height = -31
Font.Name = 'Arial'
Font.Style = [fsBold]
ParentFont = False
end
object MSImage1: tMSImage
Left = 0
Top = 0
Width = 400
Height = 400
end
end
end
EndDialog>Dialog1
Dialog>Dialog2
object Dialog2: TForm
Position = poScreenCenter
BorderStyle = bsNone
BorderIcons = [biSystemMenu, biMinimize]
TransparentColor = True
TransparentColorValue = 3
Caption = 'AnalogClock'
ClientHeight = 400
ClientWidth = 400
Color = 3
OnTaskBar = True
end
EndDialog>Dialog2
Dialog>Dialog3
object Dialog3: TForm
AutoSize = True
AlphaBlend = True
AlphaBlendValue = 0
BorderStyle = bsNone
object Panel1: TPanel
Left = 0
Top = 0
Width = 130
Height = 25
Alignment = taLeftJustify
Caption = 'Minimize'
TabOrder = 0
end
object Panel2: TPanel
Left = 0
Top = 25
Width = 130
Height = 25
Alignment = taLeftJustify
Caption = 'Resize'
TabOrder = 1
end
object Panel3: TPanel
Left = 0
Top = 50
Width = 130
Height = 25
Alignment = taLeftJustify
Caption = 'Move'
TabOrder = 2
end
object Panel4: TPanel
Left = 0
Top = 75
Width = 130
Height = 25
Alignment = taLeftJustify
Caption = 'Stay-on-Top'
TabOrder = 3
end
object Panel5: TPanel
Left = 0
Top = 100
Width = 130
Height = 25
Alignment = taLeftJustify
Caption = 'Close the Clock'
TabOrder = 3
end
object Panel6: TPanel
Left = 0
Top = 125
Width = 130
Height = 25
Alignment = taLeftJustify
Caption = 'Close This Menu'
TabOrder = 3
end
object MSImage1: tMSImage
Left = 0
Top = 0
AutoSize = True
end
end
EndDialog>Dialog3
Dialog>Dialog4
object Dialog4: TForm
BorderStyle = bsNone
FormStyle = fsStayOnTop
AlphaBlend = True
AlphaBlendValue = 100
object Panel1: TPanel
Left = 0
Top = 0
Width = 400
Height = 400
BevelOuter = bvNone
Caption = 'o'
Color = clWhite
Font.Charset = DEFAULT_CHARSET
Font.Color = clWhite
Font.Height = -11
Font.Name = 'MS Sans Serif'
Font.Style = []
end
end
EndDialog>Dialog4
AddDialogHandler>Dialog1,,OnClose,Quit
AddDialogHandler>Dialog2,,OnClose,Quit
AddDialogHandler>Dialog2,,OnDblClick,Ask
AddDialogHandler>Dialog2,,OnMouseDown,MoveTheClock
AddDialogHandler>Dialog2,,OnMouseUp,StopMoveTheClock
AddDialogHandler>Dialog3,Panel1,OnClick,Minimizer
AddDialogHandler>Dialog3,Panel2,OnClick,ReSizeClock
AddDialogHandler>Dialog3,Panel3,OnClick,MoveClock
AddDialogHandler>Dialog3,Panel4,OnClick,OnTopClock
AddDialogHandler>Dialog3,Panel5,OnClick,CloseClock
AddDialogHandler>Dialog3,Panel6,OnClick,CloseMenu
AddDialogHandler>Dialog4,Panel1,OnMouseDown,DrawResizeCircle
AddDialogHandler>Dialog4,Panel1,OnMouseUp,StopDrawResizeCircle
SetDialogProperty>Dialog2,,Caption,APP_TITLE
Let>ClockResizeFlag=0
Let>ClockMoveFlag=0
Let>AskFlag=0
Let>StayOnTopFlag=0
Let>rednum=0
Let>greennum=0
Let>bluenum=0
Random>2,Direction
LibFunc>user32,GetDC,HDC1,%Dialog1.handle%
LibFunc>user32,GetDC,HDC2,%Dialog2.handle%
LibFunc>Gdi32,SetStretchBltMode,SSBMres,HDC2,4
LibFunc>Gdi32,SetBrushOrgEx,SBOEres,HDC2,0,0,
IfFileExists>%temp_dir%ClockFace.bmp
SetDialogProperty>Dialog1,,AlphaBlendValue,0
Show>Dialog1
Else
Show>Dialog1
Let>TickAngle=-96
Let>TickCount=0
Repeat>TickCount
Add>TickCount,1
Add>TickAngle,6
GoSub>Tick,Dialog1,Panel1,TickAngle,200,200,110,1,0
Until>TickCount=60
GoSub>DrawArc,Dialog1.Panel1.Handle,10,0,196,196,204,204,196,196,196,196
GetWindowSize>Analog,WinsizeW,WinSizeH
GetWindowPos>Analog,WinposX,WinposY
Let>resx=%WinSizeW%-400
Let>resy=%WinSizeH%-400
Let>vBorder=%Resx%/2
Let>Titlebar={%WinSizeH%-%vBorder%-400}
Let>TLX=%WinposX%+%vBorder%
Let>TLY=%WinposY%+%titlebar%
Let>BRX=%TLX%+400
Let>BRY=%TLY%+400
Wait>1
ScreenCapture>TLX,TLY,BRX,BRY,%temp_dir%ClockFace.bmp
EndIf
SetDialogProperty>Dialog1,MSImage1,LoadImage,%temp_dir%ClockFace.bmp
SetDialogProperty>Dialog1,,AlphaBlendValue,0
Show>Dialog2
IfFileExists>%temp_dir%JRLClockSettings.ini
ReadIniFile>%temp_dir%JRLClockSettings.ini,Settings,Xposition,D2WinX
ReadIniFile>%temp_dir%JRLClockSettings.ini,Settings,Yposition,D2WinY
ReadIniFile>%temp_dir%JRLClockSettings.ini,Settings,Width,D2WinW
ReadIniFile>%temp_dir%JRLClockSettings.ini,Settings,Height,D2WinH
Let>WIN_USEHANDLE=1
MoveWindow>Dialog2.Handle,D2WinX,D2WinY
ResizeWindow>Dialog2.Handle,D2WinW,D2WinH
Let>WIN_USEHANDLE=0
EndIf
Dialog>TitleBarSizeCalculation
Button=1,0,0,0,0,0
EndDialog>TitleBarSizeCalculation
Let>WIN_USEHANDLE=1
MoveWindow>TitleBarSizeCalculation.handle,0,0
GetWindowPos>TitleBarSizeCalculation.msButton1.handle,OffSetX,OffSetY
Let>WIN_USEHANDLE=0
Sec>FirstTime
////////////////// Start Process Loop //////////////////
Label>Loop
Sec>SecondTime
If>FirstTime=SecondTime
Else
GoSub>SetColor
Let>FirstTime=SecondTime
Let>SecDir={(%SecondTime%*6)+(90*-1)}
SetDialogProperty>Dialog1,Panel1,Caption,SecDir
GoSub>Angle,Dialog1,Panel1,SecDir,200,200,120,2,255
Min>ThisMinute
Let>MinDir={(%ThisMinute%*6)+(90*-1)+((%SecondTime%/60)*6)}
GoSub>Angle,Dialog1,Panel1,MinDir,200,200,110,5,0
Hour>HourTime
If>HourTime>11
Sub>HourTime,12
EndIf
Let>HourDir={(%HourTime%*30)+(90*-1)+((%ThisMinute%/60)*30)}
GoSub>Angle,Dialog1,Panel1,HourDir,200,200,70,5,0
EndIf
GoSub>DrawArc,Dialog1.Panel1.Handle,5,255,196,196,204,204,196,196,196,196
GoSub>DrawArc,Dialog1.Panel1.Handle,160,3,-30,-30,430,430,-30,-30,-30,-30
If>NewColor={"NewColor"}
Let>newcolor=0
EndIf
GoSub>DrawArc,Dialog1.Panel1.Handle,20,newcolor,40,40,360,360,40,40,40,40
GoSub>Reflect
Wait>0.01
Goto>Loop
////////////////// End Process Loop //////////////////
////////////////// Start JRL's Draw Function Subs //////////////////
//Angle Usage:
//GoSub>Angle,Dialog,Object,Angle(in degrees),XStart,YStart,Length,PenSize,PenColor
//Requires Drawline subroutine
SRT>Angle
Let>DegreeAngle=Angle_var_3
Let>XStart=Angle_var_4
Let>Ystart=Angle_var_5
Let>LineLength=Angle_var_6
Let>RadAngle={%DegreeAngle%*(pi/180)}
Let>XEnd={trunc((cos(%RadAngle%))*%LineLength%)}
Let>YEnd={trunc((sin(%RadAngle%))*%LineLength%)}
Let>XEnd=%XEnd%+%XStart%
Let>YEnd=%YEnd%+%YStart%
GoSub>DrawLine,%Angle_var_1%.%Angle_var_2%.Handle,Angle_var_7,Angle_var_8,XStart,YStart,XEnd,YEnd
END>Angle
//DrawLine Usage:
//GoSub>DrawLine,WindowHandle,PenSize,PenColor,XStart,YStart,XEnd,YEnd
SRT>DrawLine
LibFunc>user32,GetDC,HDC,%DrawLine_var_1%
LibFunc>gdi32,CreatePen,Penres,0,%DrawLine_var_2%,%DrawLine_var_3%
LibFunc>gdi32,SelectObject,SOPres,hdc,Penres
Libfunc>gdi32,MoveToEx,mtres,HDC,%DrawLine_var_4%,%DrawLine_var_5%,0
LibFunc>gdi32,LineTo,ltres,hdc,%DrawLine_var_6%,%DrawLine_var_7%
LibFunc>gdi32,DeleteObject,DOres,Penres
LibFunc>user32,ReleaseDC,RDCres,HDC_1,HDC
END>DrawLine
//DrawArc Usage:
//GoSub>DrawArc,WindowHandle,PenSize,PenColor,ULXLoc,ULYLoc,LRXLoc,LRYLoc,SXLoc,SYLoc,EXLoc,EYLoc
SRT>DrawArc
LibFunc>user32,GetDC,HDC,%DrawArc_var_1%
LibFunc>gdi32,CreatePen,Penres,0,%DrawArc_var_2%,%DrawArc_var_3%
LibFunc>gdi32,SelectObject,SOPres,hdc,Penres
Libfunc>gdi32,Arc,ARCres,HDC,%DrawArc_var_4%,%DrawArc_var_5%,%DrawArc_var_6%,%DrawArc_var_7%,%DrawArc_var_8%,%DrawArc_var_9%,%DrawArc_var_10%,%DrawArc_var_11%
LibFunc>gdi32,DeleteObject,DOres,Penres
LibFunc>user32,ReleaseDC,RDCres,HDC_1,HDC
END>DrawArc
////////////////// End JRL's Draw Function Subs //////////////////
////////////////// Start Draw Clock Minute Tick Marks Sub //////////////////
SRT>Tick
Let>DegreeAngle=Tick_var_3
Let>XStart=Tick_var_4
Let>Ystart=Tick_var_5
Let>LineLength=Tick_var_6
Let>RadAngle={%DegreeAngle%*(pi/180)}
Let>XEnd={trunc((cos(%RadAngle%))*%LineLength%)}
Let>YEnd={trunc((sin(%RadAngle%))*%LineLength%)}
Let>XEnd=%XEnd%+%XStart%
Let>YEnd=%YEnd%+%YStart%
Let>AngleTest={%Tick_var_3% mod 5}
If>AngleTest=0
Let>Tick_var_7=%Tick_var_7%*4
Let>LineLength=%LineLength%-15
Else
Let>LineLength=%LineLength%-5
EndIf
Let>XNew={trunc((cos(%RadAngle%))*%LineLength%)}
Let>YNew={trunc((sin(%RadAngle%))*%LineLength%)}
Let>XNew=%XNew%+%XStart%
Let>YNew=%YNew%+%YStart%
GoSub>DrawLine,%Tick_var_1%.%Tick_var_2%.Handle,Tick_var_7,Tick_var_8,XNew,YNew,XEnd,YEnd
END>Tick
////////////////// End Draw Clock Minute Tick Marks Sub //////////////////
////////////////// Start Draw Clock Outside Frame Sub //////////////////
SRT>SetColor
Random>3,Hue
Random>5,step
If>{(%rednum%<%step%)or(%greennum%<%step%)or(%bluenum%<%step%)}
Let>Direction=1
EndIf
If>{(%rednum%>(255-%step%))or(%greennum%>(255-%step%))or(%bluenum%>(255-%step%))}
Let>Direction=0
EndIf
If>Direction=1
If>{(%Hue%=2) and (%rednum%<(255-%step%))}
Let>rednum=%rednum%+%step%
EndIf
If>{(%Hue%=1) and (%greennum%<(255-%step%))}
Let>greennum=%greennum%+%step%
EndIf
If>{(%Hue%=0) and (%bluenum%<(255-%step%))}
Let>bluenum=%bluenum%+%step%
EndIf
Else
If>{(%Hue%=2) and (%rednum%>(0+%step%))}
Let>rednum=%rednum%-%step%
EndIf
If>{(%Hue%=1) and (%greennum%>(0+%step%))}
Let>greennum=%greennum%-%step%
EndIf
If>{(%Hue%=0) and (%bluenum%>(0+%step%))}
Let>bluenum=%bluenum%-%step%
EndIf
EndIf
RGB>rednum,greennum,bluenum,newcolor
END>SetColor
////////////////// End Draw Clock Outside Frame Sub //////////////////
////////////////// Start Clock Projection Sub //////////////////
SRT>Reflect
Let>WIN_USEHANDLE=1
GetWindowSize>%Dialog2.handle%,WinX,WinY
GetWindowSize>%Dialog1.handle%,Win1X,Win1Y
Let>WIN_USEHANDLE=0
Add>Win1X,%OffSetX%
Add>Win1Y,%OffSetY%
LibFunc>Gdi32,StretchBlt,SBres,HDC2,0,0,WinX,WinY,HDC1,0,0,400,400,13369376
END>Reflect
////////////////// End Clock Projection Sub //////////////////
////////////////// Start Clock Menu Sub //////////////////
SRT>Ask
If>ClockMoveFlag=0
Let>AskFlag=1
GetCursorPos>CurX,CurY
Let>WIN_USEHANDLE=1
MoveWindow>Dialog3.Handle,CurX,CurY
Let>WIN_USEHANDLE=0
SetDialogProperty>Dialog2,,FormStyle,fsNormal
Show>Dialog3
SetDialogProperty>Dialog3,,AlphaBlendValue,255
EndIf
END>Ask
////////////////// End Clock Menu Sub //////////////////
////////////////// Start Clock Minimize Sub //////////////////
SRT>Minimizer
CloseDialog>Dialog3
Let>WIN_USEHANDLE=1
WindowAction>2,Dialog2.handle
Let>WIN_USEHANDLE=0
END>Minimizer
////////////////// End Clock Minimize Sub //////////////////
////////////////// Start Clock Resize Subs //////////////////
SRT>ReSizeClock
CloseDialog>Dialog3
LibFunc>User32,GetSystemMetrics,VScrWidth,78
LibFunc>User32,GetSystemMetrics,VScrHeight,79
LibFunc>User32,GetSystemMetrics,VScrLeft,76
LibFunc>User32,GetSystemMetrics,VScrTop,77
Let>WIN_USEHANDLE=1
ReSizeWindow>Dialog4.handle,VScrWidth,VScrHeight
MoveWindow>Dialog4.handle,VScrLeft,VScrTop
ReSizeWindow>Dialog4.Panel1.handle,VScrWidth,VScrHeight
MoveWindow>Dialog4.Panel1.handle,VScrLeft,VScrTop
Let>WIN_USEHANDLE=0
Show>Dialog4
END>ReSizeClock
SRT>DrawResizeCircle
Let>ClockResizeFlag=0
GetCursorPos>CurX,CurY
Label>RunResizeLoop
If>ClockResizeFlag=0
GetCursorPos>NextX,NextY
Let>RadiusX={abs(%CurX%-%NextX%)}
Let>RadiusY={abs(%CurY%-%NextY%)}
Let>Radius={round(sqrt((sqr(%RadiusX%))+(sqr(%RadiusY%))))}
SetDialogProperty>Dialog4,Label1,Caption,Radius
Let>ULXLoc=%CurX%-%Radius%
Let>ULYLoc=%CurY%-%Radius%
Let>LRXLoc=%CurX%+%Radius%
Let>LRYLoc=%CurY%+%Radius%
SetDialogProperty>Dialog4,Panel1,Caption,Radius
GoSub>DrawArc,Dialog4.Panel1.Handle,3,0,ULXLoc,ULYLoc,LRXLoc,LRYLoc,ULXLoc,ULYLoc,ULXLoc,ULYLoc
Goto>RunResizeLoop
EndIf
CloseDialog>Dialog4
Let>BoxSize={round(%radius%*400/170)}
Let>WIN_USEHANDLE=1
GetWindowPos>%Dialog2.handle%,d2WinX,d2WinY
ResizeWindow>%Dialog2.handle%,BoxSize,BoxSize
Let>WIN_USEHANDLE=0
GoSub>Reflect
Let>d2WinX={round(%CurX%-(200*(%radius%/170)))}
Let>d2WinY={round(%CurY%-(200*(%radius%/170)))}
Let>WIN_USEHANDLE=1
MoveWindow>%Dialog2.handle%,d2WinX,d2WinY
Let>WIN_USEHANDLE=0
Let>ClockResizeFlag=0
GoSub>ResetStayOnTop
END>DrawResizeCircle
SRT>StopDrawResizeCircle
Let>ClockResizeFlag=1
END>StopDrawResizeCircle
////////////////// End Clock Resize Subs //////////////////
////////////////// Start Clock Move Subs //////////////////
SRT>MoveClock
Wait>0.01
CloseDialog>Dialog3
If>AskFlag=1
Let>ClockMoveFlag=1
Let>AskFlag=0
EndIf
END>MoveClock
SRT>MoveTheClock
GetCursorPos>CurX,CurY
Let>WIN_USEHANDLE=1
GetWindowPos>Dialog2.handle,D2WinX,D2WinY
Let>WIN_USEHANDLE=0
Let>DiffWinX=%CurX%-%D2WinX%
Let>DiffWinY=%CurY%-%D2WinY%
Label>MoveClockMore
If>ClockMoveFlag=1
GetCursorPos>CurX,CurY
Let>D2WinX=%CurX%-%DiffWinX%
Let>D2WinY=%CurY%-%DiffWinY%
Let>WIN_USEHANDLE=1
MoveWindow>Dialog2.handle,D2WinX,D2WinY
Let>WIN_USEHANDLE=0
Goto>MoveClockMore
Else
EndIf
END>MoveTheClock
SRT>StopMoveTheClock
If>AskFlag=0
Let>ClockMoveFlag=0
GoSub>ResetStayOnTop
EndIf
END>StopMoveTheClock
////////////////// End Clock Move Subs //////////////////
////////////////// Start StayOnTop Subs //////////////////
SRT>OnTopClock
CloseDialog>Dialog3
If>StayOnTopFlag=0
Let>StayOnTopFlag=1
SetDialogProperty>Dialog3,Panel4,Caption,Remove From Top Z
SetDialogProperty>Dialog2,,FormStyle,fsStayOnTop
Else
Let>StayOnTopFlag=0
SetDialogProperty>Dialog3,Panel4,Caption,Stay-on-Top
SetDialogProperty>Dialog2,,FormStyle,fsNormal
EndIf
END>OnTopClock
SRT>ResetStayOnTop
If>StayOnTopFlag=1
SetDialogProperty>Dialog2,,FormStyle,fsStayOnTop
Else
SetDialogProperty>Dialog2,,FormStyle,fsNormal
EndIf
END>ResetStayOnTop
////////////////// End StayOnTop Subs //////////////////
SRT>CloseClock
CloseDialog>Dialog2
END>CloseClock
SRT>CloseMenu
CloseDialog>Dialog3
GoSub>ResetStayOnTop
END>CloseMenu
SRT>Quit
Let>WIN_USEHANDLE=1
GetWindowPos>Dialog2.Handle,D2WinX,D2WinY
GetWindowSize>Dialog2.Handle,D2WinW,D2WinH
Let>WIN_USEHANDLE=0
LibFunc>user32,ReleaseDC,RDCres1,HDC1_1,HDC1
LibFunc>user32,ReleaseDC,RDCres1,HDC2_1,HDC2
LibFunc>GDI32,DeleteObject,DOres,LIres
IfFileExists>%temp_dir%JRLClockSettings.ini
Else
WriteLn>%temp_dir%JRLClockSettings.ini,wres,
EndIf
EditIniFile>%temp_dir%JRLClockSettings.ini,Settings,Xposition,D2WinX
EditIniFile>%temp_dir%JRLClockSettings.ini,Settings,Yposition,D2WinY
EditIniFile>%temp_dir%JRLClockSettings.ini,Settings,Width,D2WinW
EditIniFile>%temp_dir%JRLClockSettings.ini,Settings,Height,D2WinH
Exit>0
END>Quit