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
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
Dim Pindex As Integer
Dim blnStatusBegin As Boolean
Dim Hit As Integer
Dim TiBe As Long
Public PicFileName As String
Public blnChangePicture As Boolean
Private Type POINTOak
X As Long
Y As Long
Width As Long
Height As Long
End Type
Private Type R ' For Row and Column
Row As Integer
Column As Integer
End Type
Private Type DetailAboutTable
CWidth As Single
CHeight As Single
NumPerRow As Integer
All As Integer
rBlank As R
rSim(1 To 4, 1 To 4) As R
ModePicture As Boolean
IsStart As Boolean
mustHaveNumberonCell As Boolean
End Type
Private Detail As DetailAboutTable
Dim Ccount As Integer
Private C(1 To 4, 1 To 4) As Object ' For each command
Private Declare Function GetSystemMetrics Lib "User32" (ByVal nIndex As Long) As Long
Const SM_CXSCREEN = 0 'X Size of screen
Const SM_CYSCREEN = 1 'Y Size of Screen
Const SM_CXVSCROLL = 2 'X Size of arrow in vertical scroll bar.
Const SM_CYHSCROLL = 3 'Y Size of arrow in horizontal scroll bar
Const SM_CYCAPTION = 4 'Height of windows caption
Const SM_CXBORDER = 5 'Width of no-sizable borders
Const SM_CYBORDER = 6 'Height of non-sizable borders
Const SM_CXDLGFRAME = 7 'Width of dialog box borders
Const SM_CYDLGFRAME = 8 'Height of dialog box borders
Const SM_CYHTHUMB = 9 'Height of scroll box on horizontal scroll bar
Const SM_CXHTHUMB = 10 ' Width of scroll box on horizontal scroll bar
Const SM_CXICON = 11 'Width of standard icon
Const SM_CYICON = 12 'Height of standard icon
Const SM_CXCURSOR = 13 'Width of standard cursor
Const SM_CYCURSOR = 14 'Height of standard cursor
Const SM_CYMENU = 15 'Height of menu
Const SM_CXFULLSCREEN = 16 'Width of client area of maximized window
Const SM_CYFULLSCREEN = 17 'Height of client area of maximized window
Const SM_CYKANJIWINDOW = 18 'Height of Kanji window
Const SM_MOUSEPRESENT = 19 'True is a mouse is present
Const SM_CYVSCROLL = 20 'Height of arrow in vertical scroll bar
Const SM_CXHSCROLL = 21 'Width of arrow in vertical scroll bar
Const SM_DEBUG = 22 'True if deugging version of windows is running
Const SM_SWAPBUTTON = 23 'True if left and right buttons are swapped.
Const SM_CXMIN = 28 'Minimum width of window
Const SM_CYMIN = 29 'Minimum height of window
Const SM_CXSIZE = 30 'Width of title bar bitmaps
Const SM_CYSIZE = 31 'height of title bar bitmaps
Const SM_CXMINTRACK = 34 'Minimum tracking width of window
Const SM_CYMINTRACK = 35 'Minimum tracking height of window
Const SM_CXDOUBLECLK = 36 'double click width
Const SM_CYDOUBLECLK = 37 'double click height
Const SM_CXICONSPACING = 38 'width between desktop icons
Const SM_CYICONSPACING = 39 'height between desktop icons
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.
Const SM_PENWINDOWS = 41 'The handle of the pen windows DLL if loaded.
Const SM_DBCSENABLED = 42 'True if double byte characteds are enabled
Const SM_CMOUSEBUTTONS = 43 'Number of mouse buttons.
Const SM_CXMAXIMIZED = 61 'default width of win95 maximised window
Const SM_CXMAXTRACK = 59 'maximum width when resizing win95 windows
Const SM_CXMENUCHECK = 71 'width of menu checkmark bitmap
Const SM_CXMENUSIZE = 54 'width of button on menu bar
Const SM_CXMINIMIZED = 57 'width of rectangle into which minimised windows must fit.
Const SM_CYMAXIMIZED = 62 'default height of win95 maximised window
Const SM_CYMAXTRACK = 60 'maximum width when resizing win95 windows
Const SM_CYMENUCHECK = 72 'height of menu checkmark bitmap
Const SM_CYMENUSIZE = 55 'height of button on menu bar
Const SM_CYMINIMIZED = 58 'height of rectangle into which minimised windows must fit.
Const SM_CYSMCAPTION = 51 'height of windows 95 small caption
Const SM_MIDEASTENABLED = 74 'Hebrw and Arabic enabled for windows 95
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
Const SM_SLOWMACHINE = 73 'true if machine is too slow to run win95.
Dim ArrayPositionRandom(1 To 49) As Integer
Dim blnStatusNotFirstRun As Boolean
Const HWND_TOPMOST = -1
Const HWND_NOTOPMOST = -2
Const SWP_NOSIZE = &H1
Const SWP_NOMOVE = &H2
Const SWP_NOACTIVATE = &H10
Const SWP_SHOWWINDOW = &H40
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)
Private Enum enumTimeDelay
Ti3 = 1
Ti4 = 2
Ti5 = 3
Ti6 = 4
Ti8 = 5
End Enum
Private Type TimeDalayType
TimerDelay As enumTimeDelay
InitiVal As Integer
End Type
Dim IsCanClick As Boolean
Dim TimeDelay As TimeDalayType
Private Function ConVertRealtoSim(Index As Integer) As R
Dim TempR As R
Dim i As Integer
Dim j As Integer
TempR = ConvertToArray(Index)
For i = 1 To 4
For j = 1 To 4
Next j
Next i
End Function
Private Function ConvertToArray(Index As Integer) As R
'Purpose : For Convert 1 Dimension Array to 2 Dimension Array
'Accept : index of 1 Dimension
'Return :Column and Row of Varible type R
Dim rTemp As R
' List1.AddItem "Real = " & i \ 4 + 1 & " " & i Mod 4 + 1
' List1.AddItem "Sim = " & Detail.rSim(i \ 4 + 1, i Mod 4 + 1).Row & " " & Detail.rSim(i \ 4 + 1, i Mod 4 + 1).Column
rTemp.Row = Index \ Detail.NumPerRow + 1
rTemp.Column = Index Mod Detail.NumPerRow + 1
ConvertToArray = rTemp
End Function
Private Sub MovePosition(Row As Integer, Col As Integer, Ob As R, Bla As R)
'Purpose : For Change Blank Position and Move Position
'Accept :Row,Col of BlankPosition and Position of Cmd to move by pass Ob
SetWindowPos Me.hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE Or SWP_SHOWWINDOW Or SWP_NOMOVE Or SWP_NOSIZE
Timer7.Enabled = True
Case 1
SetWindowPos Me.hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE Or SWP_SHOWWINDOW Or SWP_NOMOVE Or SWP_NOSIZE
Form2.Show vbModal
If Me.blnChangePicture Then
Picture2.Picture = LoadPicture(Me.PicFileName)
Image1.Picture = Picture2.Picture
SetWindowPos Me.hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE Or SWP_SHOWWINDOW Or SWP_NOMOVE Or SWP_NOSIZE
If Me.PicFileName = "" Then
Check1.Value = 1
Check1_Click
End If
'DrawPicture
'Timer8.Enabled = True
TimeDelay.TimerDelay = Ti8
Timer3.Interval = 220
Timer3.Enabled = True
'DrawPicture
End If
Image3_Click 0
Case 2
If MsgBox("Do you want to exit ", vbOKOnly + vbInformation, "K15Puzzle") = vbOK Then
Unload Me
End If
Case 3
SetWindowPos Me.hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE Or SWP_SHOWWINDOW Or SWP_NOMOVE Or SWP_NOSIZE
Form3.Show vbModal
SetWindowPos Me.hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE Or SWP_SHOWWINDOW Or SWP_NOMOVE Or SWP_NOSIZE
Case 4
SetWindowPos Me.hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE Or SWP_SHOWWINDOW Or SWP_NOMOVE Or SWP_NOSIZE
Form4.NewScore = 30000
Form4.Show vbModal
SetWindowPos Me.hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOACTIVATE Or SWP_SHOWWINDOW Or SWP_NOMOVE Or SWP_NOSIZE
End Select
End Sub
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)