Guidance
指路人
g.yi.org
software / rapidq / Examples / Graphics & Animation / Screen Saver / screen saver.bas

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
'===========================================================================
' Subject: SCREEN SAVER EXAMPLE              Date: 10-25-99 (13:36)
' Author:  Erlend Rovik                      Code: RAPIDQ
' Origin:  e-rovik@online.no               Packet: RAPIDQ.ABC
'===========================================================================
'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
掌柜推荐
 
 
¥289.00 ·
 
 
¥1,080.00 ·
 
 
¥1,380.00 ·
 
 
¥638.00 ·
 
 
¥1,290.00 ·
 
 
¥1,420.00 ·
© Sun 2024-11-24  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2013-06-19 07:47:44