'ScreenSaverExample By Erlend Rovik (Preacher / Bizarre Designz) ' '/s as parameter for test screen '/c as parameter for configuration '/a as parameter for password '/p as parameter for preview screen ' 'The Preview screen is not working... '------------------------------------------------ $INCLUDE "RapidQ.Inc" $APPTYPE GUI $TYPECHECK ON Const SWP_NOMOVE = &H2 Const SWP_NOSIZE = &H1 Const TOPMOST = -1 Const NOTOPMOST = -2 Const FLAGS = SWP_NOMOVE Or SWP_NOSIZE DECLARE SUB Die Declare Function IsWindowVisible Lib "user32" Alias "IsWinVis" (hwnd As Long) As Long Declare Function SystemParametersInfo Lib "user32" _ Alias "SystemParametersInfoA" (uAction As Long, _ uParam As Long, lpvParam As Long, _ fuWinIni As Long) As Long Declare Function SetWindowPos Lib "user32" Alias "SetWindowPos" _ (hwnd As Long, hWndInsertAfter As Long, _ X As Long, Y As Long, cx As Long, _ cy As Long, wFlags As Long) As Long Declare Function SetParent Lib "user32" Alias "SetParent" _ (hWndChild As Long, hWndNewParent As Long) As Long DIM Form AS QForm Form.Width=Screen.Width Form.Height=Screen.Height Form.BorderStyle=bsNone Form.Cursor=crNone DIM Canv AS QCanvas Canv.Width=Form.ClientWidth Canv.Height=Form.ClientHeight DIM Tim As QTimer Dim OldMouseX As Integer Dim OldMouseY As Integer Dim fc As Integer Dim OnTop as long SUB TDraw 'initianlize mouse coordinates. if fc=0 then OldMouseX=MouseX:OldMouseY=MouseY:fc=1 Canv.FillRect(0,0,Canv.Width,Canv.Height,0) end if 'Set Timer interval and draw something... Tim.Interval = 1 Canv.Rectangle(rnd(Canv.Width),rnd(Canv.Height),rnd(Canv.Width),rnd(Canv.Height),rnd(3000)) 'Check For Changes If MouseX<>OldMouseX or MouseY<>OldMouseY then Die End if OldMouseX=MouseX:OldMouseY=MouseY END SUB SUB Die Dim RetVal As Long OnTop = SetWindowPos(Form.Handle, TOPMOST, 0, 0, 0, 0, FLAGS) RetVal = SystemParametersInfo(97, False, True, 0&) Form.Close:END END SUB dim a$ as string dim retval as Long a$=Ucase$(Left$(Command$(1),2)) Select Case a$ Case "/S" RetVal = SystemParametersInfo(97, True, True, 0&) OnTop = SetWindowPos(Form.Handle, TOPMOST, 0, 0, 0, 0, FLAGS) Tim.Interval = 1 Tim.OnTimer = TDraw Canv.Parent = Form Canv.OnClick = Die Form.ShowModal Die Case "/C" ShowMessage("Configuration Here!!!") Die Case "/P" ' DIM Image AS QImage ' Image.Autosize = True ' Image.BMPHandle = PLAYBMP ' Image.Visible = True ' Dim PrevWin As Long ' Dim Temp As Long ' The CLng command dosent exist in rapidq.. ' PrevWin = CLng(command$(2)) ' Temp = SetParent(Image.BMPHandle, PrevWin) ' Image.Left = 0 ' Image.Top = 0 ' DoEvents ' Do While IsWinVis(PrevWin) <> 0 ' DoEvents ' Loop Die Case "/A" ShowMessage("Password Here!!!") Die End Select Die