home *** CD-ROM | disk | FTP | other *** search
/ Planet Source Code Jumbo …e CD Visual Basic 1 to 7 / 5_2007-2008.ISO / data / Zips / K15Puzzle2082839112007.psc / K15Puzzle / Form1.frm next >
Text File  |  2007-09-11  |  49KB  |  1,233 lines

  1. VERSION 5.00
  2. Begin VB.Form Form1 
  3.    BackColor       =   &H00FFFFFF&
  4.    BorderStyle     =   1  'Fixed Single
  5.    Caption         =   "K15Puzzle"
  6.    ClientHeight    =   5985
  7.    ClientLeft      =   690
  8.    ClientTop       =   855
  9.    ClientWidth     =   8955
  10.    Icon            =   "Form1.frx":0000
  11.    KeyPreview      =   -1  'True
  12.    LinkTopic       =   "Form1"
  13.    MaxButton       =   0   'False
  14.    ScaleHeight     =   5985
  15.    ScaleWidth      =   8955
  16.    Begin VB.Timer Timer4 
  17.       Enabled         =   0   'False
  18.       Left            =   8070
  19.       Top             =   5190
  20.    End
  21.    Begin VB.CheckBox Check2 
  22.       Appearance      =   0  'Flat
  23.       BackColor       =   &H80000005&
  24.       Caption         =   "Hide image"
  25.       ForeColor       =   &H80000008&
  26.       Height          =   285
  27.       Left            =   180
  28.       TabIndex        =   11
  29.       Top             =   4860
  30.       Width           =   1995
  31.    End
  32.    Begin VB.Timer Timer7 
  33.       Enabled         =   0   'False
  34.       Interval        =   300
  35.       Left            =   5085
  36.       Top             =   3735
  37.    End
  38.    Begin VB.CheckBox Check1 
  39.       Appearance      =   0  'Flat
  40.       BackColor       =   &H80000005&
  41.       Caption         =   "Show number"
  42.       ForeColor       =   &H80000008&
  43.       Height          =   285
  44.       Left            =   180
  45.       TabIndex        =   10
  46.       Top             =   4545
  47.       Value           =   1  'Checked
  48.       Width           =   1995
  49.    End
  50.    Begin VB.Timer Timer3 
  51.       Enabled         =   0   'False
  52.       Interval        =   50
  53.       Left            =   5490
  54.       Top             =   3285
  55.    End
  56.    Begin VB.PictureBox Picture3 
  57.       AutoRedraw      =   -1  'True
  58.       BackColor       =   &H00C0C0C0&
  59.       BorderStyle     =   0  'None
  60.       Height          =   1050
  61.       Left            =   8820
  62.       ScaleHeight     =   70
  63.       ScaleMode       =   3  'Pixel
  64.       ScaleWidth      =   79
  65.       TabIndex        =   6
  66.       Top             =   3285
  67.       Visible         =   0   'False
  68.       Width           =   1185
  69.    End
  70.    Begin VB.PictureBox Picture2 
  71.       Appearance      =   0  'Flat
  72.       BackColor       =   &H80000005&
  73.       ForeColor       =   &H80000008&
  74.       Height          =   4980
  75.       Left            =   4500
  76.       MouseIcon       =   "Form1.frx":628A
  77.       MousePointer    =   99  'Custom
  78.       Picture         =   "Form1.frx":63DC
  79.       ScaleHeight     =   330
  80.       ScaleMode       =   3  'Pixel
  81.       ScaleWidth      =   421
  82.       TabIndex        =   5
  83.       ToolTipText     =   "click for change image"
  84.       Top             =   45
  85.       Width           =   6345
  86.       Begin VB.Image Image1 
  87.          Height          =   5010
  88.          Left            =   -30
  89.          Picture         =   "Form1.frx":249D1
  90.          Stretch         =   -1  'True
  91.          Top             =   0
  92.          Visible         =   0   'False
  93.          Width           =   6315
  94.       End
  95.    End
  96.    Begin VB.Timer Timer2 
  97.       Left            =   6885
  98.       Top             =   3285
  99.    End
  100.    Begin VB.Timer Timer1 
  101.       Enabled         =   0   'False
  102.       Interval        =   100
  103.       Left            =   5085
  104.       Top             =   4230
  105.    End
  106.    Begin VB.Frame Frame1 
  107.       BackColor       =   &H00FFFFFF&
  108.       BorderStyle     =   0  'None
  109.       Height          =   645
  110.       Left            =   2250
  111.       TabIndex        =   2
  112.       Top             =   4500
  113.       Width           =   1860
  114.       Begin VB.Shape Shape1 
  115.          Height          =   600
  116.          Left            =   45
  117.          Top             =   45
  118.          Width           =   1770
  119.       End
  120.       Begin VB.Label Label1 
  121.          AutoSize        =   -1  'True
  122.          BackStyle       =   0  'Transparent
  123.          Caption         =   "Time"
  124.          Height          =   210
  125.          Index           =   1
  126.          Left            =   90
  127.          TabIndex        =   4
  128.          Top             =   360
  129.          Width           =   345
  130.       End
  131.       Begin VB.Label Label1 
  132.          AutoSize        =   -1  'True
  133.          BackStyle       =   0  'Transparent
  134.          Caption         =   "Hit"
  135.          Height          =   210
  136.          Index           =   0
  137.          Left            =   90
  138.          TabIndex        =   3
  139.          Top             =   90
  140.          Width           =   195
  141.       End
  142.    End
  143.    Begin VB.PictureBox Picture1 
  144.       BackColor       =   &H00FFC0C0&
  145.       BorderStyle     =   0  'None
  146.       Height          =   3890
  147.       Left            =   45
  148.       ScaleHeight     =   3885
  149.       ScaleWidth      =   4155
  150.       TabIndex        =   0
  151.       Top             =   45
  152.       Width           =   4155
  153.       Begin VB.CommandButton Cmd 
  154.          BackColor       =   &H00FFFFC0&
  155.          Height          =   1050
  156.          Index           =   0
  157.          Left            =   90
  158.          Style           =   1  'Graphical
  159.          TabIndex        =   1
  160.          Top             =   45
  161.          Width           =   1050
  162.       End
  163.    End
  164.    Begin VB.Label Label2 
  165.       AutoSize        =   -1  'True
  166.       BackStyle       =   0  'Transparent
  167.       Caption         =   "Score"
  168.       BeginProperty Font 
  169.          Name            =   "Microsoft Sans Serif"
  170.          Size            =   8.25
  171.          Charset         =   222
  172.          Weight          =   400
  173.          Underline       =   0   'False
  174.          Italic          =   0   'False
  175.          Strikethrough   =   0   'False
  176.       EndProperty
  177.       ForeColor       =   &H00FFFFFF&
  178.       Height          =   195
  179.       Index           =   4
  180.       Left            =   6840
  181.       MouseIcon       =   "Form1.frx":42FC6
  182.       MousePointer    =   99  'Custom
  183.       TabIndex        =   13
  184.       Top             =   5490
  185.       Width           =   420
  186.    End
  187.    Begin VB.Label Label2 
  188.       AutoSize        =   -1  'True
  189.       BackStyle       =   0  'Transparent
  190.       Caption         =   "Help"
  191.       BeginProperty Font 
  192.          Name            =   "Microsoft Sans Serif"
  193.          Size            =   8.25
  194.          Charset         =   222
  195.          Weight          =   400
  196.          Underline       =   0   'False
  197.          Italic          =   0   'False
  198.          Strikethrough   =   0   'False
  199.       EndProperty
  200.       ForeColor       =   &H00FFFFFF&
  201.       Height          =   195
  202.       Index           =   3
  203.       Left            =   5355
  204.       MouseIcon       =   "Form1.frx":43118
  205.       MousePointer    =   99  'Custom
  206.       TabIndex        =   12
  207.       Top             =   5490
  208.       Width           =   330
  209.    End
  210.    Begin VB.Image ImagePicClick 
  211.       Height          =   570
  212.       Left            =   5040
  213.       MouseIcon       =   "Form1.frx":4326A
  214.       MousePointer    =   99  'Custom
  215.       Picture         =   "Form1.frx":433BC
  216.       Stretch         =   -1  'True
  217.       Top             =   2250
  218.       Visible         =   0   'False
  219.       Width           =   1635
  220.    End
  221.    Begin VB.Image ImagePicReal 
  222.       Height          =   570
  223.       Left            =   4680
  224.       MouseIcon       =   "Form1.frx":45116
  225.       MousePointer    =   99  'Custom
  226.       Picture         =   "Form1.frx":45268
  227.       Stretch         =   -1  'True
  228.       Top             =   1350
  229.       Visible         =   0   'False
  230.       Width           =   1635
  231.    End
  232.    Begin VB.Label Label2 
  233.       AutoSize        =   -1  'True
  234.       BackStyle       =   0  'Transparent
  235.       Caption         =   "Exit"
  236.       BeginProperty Font 
  237.          Name            =   "Microsoft Sans Serif"
  238.          Size            =   8.25
  239.          Charset         =   222
  240.          Weight          =   400
  241.          Underline       =   0   'False
  242.          Italic          =   0   'False
  243.          Strikethrough   =   0   'False
  244.       EndProperty
  245.       ForeColor       =   &H00FFFFFF&
  246.       Height          =   195
  247.       Index           =   2
  248.       Left            =   3375
  249.       MouseIcon       =   "Form1.frx":46F5F
  250.       MousePointer    =   99  'Custom
  251.       TabIndex        =   9
  252.       Top             =   5490
  253.       Width           =   255
  254.    End
  255.    Begin VB.Image Image3 
  256.       Height          =   570
  257.       Index           =   2
  258.       Left            =   2925
  259.       MouseIcon       =   "Form1.frx":470B1
  260.       MousePointer    =   99  'Custom
  261.       Picture         =   "Form1.frx":47203
  262.       Stretch         =   -1  'True
  263.       Top             =   5310
  264.       Width           =   1410
  265.    End
  266.    Begin VB.Label Label2 
  267.       AutoSize        =   -1  'True
  268.       BackStyle       =   0  'Transparent
  269.       Caption         =   "Change image"
  270.       BeginProperty Font 
  271.          Name            =   "Microsoft Sans Serif"
  272.          Size            =   8.25
  273.          Charset         =   222
  274.          Weight          =   400
  275.          Underline       =   0   'False
  276.          Italic          =   0   'False
  277.          Strikethrough   =   0   'False
  278.       EndProperty
  279.       ForeColor       =   &H00FFFFFF&
  280.       Height          =   195
  281.       Index           =   1
  282.       Left            =   1710
  283.       MouseIcon       =   "Form1.frx":48EFA
  284.       MousePointer    =   99  'Custom
  285.       TabIndex        =   8
  286.       Top             =   5490
  287.       Width           =   1020
  288.    End
  289.    Begin VB.Label Label2 
  290.       AutoSize        =   -1  'True
  291.       BackStyle       =   0  'Transparent
  292.       Caption         =   "Newgame"
  293.       BeginProperty Font 
  294.          Name            =   "Microsoft Sans Serif"
  295.          Size            =   8.25
  296.          Charset         =   222
  297.          Weight          =   400
  298.          Underline       =   0   'False
  299.          Italic          =   0   'False
  300.          Strikethrough   =   0   'False
  301.       EndProperty
  302.       ForeColor       =   &H00FFFFFF&
  303.       Height          =   195
  304.       Index           =   0
  305.       Left            =   300
  306.       MouseIcon       =   "Form1.frx":4904C
  307.       MousePointer    =   99  'Custom
  308.       TabIndex        =   7
  309.       Top             =   5490
  310.       Width           =   720
  311.    End
  312.    Begin VB.Image Image3 
  313.       Height          =   570
  314.       Index           =   0
  315.       Left            =   45
  316.       MouseIcon       =   "Form1.frx":4919E
  317.       MousePointer    =   99  'Custom
  318.       Picture         =   "Form1.frx":492F0
  319.       Stretch         =   -1  'True
  320.       Top             =   5310
  321.       Width           =   1410
  322.    End
  323.    Begin VB.Image Image3 
  324.       Height          =   570
  325.       Index           =   1
  326.       Left            =   1485
  327.       MouseIcon       =   "Form1.frx":4AFE7
  328.       MousePointer    =   99  'Custom
  329.       Picture         =   "Form1.frx":4B139
  330.       Stretch         =   -1  'True
  331.       Top             =   5310
  332.       Width           =   1410
  333.    End
  334.    Begin VB.Image Image3 
  335.       Height          =   570
  336.       Index           =   3
  337.       Left            =   4995
  338.       MouseIcon       =   "Form1.frx":4CE30
  339.       MousePointer    =   99  'Custom
  340.       Picture         =   "Form1.frx":4CF82
  341.       Stretch         =   -1  'True
  342.       Top             =   5310
  343.       Width           =   1410
  344.    End
  345.    Begin VB.Image Image3 
  346.       Height          =   570
  347.       Index           =   4
  348.       Left            =   6435
  349.       MouseIcon       =   "Form1.frx":4EC79
  350.       MousePointer    =   99  'Custom
  351.       Picture         =   "Form1.frx":4EDCB
  352.       Stretch         =   -1  'True
  353.       Top             =   5310
  354.       Width           =   1410
  355.    End
  356. End
  357. Attribute VB_Name = "Form1"
  358. Attribute VB_GlobalNameSpace = False
  359. Attribute VB_Creatable = False
  360. Attribute VB_PredeclaredId = True
  361. Attribute VB_Exposed = False
  362. Option Explicit
  363. Const ScrCopy = &HCC0020
  364. Const FormWidthNotShow = 4500
  365. Const FormWidthShow = 8985
  366. Private Declare Function StretchBlt Lib "gdi32" (ByVal hdc As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal nSrcWidth As Long, ByVal nSrcHeight As Long, ByVal dwRop As Long) As Long
  367. Private Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
  368. Dim Pindex As Integer
  369. Dim blnStatusBegin As Boolean
  370. Dim Hit As Integer
  371. Dim TiBe As Long
  372.  
  373. Public PicFileName As String
  374. Public blnChangePicture As Boolean
  375. Private Type POINTOak
  376.     X As Long
  377.     Y As Long
  378.     Width As Long
  379.     Height As Long
  380. End Type
  381.  
  382. Private Type R        ' For Row and Column
  383.       Row As Integer
  384.       Column As Integer
  385. End Type
  386. Private Type DetailAboutTable
  387.        CWidth As Single
  388.        CHeight As Single
  389.        NumPerRow As Integer
  390.        All As Integer
  391.        rBlank As R
  392.        rSim(1 To 4, 1 To 4) As R
  393.        ModePicture As Boolean
  394.        IsStart As Boolean
  395.        mustHaveNumberonCell As Boolean
  396. End Type
  397. Private Detail As DetailAboutTable
  398. Dim Ccount As Integer
  399. Private C(1 To 4, 1 To 4) As Object ' For each command
  400. Private Declare Function GetSystemMetrics Lib "User32" (ByVal nIndex As Long) As Long
  401. Const SM_CXSCREEN = 0 'X Size of screen
  402. Const SM_CYSCREEN = 1 'Y Size of Screen
  403. Const SM_CXVSCROLL = 2 'X Size of arrow in vertical scroll bar.
  404. Const SM_CYHSCROLL = 3 'Y Size of arrow in horizontal scroll bar
  405. Const SM_CYCAPTION = 4 'Height of windows caption
  406. Const SM_CXBORDER = 5 'Width of no-sizable borders
  407. Const SM_CYBORDER = 6 'Height of non-sizable borders
  408. Const SM_CXDLGFRAME = 7 'Width of dialog box borders
  409. Const SM_CYDLGFRAME = 8 'Height of dialog box borders
  410. Const SM_CYHTHUMB = 9 'Height of scroll box on horizontal scroll bar
  411. Const SM_CXHTHUMB = 10 ' Width of scroll box on horizontal scroll bar
  412. Const SM_CXICON = 11 'Width of standard icon
  413. Const SM_CYICON = 12 'Height of standard icon
  414. Const SM_CXCURSOR = 13 'Width of standard cursor
  415. Const SM_CYCURSOR = 14 'Height of standard cursor
  416. Const SM_CYMENU = 15 'Height of menu
  417. Const SM_CXFULLSCREEN = 16 'Width of client area of maximized window
  418. Const SM_CYFULLSCREEN = 17 'Height of client area of maximized window
  419. Const SM_CYKANJIWINDOW = 18 'Height of Kanji window
  420. Const SM_MOUSEPRESENT = 19 'True is a mouse is present
  421. Const SM_CYVSCROLL = 20 'Height of arrow in vertical scroll bar
  422. Const SM_CXHSCROLL = 21 'Width of arrow in vertical scroll bar
  423. Const SM_DEBUG = 22 'True if deugging version of windows is running
  424. Const SM_SWAPBUTTON = 23 'True if left and right buttons are swapped.
  425. Const SM_CXMIN = 28 'Minimum width of window
  426. Const SM_CYMIN = 29 'Minimum height of window
  427. Const SM_CXSIZE = 30 'Width of title bar bitmaps
  428. Const SM_CYSIZE = 31 'height of title bar bitmaps
  429. Const SM_CXMINTRACK = 34 'Minimum tracking width of window
  430. Const SM_CYMINTRACK = 35 'Minimum tracking height of window
  431. Const SM_CXDOUBLECLK = 36 'double click width
  432. Const SM_CYDOUBLECLK = 37 'double click height
  433. Const SM_CXICONSPACING = 38 'width between desktop icons
  434. Const SM_CYICONSPACING = 39 'height between desktop icons
  435. Const SM_MENUDROPALIGNMENT = 40 'Zero if popup menus are aligned to the left of the memu bar item. True if it is aligned to the right.
  436. Const SM_PENWINDOWS = 41 'The handle of the pen windows DLL if loaded.
  437. Const SM_DBCSENABLED = 42 'True if double byte characteds are enabled
  438. Const SM_CMOUSEBUTTONS = 43 'Number of mouse buttons.
  439. Const SM_CMETRICS = 44 'Number of system metrics
  440. Const SM_CLEANBOOT = 67 'Windows 95 boot mode. 0 = normal, 1 = safe, 2 = safe with network
  441. Const SM_CXMAXIMIZED = 61 'default width of win95 maximised window
  442. Const SM_CXMAXTRACK = 59 'maximum width when resizing win95 windows
  443. Const SM_CXMENUCHECK = 71 'width of menu checkmark bitmap
  444. Const SM_CXMENUSIZE = 54 'width of button on menu bar
  445. Const SM_CXMINIMIZED = 57 'width of rectangle into which minimised windows must fit.
  446. Const SM_CYMAXIMIZED = 62 'default height of win95 maximised window
  447. Const SM_CYMAXTRACK = 60 'maximum width when resizing win95 windows
  448. Const SM_CYMENUCHECK = 72 'height of menu checkmark bitmap
  449. Const SM_CYMENUSIZE = 55 'height of button on menu bar
  450. Const SM_CYMINIMIZED = 58 'height of rectangle into which minimised windows must fit.
  451. Const SM_CYSMCAPTION = 51 'height of windows 95 small caption
  452. Const SM_MIDEASTENABLED = 74 'Hebrw and Arabic enabled for windows 95
  453. Const SM_NETWORK = 63 'bit o is set if a network is present. Const SM_SECURE = 44 'True if security is present on windows 95 system
  454. Const SM_SLOWMACHINE = 73 'true if machine is too slow to run win95.
  455. Dim ArrayPositionRandom(1 To 49) As Integer
  456. Dim blnStatusNotFirstRun As Boolean
  457. Const HWND_TOPMOST = -1
  458. Const HWND_NOTOPMOST = -2
  459. Const SWP_NOSIZE = &H1
  460. Const SWP_NOMOVE = &H2
  461. Const SWP_NOACTIVATE = &H10
  462. Const SWP_SHOWWINDOW = &H40
  463. Private Declare Sub 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)
  464. Private Enum enumTimeDelay
  465.       Ti3 = 1
  466.       Ti4 = 2
  467.       Ti5 = 3
  468.       Ti6 = 4
  469.       Ti8 = 5
  470. End Enum
  471. Private Type TimeDalayType
  472.       TimerDelay As enumTimeDelay
  473.       InitiVal As Integer
  474. End Type
  475. Dim IsCanClick As Boolean
  476.  
  477.  
  478. Dim TimeDelay As TimeDalayType
  479.  
  480.  
  481. Private Function ConVertRealtoSim(Index As Integer) As R
  482. Dim TempR As R
  483. Dim i As Integer
  484. Dim j As Integer
  485.       TempR = ConvertToArray(Index)
  486.       For i = 1 To 4
  487.             For j = 1 To 4
  488.                               
  489.             Next j
  490.       Next i
  491. End Function
  492. Private Function ConvertToArray(Index As Integer) As R
  493. 'Purpose : For Convert 1 Dimension Array to 2 Dimension Array
  494. 'Accept : index of 1 Dimension
  495. 'Return :Column and Row of Varible type R
  496.  
  497.       Dim rTemp As R
  498.       '      List1.AddItem "Real   = " & i \ 4 + 1 & "          " & i Mod 4 + 1
  499.       '      List1.AddItem "Sim   = " & Detail.rSim(i \ 4 + 1, i Mod 4 + 1).Row & "      " & Detail.rSim(i \ 4 + 1, i Mod 4 + 1).Column
  500.       rTemp.Row = Index \ Detail.NumPerRow + 1
  501.       rTemp.Column = Index Mod Detail.NumPerRow + 1
  502.       ConvertToArray = rTemp
  503. End Function
  504. Private Sub MovePosition(Row As Integer, Col As Integer, Ob As R, Bla As R)
  505. 'Purpose : For Change Blank Position and Move Position
  506. 'Accept  :Row,Col of BlankPosition  and Position of Cmd to move by pass Ob
  507. 'Return : None
  508.       If Col = 0 And Row = 0 Then Exit Sub
  509.       If Col <> 0 Then
  510.             C(Ob.Row, Ob.Column).Left = (Col - 1) * C(1, 1).Width
  511.       End If
  512.       
  513.       If Row <> 0 Then
  514.             C(Ob.Row, Ob.Column).Top = (Row - 1) * C(1, 1).Height
  515.       End If
  516.       If Row <> 0 Or Col <> 0 Then
  517.             With Detail
  518.                   
  519.                   .rSim(Ob.Row, Ob.Column).Column = .rBlank.Column
  520.                   .rSim(Ob.Row, Ob.Column).Row = .rBlank.Row
  521. '                  List1.AddItem "Blank " & Bla.Row & "       " & Bla.Column
  522.                   
  523.                   
  524.                   .rBlank.Column = Bla.Column
  525.                   .rBlank.Row = Bla.Row
  526.             End With
  527.       End If
  528.       
  529. End Sub
  530.  
  531.  
  532.  
  533.  
  534.  
  535. Private Sub Check1_Click()
  536.       If Detail.mustHaveNumberonCell <> Check1.Value Then
  537.             Detail.mustHaveNumberonCell = Check1.Value
  538.             SetWindowPos Me.hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE Or SWP_SHOWWINDOW Or SWP_NOMOVE Or SWP_NOSIZE
  539.  
  540.             DrawPicture
  541.             Dim i As Integer
  542.  
  543.       End If
  544. End Sub
  545.  
  546. Private Sub Check2_Click()
  547.       If Check2.Value = 0 Then
  548.             Me.Width = FormWidthShow
  549.       Else
  550.             Me.Width = FormWidthNotShow
  551.       End If
  552. End Sub
  553.  
  554. Private Sub Cmd_GotFocus(Index As Integer)
  555.       'Timer3.Enabled = True
  556.       TimeDelay.TimerDelay = Ti3
  557.       Timer3.Interval = 50
  558.       Timer3.Enabled = True
  559.       
  560. End Sub
  561.  
  562. Private Sub Cmd_MouseDown(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
  563. Dim i As Integer
  564.                   If Button = vbRightButton Then Exit Sub
  565.                   If Not IsCanClick Then
  566.                             If MsgBox("Do you want to new game ?", vbOKCancel) = vbOK Then
  567.                             Image3_Click (0)
  568.                             
  569.                             End If
  570.                             Exit Sub
  571.                   End If
  572.                   
  573.             Dim blnStatusSel As Boolean
  574.             Dim rClick As R                          ' For Position of Cmd
  575.             Dim rTemp As R
  576.             Dim MoveRow As Integer          ' For Row To MOve
  577.             Dim MoveCol As Integer            ' For Col to Move
  578.             Hit = Hit + 1
  579.             Label1(0).Caption = "Hit            : " & Hit
  580.             
  581.             blnStatusSel = False
  582.             i = Index
  583.                        
  584.             'List1.Clear
  585.             'List1.SetFocus
  586.             rClick = ConvertToArray(i)
  587.             rTemp.Row = rClick.Row
  588.             rTemp.Column = rClick.Column
  589.             rClick.Row = Detail.rSim(rTemp.Row, rTemp.Column).Row
  590.             rClick.Column = Detail.rSim(rTemp.Row, rTemp.Column).Column
  591.             
  592.       
  593.       'List1.AddItem "Real   = " & i \ 4 + 1 & "          " & i Mod 4 + 1
  594.       'List1.AddItem "Sim   = " & Detail.rSim(i \ 4 + 1, i Mod 4 + 1).Row & "      " & Detail.rSim(i \ 4 + 1, i Mod 4 + 1).Column
  595.      
  596.       ' Check for BlankPosition ++++++++++++++++++++++
  597.       
  598.       With Detail
  599.       'List1.AddItem "Blank    " & .rBlank.Row & "      " & .rBlank.Column
  600.       'List1.AddItem "Click  " & rClick.Row & "       " & rClick.Column
  601.       Select Case .rBlank.Row
  602.             Case rClick.Row + 1 And rClick.Column = .rBlank.Column
  603.                   MoveRow = rClick.Row + 1
  604.                   blnStatusSel = True
  605.             Case rClick.Row - 1 And rClick.Column = .rBlank.Column
  606.                   MoveRow = rClick.Row - 1
  607.                   blnStatusSel = True
  608.             Case rClick.Row
  609.                   MoveRow = 0
  610.       End Select
  611.       If Not blnStatusSel Then
  612.             Select Case .rBlank.Column
  613.                   Case rClick.Column + 1 And rClick.Row = .rBlank.Row
  614.                         MoveCol = rClick.Column + 1
  615.                   Case rClick.Column - 1 And rClick.Row = .rBlank.Row
  616.                         MoveCol = rClick.Column - 1
  617.                   Case rClick.Column
  618.                         MoveCol = 0
  619.             End Select
  620.       End If
  621.       End With
  622.  
  623.       '++++++++++++ End Check ++++++++++++++++++++
  624.       MovePosition MoveRow, MoveCol, rTemp, rClick
  625.       If blnStatusBegin Then
  626.             If CheckWin Then
  627.  
  628.                   Timer1.Enabled = False
  629.                   SetWindowPos Me.hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE Or SWP_SHOWWINDOW Or SWP_NOMOVE Or SWP_NOSIZE
  630.                   IsCanClick = False
  631.                   
  632.                   Form4.NewScore = Format(Timer - TiBe, "##.00")
  633.                   Form4.Show vbModal
  634.                   SetWindowPos Me.hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE Or SWP_SHOWWINDOW Or SWP_NOMOVE Or SWP_NOSIZE
  635.                   
  636.             End If
  637.       
  638.       End If
  639.       
  640.       'Text1.Text = Text1.Text & Index
  641.       'If Val(Text2) <> 49 Then Text1.Text = Text1.Text & ", "
  642.       'Text2.Text = Val(Text2.Text) + 1
  643.       'If Text2.Text = 49 Then MsgBox 49
  644.       'Clipboard.SetText Text1.Text
  645. End Sub
  646.  
  647. Private Sub InitGame()
  648.       Dim i As Integer
  649.       Dim j As Integer
  650.       Dim rTemp As R
  651.    '   Text1.Text = ""
  652. '      Image1.Picture = Picture2.Picture
  653. '     Image2.Picture = LoadPicture("C:\WINDOWS\Desktop\Untitled-3Yub.jpg")
  654. '     MsgBox CheckCanMove
  655.       'Preare Data about Table
  656.                  Detail.All = 16
  657.                 Detail.CHeight = Form1.Cmd(0).Height
  658.                 Detail.CWidth = Form1.Cmd(0).Width
  659.                 Detail.NumPerRow = 4
  660.                 Detail.rBlank.Row = Detail.NumPerRow
  661.                 Detail.rBlank.Column = Detail.NumPerRow
  662.       '++++++ End Prepare +++++++++++++++++
  663.       
  664.       
  665.       
  666.       
  667.             'Cmd(0).Caption = 1
  668.             Set C(1, 1) = Cmd(0)
  669.             Cmd(0).Top = 0
  670.             Cmd(0).Left = 0
  671.         '    Check2.Value = 1
  672.  
  673.       For i = 1 To 15
  674.             If Not blnStatusNotFirstRun Then
  675.                   Load Cmd(i)
  676.             End If
  677.             Cmd(i).Left = Cmd(i - 1).Left + Cmd(i - 1).Width
  678.             Cmd(i).Top = Cmd(i - 1).Top
  679.             If i Mod 4 = 0 Then
  680.                   Cmd(i).Top = Cmd(i - 1).Top + Cmd(i - 1).Height
  681.                   Cmd(i).Left = Cmd(0).Left
  682.             End If
  683.             Cmd(i).Visible = True
  684.             'Cmd(i).Caption = i + 1
  685.             Cmd(i).Caption = ""
  686.             rTemp = ConvertToArray(i)
  687.             Set C(rTemp.Row, rTemp.Column) = Cmd(i)
  688.          '   List1.AddItem i \ 4 + 1 & "        " & i Mod 4 + 1
  689.       Next i
  690.       Cmd(15).Visible = False
  691.       Picture1.Height = Cmd(0).Height * 4 + 50
  692.       Picture1.Width = Cmd(0).Width * 4 + 50
  693.       
  694.       For i = 1 To 4
  695.             For j = 1 To 4
  696.                   Detail.rSim(i, j).Column = j
  697.                   Detail.rSim(i, j).Row = i
  698.             Next j
  699.       Next i
  700.       Detail.rBlank.Row = 4
  701.       Detail.rBlank.Column = 4
  702.       Me.Show
  703. '      Picture2.Width = Picture1.Width
  704.     '  MsgBox Picture1.Height & " " & Picture1.Width
  705.     
  706.      Picture2.Width = Picture1.Width
  707.      Picture2.Height = Picture1.Height
  708.      'Image1.Height = Picture2.Height
  709.      'Image1.Width = Picture2.Width
  710. '          MsgBox CheckCanMove
  711.   '    For i = 1 To 200
  712.   '          CheckCanMove
  713.   '    Next i
  714.   Timer4.Interval = 100
  715.   
  716.   Timer4.Enabled = True
  717. End Sub
  718.  
  719.  
  720.  
  721.  
  722.  
  723. Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
  724.       Dim blnStatusSel As Boolean
  725.       Dim i As Integer
  726.       If Detail.IsStart Then
  727.       Dim rClick As R                          ' For Position of Cmd
  728.       Dim rTemp As R
  729.       Dim MoveRow As Integer          ' For Row To MOve
  730.       Dim MoveCol As Integer            ' For Col to Move
  731.       'Hit = Hit + 1
  732.       'Label1(0).Caption = "Hit            : " & Hit
  733.       
  734.       blnStatusSel = False
  735.       'i = index
  736.                  
  737.       'List1.Clear
  738.       'List1.SetFocus
  739.       For i = 0 To 15
  740.             rClick = ConvertToArray(i)
  741.             If i = 10 Then
  742.                   Dim j  As Integer
  743.                   j = 3
  744.             End If
  745.             rTemp.Row = rClick.Row
  746.             rTemp.Column = rClick.Column
  747.             rClick.Row = Detail.rSim(rTemp.Row, rTemp.Column).Row
  748.             rClick.Column = Detail.rSim(rTemp.Row, rTemp.Column).Column
  749.             
  750.             With Detail
  751.       'List1.AddItem "Blank    " & .rBlank.Row & "      " & .rBlank.Column
  752.       'List1.AddItem "Click  " & rClick.Row & "       " & rClick.Column
  753.             Select Case .rBlank.Row
  754.                   Case rClick.Row + 1 And rClick.Column = .rBlank.Column And KeyCode = vbKeyDown
  755.                         MoveRow = rClick.Row + 1
  756.                         blnStatusSel = True
  757.                   Case rClick.Row - 1 And rClick.Column = .rBlank.Column And KeyCode = vbKeyUp
  758.                         MoveRow = rClick.Row - 1
  759.                         blnStatusSel = True
  760.                   Case rClick.Row
  761.                         MoveRow = 0
  762.             End Select
  763.             
  764.             If Not blnStatusSel Then
  765.                   Select Case .rBlank.Column
  766.                         Case rClick.Column + 1 And rClick.Row = .rBlank.Row And KeyCode = vbKeyRight
  767.                               MoveCol = rClick.Column + 1
  768.                               blnStatusSel = True
  769.                         Case rClick.Column - 1 And rClick.Row = .rBlank.Row And KeyCode = vbKeyLeft
  770.                               MoveCol = rClick.Column - 1
  771.                               blnStatusSel = True
  772.                         Case rClick.Column
  773.                               MoveCol = 0
  774.                   End Select
  775.             End If
  776.       End With
  777.             
  778.             If MoveRow <> 0 Or MoveCol <> 0 Then
  779.                   Exit For
  780.             End If
  781.       Next i
  782.       
  783.       
  784.       
  785.       'List1.AddItem "Real   = " & i \ 4 + 1 & "          " & i Mod 4 + 1
  786.       'List1.AddItem "Sim   = " & Detail.rSim(i \ 4 + 1, i Mod 4 + 1).Row & "      " & Detail.rSim(i \ 4 + 1, i Mod 4 + 1).Column
  787.      
  788.       ' Check for BlankPosition ++++++++++++++++++++++
  789.       
  790.       
  791.  
  792.       '++++++++++++ End Check ++++++++++++++++++++
  793.       'MovePosition MoveRow, MoveCol, rTemp, rClick
  794.       'If blnStatusBegin Then
  795.       '      If CheckWin Then
  796.       '            MsgBox "ñ╪│αíΦº┴╥í"
  797.       '      End If
  798.       
  799.       'End If
  800.       
  801.             'Select Case KeyCode
  802.             '      Case vbKeyLeft
  803.                                    
  804.             '      Case vbKeyRight
  805.             
  806.             '      Case vbKeyUp
  807.             
  808.             '      Case vbKeyDown
  809.             
  810.             'End Select
  811.             Me.blnChangePicture = True
  812.             
  813.             Label2_Click (1)
  814.             
  815.             If blnStatusSel Then
  816.                   Cmd_MouseDown i, vbLeftButton, 0, 1, 1
  817.             End If
  818.       End If
  819. End Sub
  820.  
  821. Private Sub Form_Load()
  822.       InitGame
  823.       'MsgBox CheckWin
  824.       blnStatusNotFirstRun = True
  825.       Dim i As Integer
  826.       Dim strTemp As String
  827.      ' For i = 21 To 49
  828.      '       'strTemp = strTemp & " Num" & i & " as Integer,"
  829.      '       'ArrayPositionRandom(20) = num20
  830.      '       strTemp = strTemp & "ArrayPositionRandom(" & i & ") = " & "Num" & i & vbCrLf
  831.      ' Next i
  832.      ' Clipboard.SetText strTemp
  833.     Me.Image1.Visible = True
  834. '    Label2_Click (0)
  835.     
  836.     
  837.      
  838.       
  839. End Sub
  840.  
  841. Private Sub Form_Resize()
  842.       Debug.Print Me.Width
  843. End Sub
  844.  
  845. Private Sub Form_Unload(Cancel As Integer)
  846.       Dim i As Integer
  847.       Dim j As Integer
  848.       ' Return Resource
  849.       For i = 1 To Detail.All - 1
  850.             Unload Cmd(i)
  851.       Next i
  852.       
  853.       For i = 1 To 4
  854.             For j = 1 To 4
  855.       '            Unload C(i, j)
  856.                   Set C(i, j) = Nothing
  857.                 
  858.             Next j
  859.       Next i
  860.       
  861. End Sub
  862. Private Sub DrawPicture()
  863.                         Dim nWidth As Long
  864.                         Dim nHeight As Long
  865.                         Dim Xthick As Long
  866.                         Dim Ythick As Long
  867.                         Xthick = GetSystemMetrics(7)
  868.                         Ythick = GetSystemMetrics(8)
  869.                   
  870.                          nWidth = Cmd(0).Width
  871.                          nHeight = Cmd(0).Height
  872.                          
  873.                   
  874.                          Picture3.Width = nWidth
  875.                          Picture3.Height = nHeight
  876.                   
  877.                          Dim i As Integer
  878.                          
  879.                         Dim A As R
  880.                         
  881.                          For i = 0 To 14
  882.       
  883.                                     A = ConvertToArray(i)
  884.                                     Dim P As POINTOak
  885.                                     Dim P2 As POINTOak
  886.                               
  887.                              With P
  888.                                     .X = 0 '(A.Column - 1) * Nwidth
  889.                                     .Y = 0 ' (A.Row - 1) * NHeight
  890.                                     .Height = nHeight
  891.                                     .Width = nWidth
  892.                               End With
  893.                               nWidth = Picture3.ScaleWidth
  894.                               nHeight = Picture3.ScaleHeight
  895.       
  896.                               With P2
  897.                                     .X = Xthick + (A.Column - 1) * nWidth
  898.                                     .Y = Ythick + (A.Row - 1) * nWidth
  899.                                     .Height = nHeight
  900.                                     .Width = nWidth
  901.                               End With
  902.                         
  903.  
  904.                                BitBlt Picture3.hdc, P.X, P.Y, P.Width, P.Height, Picture2.hdc, P2.X, P2.Y, ScrCopy
  905.  
  906.                               If Detail.mustHaveNumberonCell Then
  907.                                     Picture3.Print ""
  908.                                
  909.                                     Picture3.FontName = "Microsoft Sans serif"
  910.                                     Picture3.FontSize = 8
  911.                            
  912.                                     Picture3.ForeColor = RGB(GetSetting("K15Puzzle", "Color", "Red", 0), GetSetting("K15Puzzle", "Color", "Green", 0), GetSetting("K15Puzzle", "Color", "Blue", 0))
  913.                                     Picture3.Print
  914.                                     Picture3.Print "        " & i + 1
  915.                          End If
  916.                                     Picture3.Picture = Picture3.Image
  917.                               
  918.                             Cmd(i).Picture = Picture3.Picture
  919.                               Picture3.Cls
  920.                               
  921.  
  922.                         Next i
  923. End Sub
  924.  
  925. Private Sub Image1_DblClick()
  926.       Picture2_DblClick
  927. End Sub
  928.  
  929. Private Sub Image3_Click(Index As Integer)
  930.                         IsCanClick = True
  931.  
  932.                         Pindex = Index
  933.                         Label2(Pindex).Top = Label2(Pindex).Top + 10
  934.                         Label2(Pindex).Left = Label2(Pindex).Left + 10
  935.                         Image3(Index).Picture = ImagePicReal.Picture
  936.                   '      Timer4.Enabled = True
  937.                         TimeDelay.TimerDelay = Ti4
  938.                         Timer3.Interval = 180
  939.                         Timer3.Enabled = True
  940.                         
  941.                         
  942.       Select Case Index
  943.             Case 0
  944.                         Check2.Value = 0
  945.                         Check2_Click
  946.                         SetWindowPos Me.hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE Or SWP_SHOWWINDOW Or SWP_NOMOVE Or SWP_NOSIZE
  947.                         Timer7.Enabled = True
  948.                         
  949.             Case 1
  950.                   SetWindowPos Me.hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE Or SWP_SHOWWINDOW Or SWP_NOMOVE Or SWP_NOSIZE
  951.                   
  952.                   Form2.Show vbModal
  953.                   If Me.blnChangePicture Then
  954.                         Picture2.Picture = LoadPicture(Me.PicFileName)
  955.                         Image1.Picture = Picture2.Picture
  956.                         SetWindowPos Me.hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE Or SWP_SHOWWINDOW Or SWP_NOMOVE Or SWP_NOSIZE
  957.                         If Me.PicFileName = "" Then
  958.                               Check1.Value = 1
  959.                               Check1_Click
  960.                         End If
  961.                         
  962.                         'DrawPicture
  963.                         'Timer8.Enabled = True
  964.                         TimeDelay.TimerDelay = Ti8
  965.                         Timer3.Interval = 220
  966.                         Timer3.Enabled = True
  967.                         'DrawPicture
  968.                         
  969.                   End If
  970.             Image3_Click 0
  971.             
  972.             Case 2
  973.  
  974.                   If MsgBox("Do you want to exit ", vbOKOnly + vbInformation, "K15Puzzle") = vbOK Then
  975.                         Unload Me
  976.                   End If
  977.             Case 3
  978.                   SetWindowPos Me.hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE Or SWP_SHOWWINDOW Or SWP_NOMOVE Or SWP_NOSIZE
  979.                   Form3.Show vbModal
  980.                   SetWindowPos Me.hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE Or SWP_SHOWWINDOW Or SWP_NOMOVE Or SWP_NOSIZE
  981.             Case 4
  982.                   SetWindowPos Me.hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE Or SWP_SHOWWINDOW Or SWP_NOMOVE Or SWP_NOSIZE
  983.                   Form4.NewScore = 30000
  984.                   Form4.Show vbModal
  985.                   SetWindowPos Me.hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE Or SWP_SHOWWINDOW Or SWP_NOMOVE Or SWP_NOSIZE
  986.       End Select
  987. End Sub
  988. Private Sub FillPositionRandom(Num1 As Integer, Num2 As Integer, Num3 As Integer, num4 As Integer, num5 As Integer, num6 As Integer, num7 As Integer, num8 As Integer, num9 As Integer, num10 As Integer, num11 As Integer, num12 As Integer, num13 As Integer, num14 As Integer, num15 As Integer, num16 As Integer, num17 As Integer, num18 As Integer, num19 As Integer, num20 As Integer, Num21 As Integer, Num22 As Integer, Num23 As Integer, Num24 As Integer, Num25 As Integer, Num26 As Integer, Num27 As Integer, Num28 As Integer, Num29 As Integer, Num30 As Integer, Num31 As Integer, Num32 As Integer, Num33 As Integer, Num34 As Integer, Num35 As Integer, Num36 As Integer, Num37 As Integer, Num38 As Integer, Num39 As Integer, Num40 As Integer, Num41 As Integer, Num42 As Integer, Num43 As Integer, Num44 As Integer, Num45 As Integer, Num46 As Integer, Num47 As Integer, Num48 As Integer, Num49 As Integer)
  989.                   
  990.                   
  991.                   ArrayPositionRandom(1) = Num1
  992.                   ArrayPositionRandom(2) = Num2
  993.                   ArrayPositionRandom(3) = Num3
  994.                   ArrayPositionRandom(4) = num4
  995.                   ArrayPositionRandom(5) = num5
  996.                   ArrayPositionRandom(6) = num6
  997.                   ArrayPositionRandom(7) = num7
  998.                   ArrayPositionRandom(8) = num8
  999.                   ArrayPositionRandom(9) = num9
  1000.                   ArrayPositionRandom(10) = num10
  1001.                   ArrayPositionRandom(11) = num11
  1002.                   ArrayPositionRandom(12) = num12
  1003.                   ArrayPositionRandom(13) = num13
  1004.                   ArrayPositionRandom(14) = num14
  1005.                   ArrayPositionRandom(15) = num15
  1006.                   ArrayPositionRandom(16) = num16
  1007.                   ArrayPositionRandom(17) = num17
  1008.                   ArrayPositionRandom(18) = num18
  1009.                   ArrayPositionRandom(19) = num19
  1010.                   ArrayPositionRandom(20) = num20
  1011.                   ArrayPositionRandom(21) = Num21
  1012.                   ArrayPositionRandom(22) = Num22
  1013.                   ArrayPositionRandom(23) = Num23
  1014.                   ArrayPositionRandom(24) = Num24
  1015.                   ArrayPositionRandom(25) = Num25
  1016.                   ArrayPositionRandom(26) = Num26
  1017.                   ArrayPositionRandom(27) = Num27
  1018.                   ArrayPositionRandom(28) = Num28
  1019.                   ArrayPositionRandom(29) = Num29
  1020.                   ArrayPositionRandom(30) = Num30
  1021.                   ArrayPositionRandom(31) = Num31
  1022.                   ArrayPositionRandom(32) = Num32
  1023.                   ArrayPositionRandom(33) = Num33
  1024.                   ArrayPositionRandom(34) = Num34
  1025.                   ArrayPositionRandom(35) = Num35
  1026.                   ArrayPositionRandom(36) = Num36
  1027.                   ArrayPositionRandom(37) = Num37
  1028.                   ArrayPositionRandom(38) = Num38
  1029.                   ArrayPositionRandom(39) = Num39
  1030.                   ArrayPositionRandom(40) = Num40
  1031.                   ArrayPositionRandom(41) = Num41
  1032.                   ArrayPositionRandom(42) = Num42
  1033.                   ArrayPositionRandom(43) = Num43
  1034.                   ArrayPositionRandom(44) = Num44
  1035.                   ArrayPositionRandom(45) = Num45
  1036.                   ArrayPositionRandom(46) = Num46
  1037.                   ArrayPositionRandom(47) = Num47
  1038.                   ArrayPositionRandom(48) = Num48
  1039.                   ArrayPositionRandom(49) = Num49
  1040.                   
  1041. End Sub
  1042.  
  1043. Private Sub Label2_Click(Index As Integer)
  1044.       Label2(Index).Top = Label2(Index).Top + 10
  1045.       Label2(Index).Left = Label2(Index).Left + 10
  1046.       Image3_Click Index
  1047.       
  1048. End Sub
  1049.  
  1050. Private Sub Picture2_DblClick()
  1051.             Image3_Click 1
  1052. End Sub
  1053.  
  1054. Private Sub Picture2_Resize()
  1055.       Image1.Height = Picture2.ScaleHeight
  1056.       Image1.Width = Picture2.ScaleWidth
  1057. End Sub
  1058.  
  1059. Private Sub Timer1_Timer()
  1060.       Label1(1).Caption = "Time         : " & Format(Timer - TiBe, "##.00")
  1061.       
  1062. End Sub
  1063.  
  1064. Private Sub Timer2_Timer()
  1065.       Dim Col As Integer
  1066.       Dim Row As Integer
  1067. Dim rTemp As R
  1068.       If Ccount > 50 Then
  1069.             Timer2.Enabled = True
  1070.             Ccount = 0
  1071.             Exit Sub
  1072.       End If
  1073.       With Detail.rBlank
  1074.             If .Column = 4 Then
  1075.                   Col = 3
  1076.             Else
  1077.                   Col = .Column + 1
  1078.             End If
  1079.             
  1080.             If .Row = 4 Then
  1081.                   Row = 3
  1082.             Else
  1083.                   Row = .Row + 1
  1084.             End If
  1085.             
  1086.       End With
  1087.       'cmd_click(
  1088. End Sub
  1089.  
  1090. Private Sub Timer3_Timer()
  1091.       '3,4,5,6,8
  1092.       'Dim TempenumTimeDelay As enumTimeDelay
  1093.       Static staticChoosePosition As Integer
  1094.       Dim ButtonSlide As Integer
  1095.       With TimeDelay
  1096.             Select Case True
  1097.                   Case .TimerDelay = Ti3
  1098.                         'Picture1.SetFocus
  1099.                         Timer3.Enabled = False
  1100.                   Case .TimerDelay = Ti4
  1101.                         EffectButton
  1102.                         Timer3.Enabled = False
  1103.                   Case .TimerDelay = Ti5
  1104.                               
  1105.                               staticChoosePosition = staticChoosePosition + 1
  1106.                               If staticChoosePosition = 50 Then
  1107.                                     staticChoosePosition = 0
  1108.                                     Timer3.Enabled = False
  1109.                                     Hit = 0
  1110.                                                 Label1(0).Caption = "Hit            : " & Hit
  1111.                                     blnStatusBegin = True
  1112.                                     Detail.IsStart = True
  1113.                                     SetWindowPos Me.hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE Or SWP_SHOWWINDOW Or SWP_NOMOVE Or SWP_NOSIZE
  1114.                                     Timer1.Enabled = True
  1115.                                     Exit Sub
  1116.                               End If
  1117.                               'ButtonSlide = CheckCanMove
  1118.                               '15 * Rnd
  1119.                                     Cmd_MouseDown ArrayPositionRandom(staticChoosePosition), 0, 0, 0, 0
  1120.                                     Timer3.Enabled = False
  1121.                                     'Timer6.Enabled = True
  1122.                                     TimeDelay.TimerDelay = Ti6
  1123.                          
  1124.                                     Timer3.Interval = 10
  1125.                                     Timer3.Enabled = True
  1126.                                     
  1127.                   Case .TimerDelay = Ti6
  1128.                               'Timer6.Enabled = False
  1129.                               TimeDelay.TimerDelay = Ti5
  1130.                               Timer3.Interval = 50
  1131.                               Timer3.Enabled = True
  1132.                               
  1133.                   Case .TimerDelay = Ti8
  1134.                               DrawPicture
  1135.                               Timer3.Enabled = False
  1136.             End Select
  1137.       End With
  1138.       
  1139.       'Picture1.SetFocus
  1140.       'Timer3.Enabled = False
  1141. End Sub
  1142. Private Sub EffectButton()
  1143.       Image3(Pindex).Picture = ImagePicClick.Picture 'LoadPicture("C:\WINDOWS\Desktop\testbuttonfork15.jpg")
  1144.       Label2(Pindex).Top = Label2(Pindex).Top - 10
  1145.       Label2(Pindex).Left = Label2(Pindex).Left - 10
  1146.       
  1147. End Sub
  1148.  
  1149. Private Function CheckWin() As Boolean
  1150.       Dim Result As Boolean
  1151.       Result = False
  1152.       Dim i As Integer
  1153.       Dim j As Integer
  1154.       For i = 1 To 4
  1155.             For j = 1 To 4
  1156.             If Detail.rSim(i, j).Row <> i Then GoTo PROCESS_NOTWIN
  1157.             
  1158.             If Detail.rSim(i, j).Column <> j Then GoTo PROCESS_NOTWIN
  1159.             
  1160.             Next j
  1161.       Next i
  1162.       'MsgBox Detail.rSim(1, 1).Row
  1163.       'MsgBox Detail.rSim(1, 1).Column
  1164.       CheckWin = True
  1165.       Exit Function
  1166. PROCESS_NOTWIN:
  1167.       CheckWin = False
  1168. End Function
  1169.  
  1170.  
  1171.  
  1172.  
  1173.  
  1174.  
  1175. Private Sub Timer4_Timer()
  1176.     Me.Timer4.Enabled = False
  1177.     Check1_Click
  1178.     
  1179. End Sub
  1180.  
  1181. Private Sub Timer7_Timer()
  1182.                         InitGame
  1183.                               blnStatusBegin = False
  1184.                        
  1185.                         TiBe = Timer
  1186.                          
  1187.                             
  1188.                         DrawPicture
  1189.                   
  1190.                         Randomize
  1191.                         Dim TempChoose As Integer
  1192.                         Randomize
  1193.                         TempChoose = 10 * Rnd
  1194.                               Select Case TempChoose
  1195.                                     Case 0
  1196.                                           'FillPositionRandom 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12
  1197.                                           'FillPositionRandom 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15
  1198.                                           'FillPositionRandom 14, 10, 6, 5, 9, 13, 12, 8, 13, 9, 4, 0, 1, 4, 5, 2, 3, 7, 11, 6
  1199.                                         '  FillPositionRandom 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14
  1200.                                           FillPositionRandom 14, 10, 6, 5, 9, 8, 4, 0, 1, 9, 5, 2, 3, 7, 11, 6, 10, 13, 12, 4, 8, 5, 0, 1, 9, 3, 2, 11, 6, 14, 13, 10, 5, 12, 10, 5, 11, 0, 12, 11, 0, 6, 7, 2, 3, 12, 1, 9, 12
  1201.                                     Case 1
  1202.                                           FillPositionRandom 14, 10, 6, 5, 9, 8, 4, 0, 1, 9, 5, 2, 3, 7, 11, 6, 10, 13, 8, 4, 12, 8, 4, 10, 6, 11, 2, 5, 9, 3, 5, 6, 13, 14, 11, 13, 10, 9, 3, 1, 0, 3, 1, 5, 6, 10, 9, 1, 3
  1203.                                     Case 2
  1204.                                           FillPositionRandom 14, 13, 12, 8, 4, 0, 1, 2, 3, 7, 11, 14, 13, 10, 6, 3, 2, 1, 0, 4, 9, 6, 14, 11, 7, 2, 1, 0, 4, 9, 8, 12, 10, 14, 3, 1, 0, 6, 5, 6, 10, 14, 13, 11, 3, 10, 8, 9, 6
  1205.                                     Case 3
  1206.                                            FillPositionRandom 14, 10, 6, 7, 3, 2, 7, 7, 2, 3, 11, 6, 10, 14, 6, 10, 14, 6, 6, 13, 9, 5, 7, 14, 5, 8, 0, 4, 7, 8, 5, 14, 11, 10, 14, 13, 6, 14, 13, 5, 9, 6, 5, 9, 4, 12, 6, 4, 9
  1207.                                     Case 4
  1208.                                            FillPositionRandom 14, 13, 9, 5, 2, 1, 2, 6, 10, 11, 7, 10, 1, 4, 0, 2, 4, 5, 11, 1, 10, 7, 14, 13, 1, 11, 9, 12, 8, 9, 5, 0, 2, 4, 6, 10, 7, 3, 3, 7, 10, 0, 6, 0, 2, 4, 0, 2, 5
  1209.                                     Case 5
  1210.                                           FillPositionRandom 11, 7, 3, 2, 1, 0, 4, 8, 12, 13, 14, 11, 7, 3, 2, 1, 0, 4, 8, 12, 13, 14, 11, 7, 3, 10, 9, 13, 12, 8, 4, 0, 1, 2, 10, 3, 7, 11, 14, 12, 8, 5, 6, 10, 3, 7, 11, 14, 12
  1211.                                     Case 6
  1212.                                           FillPositionRandom 14, 13, 12, 8, 9, 5, 1, 2, 6, 10, 11, 7, 10, 1, 4, 0, 2, 4, 5, 11, 1, 10, 3, 6, 4, 5, 11, 1, 10, 3, 7, 14, 13, 10, 1, 12, 8, 9, 12, 11, 5, 4, 3, 1, 14, 7, 1, 5, 0
  1213.                                     Case 7
  1214.                                           FillPositionRandom 14, 10, 9, 5, 4, 0, 1, 4, 6, 9, 11, 14, 10, 13, 12, 8, 5, 6, 9, 2, 3, 7, 14, 10, 13, 11, 6, 9, 0, 1, 4, 3, 7, 14, 2, 6, 9, 12, 8, 5, 12, 8, 11, 9, 6, 2, 10, 6, 2
  1215.                                     Case 8
  1216.                                           FillPositionRandom 14, 14, 11, 11, 14, 10, 11, 11, 10, 14, 14, 13, 13, 10, 6, 6, 11, 7, 3, 2, 2, 2, 1, 5, 5, 5, 6, 6, 6, 11, 9, 13, 10, 14, 7, 9, 11, 6, 4, 0, 5, 1, 6, 4, 13, 8, 12, 10, 8
  1217.                                           
  1218.                                     Case 9
  1219.                                           FillPositionRandom 14, 10, 6, 5, 4, 8, 12, 13, 10, 6, 5, 7, 3, 2, 1, 4, 9, 5, 11, 3, 2, 1, 4, 9, 5, 12, 13, 10, 6, 11, 7, 5, 8, 13, 10, 6, 11, 7, 5, 8, 13, 0, 9, 4, 1, 2, 3, 14, 7
  1220.                                     Case Else
  1221.                                           FillPositionRandom 11, 10, 9, 5, 6, 2, 3, 7, 2, 9, 5, 13, 14, 5, 10, 2, 9, 3, 1, 6, 13, 10, 3, 9, 2, 3, 5, 14, 10, 8, 12, 10, 8, 5, 14, 11, 3, 14, 9, 2, 7, 1, 2, 13, 6, 2, 13, 7, 1
  1222.  
  1223.                               End Select
  1224.                         'Timer5.Enabled = True
  1225.                         Timer3.Interval = 1
  1226.                         TimeDelay.TimerDelay = Ti5
  1227.                         Timer3.Enabled = True
  1228.                         Timer7.Enabled = False
  1229. End Sub
  1230.  
  1231.  
  1232.  
  1233.