home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 5_2007-2008.ISO / data / Zips / Slide_Show20372412122006.psc / Form1.frm < prev    next >
Text File  |  2006-12-12  |  18KB  |  729 lines

  1. VERSION 5.00
  2. Begin VB.Form Form1 
  3.    ClientHeight    =   3615
  4.    ClientLeft      =   165
  5.    ClientTop       =   555
  6.    ClientWidth     =   4815
  7.    Icon            =   "Form1.frx":0000
  8.    LinkTopic       =   "Form1"
  9.    MinButton       =   0   'False
  10.    Picture         =   "Form1.frx":164A
  11.    ScaleHeight     =   241
  12.    ScaleMode       =   3  'Pixel
  13.    ScaleWidth      =   321
  14.    StartUpPosition =   2  'CenterScreen
  15.    Begin VB.PictureBox Picture2 
  16.       Appearance      =   0  'Flat
  17.       AutoRedraw      =   -1  'True
  18.       AutoSize        =   -1  'True
  19.       BackColor       =   &H80000005&
  20.       BorderStyle     =   0  'None
  21.       ForeColor       =   &H80000008&
  22.       Height          =   1380
  23.       Left            =   1215
  24.       ScaleHeight     =   92
  25.       ScaleMode       =   3  'Pixel
  26.       ScaleWidth      =   56
  27.       TabIndex        =   2
  28.       Top             =   4200
  29.       Visible         =   0   'False
  30.       Width           =   840
  31.    End
  32.    Begin VB.Timer Timer3 
  33.       Left            =   285
  34.       Top             =   5730
  35.    End
  36.    Begin VB.Timer Timer2 
  37.       Enabled         =   0   'False
  38.       Interval        =   100
  39.       Left            =   300
  40.       Top             =   5100
  41.    End
  42.    Begin VB.ListBox List1 
  43.       Height          =   1035
  44.       Left            =   2235
  45.       TabIndex        =   1
  46.       Top             =   4305
  47.       Visible         =   0   'False
  48.       Width           =   840
  49.    End
  50.    Begin VB.Timer Timer1 
  51.       Enabled         =   0   'False
  52.       Interval        =   1000
  53.       Left            =   285
  54.       Top             =   4500
  55.    End
  56.    Begin VB.PictureBox Picture1 
  57.       Appearance      =   0  'Flat
  58.       AutoRedraw      =   -1  'True
  59.       AutoSize        =   -1  'True
  60.       BackColor       =   &H80000005&
  61.       BorderStyle     =   0  'None
  62.       ForeColor       =   &H80000008&
  63.       Height          =   1380
  64.       Left            =   3225
  65.       ScaleHeight     =   92
  66.       ScaleMode       =   3  'Pixel
  67.       ScaleWidth      =   56
  68.       TabIndex        =   0
  69.       Top             =   4155
  70.       Visible         =   0   'False
  71.       Width           =   840
  72.    End
  73.    Begin VB.Menu Files 
  74.       Caption         =   "Files"
  75.       Begin VB.Menu Files_path 
  76.          Caption         =   "Set Directory"
  77.       End
  78.       Begin VB.Menu Exit 
  79.          Caption         =   "Exit"
  80.       End
  81.    End
  82.    Begin VB.Menu Options 
  83.       Caption         =   "Options"
  84.       Begin VB.Menu Set_interval 
  85.          Caption         =   "Set Interval"
  86.       End
  87.       Begin VB.Menu Aspect_rate 
  88.          Caption         =   "Mantain aspect rate"
  89.       End
  90.       Begin VB.Menu Fullscreen 
  91.          Caption         =   "Full Screen (Double Click)"
  92.       End
  93.    End
  94.    Begin VB.Menu Transition_Type 
  95.       Caption         =   "Transition Type"
  96.       Begin VB.Menu opt 
  97.          Caption         =   "Fade"
  98.          Index           =   0
  99.       End
  100.       Begin VB.Menu opt 
  101.          Caption         =   "Circle IN"
  102.          Index           =   1
  103.       End
  104.       Begin VB.Menu opt 
  105.          Caption         =   "Circle OUT"
  106.          Index           =   2
  107.       End
  108.       Begin VB.Menu opt 
  109.          Caption         =   "Implode"
  110.          Index           =   3
  111.       End
  112.       Begin VB.Menu opt 
  113.          Caption         =   "Hour Double"
  114.          Index           =   4
  115.       End
  116.       Begin VB.Menu opt 
  117.          Caption         =   "Close"
  118.          Index           =   5
  119.       End
  120.       Begin VB.Menu opt 
  121.          Caption         =   "-"
  122.          Index           =   9
  123.       End
  124.       Begin VB.Menu opt 
  125.          Caption         =   "Random"
  126.          Index           =   10
  127.       End
  128.    End
  129. End
  130. Attribute VB_Name = "Form1"
  131. Attribute VB_GlobalNameSpace = False
  132. Attribute VB_Creatable = False
  133. Attribute VB_PredeclaredId = True
  134. Attribute VB_Exposed = False
  135. 'ATTENTION ! This program uses SAVESETTING to Registry preferences.
  136. 'if you don't want to use your System Registry, please find and remove the lines.
  137.  
  138. 'Credits to transitions procedures : Amiga Blitter
  139. 'http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=13409&lngWId=1
  140.  
  141. 'To use this program as SCREEN SAVER Compile the Executable using the .SCR extension and
  142. 'save it into Windows/System directorie
  143.  
  144.  
  145. Option Explicit
  146.  
  147. Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
  148. Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
  149.  
  150. Private Const SWP_HIDEWINDOW As Long = &H80
  151. Private Const SWP_SHOWWINDOW As Long = &H40
  152.  
  153. Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" _
  154.                           (ByVal hwnd As Long, ByVal nIndex As Long) As Long
  155. Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" _
  156.                           (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
  157.     
  158. Private Const SWP_FRAMECHANGED As Integer = &H20
  159. Private Const SWP_NOMOVE As Integer = &H2
  160. Private Const SWP_NOZORDER As Integer = &H4
  161. Private Const SWP_NOSIZE As Integer = &H1
  162.  
  163. Private Const WS_CAPTION = &HC00000
  164. Private Const GWL_STYLE As Long = (-16)
  165. Private Const GWL_EXSTYLE As Long = (-20)
  166.  
  167. Private Declare Function GetTickCount Lib "kernel32.dll" () As Long
  168.  
  169. Private Declare Function AlphaBlend Lib "msimg32.dll" (ByVal hDC As Long, ByVal lInt As Long, ByVal lInt As Long, ByVal lInt As Long, ByVal lInt As Long, ByVal hDC As Long, ByVal lInt As Long, ByVal lInt As Long, ByVal lInt As Long, ByVal lInt As Long, ByVal BLENDFUNCT As Long) As Long
  170.  
  171. Private Declare Function BitBlt Lib "GDI32" (ByVal hDestDC As Long, ByVal X _
  172.                           As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As _
  173.                           Long, ByVal hSrcDC As Long, ByVal XSrc As Long, ByVal YSrc As _
  174.                           Long, ByVal dwRop As Long) As Long
  175.  
  176. Private Declare Function SHGetPathFromIDList Lib "shell32.dll" Alias "SHGetPathFromIDListA" _
  177.                           (ByVal pidl As Long, ByVal pszPath As String) As Long
  178.  
  179. Private Declare Function SHBrowseForFolder Lib "shell32.dll" Alias "SHBrowseForFolderA" _
  180.                           (lpBrowseInfo As BROWSEINFO) As Long
  181.        
  182. Private Const BIF_RETURNONLYFSDIRS As Long = &H1
  183.  
  184. Private Trans_option As Integer
  185. Private Random_Set As Integer
  186. Private Path_target As String
  187. Private Actual_picture As Integer
  188. Private Pic_nr As Integer
  189.  
  190. Private Type BLENDFUNCTION
  191.     BlendOp As Byte
  192.     BlendFlags As Byte
  193.     SourceConstantAlpha As Byte
  194.     AlphaFormat As Byte
  195. End Type
  196.  
  197. Private Type SHITEMID
  198.     cb As Long
  199.     abID As Byte
  200. End Type
  201.  
  202. Private Type ITEMIDLIST
  203.     mkid As SHITEMID
  204. End Type
  205.  
  206. Private Type BROWSEINFO
  207.     hOwner As Long
  208.     pidlRoot As Long
  209.     pszDisplayName As String
  210.     lpszTitle As String
  211.     ulFlags As Long
  212.     lpfn As Long
  213.     lParam As Long
  214.     iImage As Long
  215. End Type
  216.  
  217. Private BF As BLENDFUNCTION
  218.  
  219. Private Sub Aspect_rate_Click()
  220.  
  221.     Aspect_rate.Checked = Not Aspect_rate.Checked
  222.     SaveSetting "AGR Slide Show", "Options", "Aspect", Aspect_rate.Checked
  223.     
  224. End Sub
  225.  
  226. Private Sub Exit_Click()
  227.  
  228.     Unload Me
  229.  
  230. End Sub
  231.  
  232. Public Sub Files_path_Click()
  233.  
  234.   Dim bi As BROWSEINFO
  235.   Dim IDL As ITEMIDLIST
  236.   Dim pidl As Long
  237.   Dim r As Long
  238.   Dim pos As Integer
  239.   Dim spath As String
  240.   
  241.     bi.hOwner = Me.hwnd
  242.        
  243.     bi.pidlRoot = 0&
  244.        
  245.     bi.lpszTitle = "Select one Folder with Graphic files"
  246.        
  247.     bi.ulFlags = BIF_RETURNONLYFSDIRS
  248.        
  249.     pidl& = SHBrowseForFolder(bi)
  250.        
  251.     spath$ = Space$(512)
  252.        
  253.     r = SHGetPathFromIDList(ByVal pidl&, ByVal spath$)
  254.  
  255.     If r Then
  256.         pos = InStr(spath$, Chr$(0))
  257.         Path_target = Left$(spath$, pos - 1)
  258.         If Right$(Path_target, 1) = "\" Then
  259.             Path_target = Left$(Path_target, Len(Path_target) - 1)
  260.         End If
  261.       Else
  262.         Exit Sub
  263.     End If
  264.     
  265.     SaveSetting "AGR Slide Show", "Folder", "Path", Path_target
  266.     
  267.     Do_list
  268.               
  269. End Sub
  270.  
  271. Private Sub Form_Click()
  272.  
  273.     If Fullscreen.Checked Then
  274.         Form_DblClick
  275.     End If
  276.  
  277. End Sub
  278.  
  279. Public Sub Form_DblClick()
  280.  
  281.   Static X As Integer
  282.   Dim rtn As Long
  283.   Static w As Integer
  284.   Static h As Integer
  285.   Static l As Integer
  286.   Static t As Integer
  287.  
  288.     Call fFlipBit(WS_CAPTION, X)
  289.     X = X Xor 1
  290.  
  291.     If X Then
  292.         Fullscreen.Checked = True
  293.         WindowState = 0
  294.         rtn = FindWindow("Shell_traywnd", "")
  295.         'Call SetWindowPos(rtn, 0, 0, 0, 0, 0, SWP_HIDEWINDOW)
  296.         w = Width
  297.         h = Height
  298.         l = Left
  299.         t = Top
  300.         Move 0, 0, Screen.Width, Screen.Height
  301.     
  302.       Else
  303.         Fullscreen.Checked = False
  304.         rtn = FindWindow("Shell_traywnd", "")
  305.         'Call SetWindowPos(rtn, 0, 0, 0, 0, 0, SWP_SHOWWINDOW) 'show the Taskbar
  306.         Move l, t, w, h
  307.     End If
  308.  
  309.     Files.Visible = (X = 0)
  310.     Options.Visible = (X = 0)
  311.     Transition_Type.Visible = (X = 0)
  312.  
  313. End Sub
  314.  
  315. Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
  316.  
  317.     If Screensaver Then
  318.         Unload Me
  319.     End If
  320.   
  321. End Sub
  322.  
  323. Private Sub Form_Load()
  324.  
  325.     Randomize
  326.     Path_target = GetSetting("AGR Slide Show", "Folder", "Path", App.Path)
  327.     Trans_option = GetSetting("AGR Slide Show", "Transition", "Type", 0)
  328.     Random_Set = (Trans_option = 10)
  329.     Aspect_rate.Checked = GetSetting("AGR Slide Show", "Options", "Aspect", -1)
  330.  
  331.     Form2.VScroll1.value = GetSetting("AGR Slide Show", "Options", "Load Interval", -100)
  332.     Form2.VScroll2.value = GetSetting("AGR Slide Show", "Options", "Fade Interval", -10)
  333.  
  334.     Do_list
  335.  
  336. End Sub
  337.  
  338. Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  339.  
  340.   Static Xlast As Single, Ylast As Single
  341.   Dim Xnow As Single
  342.   Dim Ynow As Single
  343.  
  344.     If Not Screensaver Then
  345.         Exit Sub
  346.     End If
  347.  
  348.     Xnow = X
  349.     Ynow = Y
  350.     If Xlast = 0 And Ylast = 0 Then
  351.         Xlast = Xnow
  352.         Ylast = Ynow
  353.     End If
  354.     If (Xnow <> Xlast Or Ynow <> Ylast) Then
  355.         Unload Me
  356.     End If
  357.   
  358. End Sub
  359.  
  360. Private Sub Form_Unload(Cancel As Integer)
  361.     
  362.     Unload Form2
  363.     End
  364.  
  365. End Sub
  366.  
  367. Private Sub Fullscreen_Click()
  368.  
  369.     Form_DblClick
  370.  
  371. End Sub
  372.  
  373. Private Sub Opt_Click(Index As Integer)
  374.  
  375.     Trans_option = Index
  376.     Random_Set = (Index = 10)
  377.     SaveSetting "AGR Slide Show", "Transition", "Type", Trans_option
  378.     
  379. End Sub
  380.  
  381. Private Sub Set_interval_Click()
  382.  
  383.     Form2.Show 1
  384.  
  385. End Sub
  386.  
  387. Private Sub Timer1_Timer()
  388.  
  389.   Dim i As Double
  390.   Dim w As Single
  391.   Dim h As Single
  392.  
  393.     On Error GoTo erro
  394.     
  395.     Timer1.Enabled = False
  396.  
  397.     DoEvents
  398.  
  399.     If Pic_nr = List1.ListCount Then
  400.         Pic_nr = 0
  401.     End If
  402.     
  403.     'Caption = Str(Pic_nr + 1) & " /" & Str(List1.ListCount)
  404.     
  405.     Picture1.Picture = LoadPicture(Path_target & "\" & List1.List(Pic_nr))
  406.     
  407.     Picture2.BackColor = Picture1.Point(0, 0)
  408.     Picture2.Width = ScaleWidth
  409.     Picture2.Height = ScaleHeight
  410.     
  411.     Picture2.Cls
  412.     
  413.     If Aspect_rate.Checked Then
  414.         w = Picture1.ScaleWidth
  415.         h = Picture1.ScaleHeight
  416.         Do While (h < ScaleHeight) Or (w < ScaleWidth)
  417.             w = w + w / 100
  418.             h = h + h / 100
  419.             DoEvents
  420.         Loop
  421.         
  422.         Do While (h > ScaleHeight) Or (w > ScaleWidth)
  423.             w = w - w / 100
  424.             h = h - h / 100
  425.             DoEvents
  426.         Loop
  427.         
  428.         Picture2.PaintPicture Picture1.Picture, (ScaleWidth - w) / 2, (ScaleHeight - h) / 2, w, h
  429.         
  430.       Else
  431.         Picture2.PaintPicture Picture1.Picture, 0, 0, ScaleWidth, ScaleHeight, 0, 0, Picture1.ScaleWidth, Picture1.ScaleHeight
  432.     End If
  433.     
  434.     Picture2.Refresh
  435.     
  436.     If List1.ListCount = 0 Then
  437.         Exit Sub
  438.     End If
  439.     
  440.     If Random_Set Then
  441.         Trans_option = Int(Rnd * 6)
  442.     End If
  443.     
  444.     Pic_nr = Pic_nr + 1
  445.     Select Case Trans_option
  446.       Case 0
  447.         Timer2.Enabled = True
  448.       Case 1, 2
  449.         Do_trans_Circle
  450.       Case 3
  451.         Implode
  452.       Case 4
  453.         HourDblCB
  454.       Case 5
  455.         CloseOpt
  456.       Case 10
  457.     
  458.     End Select
  459.     
  460. Exit_fade:
  461.  
  462. Exit Sub
  463.     
  464. erro:
  465.     Resume Exit_fade
  466.  
  467. End Sub
  468.  
  469. Private Sub Timer2_Timer()
  470.  
  471.   Static i As Integer
  472.     
  473.     DoEvents
  474.     AlphaBlend hDC, 0, 0, ScaleWidth, ScaleHeight, Picture2.hDC, 0, 0, Picture2.ScaleWidth, Picture2.ScaleHeight, i * 65536
  475.     If i = 64 Then
  476.         i = 0
  477.         Timer2.Enabled = False
  478.         Timer1.Enabled = True
  479.     End If
  480.     i = i + 2
  481.  
  482. End Sub
  483.  
  484. Private Sub Do_trans_Circle()
  485.  
  486.   Const PI = 3.1415
  487.   Dim ray As Single
  488.   Dim angle As Double
  489.   Dim i As Integer
  490.   Dim X As Single
  491.   Dim Y As Single
  492.  
  493.     DoEvents
  494.     ray = Sqr(Picture2.ScaleHeight ^ 2 + Picture2.ScaleWidth ^ 2) / 2
  495.  
  496.     If Trans_option = 1 Then
  497.         For i = ray To 0 Step -2
  498.             For angle = 0 To 2 * PI Step 0.01
  499.                 X = i * Cos(angle) + (ScaleWidth / 2)
  500.                 Y = i * Sin(angle) + (ScaleHeight / 2)
  501.                 BitBlt hDC, X, Y, 8, 8, Picture2.hDC, X, Y, vbSrcCopy
  502.             Next angle
  503.         Next i
  504.  
  505.       Else
  506.     
  507.         For i = 0 To ray Step 2
  508.             For angle = 0 To 2 * PI Step 0.01
  509.                 X = i * Cos(angle) + (ScaleWidth / 2)
  510.                 Y = i * Sin(angle) + (ScaleHeight / 2)
  511.                 BitBlt hDC, X, Y, 8, 8, Picture2.hDC, X, Y, vbSrcCopy
  512.             Next angle
  513.         Next i
  514.     End If
  515.  
  516.     Timer1.Enabled = True
  517.  
  518. End Sub
  519.  
  520. Private Sub Implode()
  521.  
  522.   Const PI = 3.1415
  523.   Dim i As Integer
  524.   Dim ray As Single
  525.   Dim angle As Double
  526.   Dim X As Single
  527.   Dim Y As Single
  528.     
  529.     On Error GoTo erro
  530.     
  531.     DoEvents
  532.     ray = Sqr(Picture2.ScaleHeight ^ 2 + Picture2.ScaleWidth ^ 2) / 2
  533.     For i = ray To 0 Step -5
  534.         For angle = 0 To 5 * PI Step 0.01
  535.             X = i * Tan(angle) + (ScaleWidth / 2)
  536.             Y = i * Cos(angle) + (ScaleHeight / 2)
  537.             BitBlt hDC, X, Y, 16, 16, Picture2.hDC, X, Y, vbSrcCopy
  538.             DoEvents
  539.         Next angle
  540.     Next i
  541. sair:
  542.     Timer1.Enabled = True
  543.  
  544. Exit Sub
  545.  
  546. erro:
  547.     Resume sair
  548.  
  549. End Sub
  550.  
  551. Private Sub HourDblCB()
  552.  
  553.   Const PI = 3.1415
  554.   Dim ray As Single
  555.   Dim angle As Double
  556.   Dim a As Double
  557.   Dim b As Double
  558.   Dim c As Double
  559.   Dim X As Double
  560.   Dim Y As Double
  561.  
  562.     On Error GoTo erro
  563.  
  564.     DoEvents
  565.  
  566.     For angle = 0 To 2 * PI Step 0.01
  567.         a = Tan(angle)
  568.         b = Cos(angle)
  569.         c = Sin(angle)
  570.         If Abs(a * (ScaleWidth / 2)) < (ScaleHeight / 2) Then
  571.             For X = -0.5 * (1 + Sgn(b)) * (ScaleWidth / 2) To 0.5 * (1 + Sgn(b)) * (ScaleWidth / 2) Step Sgn(b)
  572.                 BitBlt hDC, (ScaleWidth / 2) + X, (ScaleHeight / 2) + a * X, 8, 8, Picture2.hDC, _
  573.                        (ScaleWidth / 2) + X, (ScaleHeight / 2) + a * X, vbSrcCopy
  574.                 DoEvents
  575.             Next X
  576.           Else
  577.             For Y = -1 * (1 + Sgn(c)) * (ScaleWidth / 2) To 1 * (1 + Sgn(c)) * (ScaleWidth / 2) Step Sgn(c)
  578.                 BitBlt hDC, (ScaleWidth / 2) + Y / a, (ScaleHeight / 2) + Y, 8, 8, Picture2.hDC, _
  579.                        (ScaleWidth / 2) + Y / a, (ScaleHeight / 2) + Y, vbSrcCopy
  580.                 DoEvents
  581.             Next Y
  582.         End If
  583.     Next angle
  584. sair:
  585.     Timer1.Enabled = True
  586.     
  587. Exit Sub
  588.  
  589. erro:
  590.     Resume sair
  591.  
  592. End Sub
  593.  
  594. Private Sub CloseOpt()
  595.  
  596.   Dim ImgX As Integer
  597.   Dim ImgY As Integer
  598.   Dim NumLoop As Integer
  599.   Dim HalfHeight As Integer
  600.   Dim i As Integer
  601.   Dim X As Double
  602.   Dim Y As Double
  603.  
  604.     On Error GoTo erro
  605.  
  606.     ImgX = ScaleWidth
  607.     ImgY = ScaleHeight
  608.     HalfHeight = ImgY / 2
  609.  
  610.     For i = 0 To HalfHeight + 5 Step 5
  611.         Y = i
  612.         For X = i To ImgX - i
  613.             BitBlt hDC, X, Y, 5, 5, Picture2.hDC, X, Y, vbSrcCopy
  614.             DoEvents
  615.         Next X
  616.     
  617.         Wait (5)
  618.     
  619.         X = ImgX - i
  620.         For Y = i To ImgY - i
  621.             BitBlt hDC, X, Y, 5, 5, Picture2.hDC, X, Y, vbSrcCopy
  622.             DoEvents
  623.         Next Y
  624.         Wait (5)
  625.         Y = ImgY - i
  626.         For X = ImgX - i To i Step -5
  627.             BitBlt hDC, X, Y, 5, 5, Picture2.hDC, X, Y, vbSrcCopy
  628.             DoEvents
  629.         Next X
  630.         Wait (5)
  631.         X = i
  632.         For Y = ImgY - i To i Step -5
  633.             BitBlt hDC&, X, Y, 5, 5, Picture2.hDC, X, Y, vbSrcCopy
  634.             DoEvents
  635.         Next Y
  636.         Wait (5)
  637.         DoEvents
  638.     Next i
  639.  
  640. sair:
  641.     Timer1.Enabled = True
  642.  
  643. Exit Sub
  644.  
  645. erro:
  646.     Resume sair
  647.  
  648. End Sub
  649.  
  650. Private Function Wait(ByVal TimeToWait As Long)
  651.  
  652.   Dim EndTime As Long
  653.  
  654.     EndTime = GetTickCount + TimeToWait
  655.  
  656.     Do Until GetTickCount > EndTime
  657.         DoEvents
  658.     Loop
  659.  
  660. End Function
  661.  
  662. Private Function fFlipBit(ByVal Bit As Long, ByVal value As Boolean) As Boolean
  663.  
  664.   Dim lStyle As Long
  665.    
  666.     lStyle = GetWindowLong(Me.hwnd, GWL_STYLE)
  667.    
  668.     If value Then
  669.         lStyle = lStyle Or Bit
  670.       Else
  671.         lStyle = lStyle And Not Bit
  672.     End If
  673.     Call SetWindowLong(Me.hwnd, GWL_STYLE, lStyle)
  674.     Call pRedraw
  675.    
  676.     fFlipBit = (lStyle = GetWindowLong(Me.hwnd, GWL_STYLE))
  677.  
  678. End Function
  679.  
  680. Private Sub pRedraw()
  681.  
  682.   
  683.   
  684.   Const swpFlags As Long = SWP_FRAMECHANGED Or SWP_NOMOVE Or SWP_NOZORDER Or SWP_NOSIZE
  685.  
  686.     Call SetWindowPos(Me.hwnd, 0, 0, 0, 0, 0, swpFlags)
  687.  
  688. End Sub
  689.  
  690. Private Sub Do_list()
  691.  
  692.   Dim X As String
  693.  
  694.     List1.Clear
  695.     Timer1.Enabled = False
  696.     Pic_nr = 0
  697.     X = Dir$(Path_target & "\*.jpg")
  698.     Do While X <> ""
  699.         List1.AddItem X
  700.         DoEvents
  701.         X = Dir
  702.     Loop
  703.            
  704.     X = Dir$(Path_target & "\*.bmp")
  705.     Do While X <> ""
  706.         List1.AddItem X
  707.         DoEvents
  708.         X = Dir
  709.     Loop
  710.     
  711.     X = Dir$(Path_target & "\*.gif")
  712.     Do While X <> ""
  713.         List1.AddItem X
  714.         DoEvents
  715.         X = Dir
  716.     Loop
  717.     
  718.     Actual_picture = 0
  719.     If List1.ListCount Then
  720.         Timer1.Enabled = True
  721.         Caption = ""
  722.       Else
  723.         Timer1.Enabled = False
  724.         Caption = "Folder without picture"
  725.     End If
  726.  
  727. End Sub
  728.  
  729.