remember that day when you were helpping me? Now the form doesn't write to the file:
please help!!!!!!Code:Option Explicit Dim inta As Integer Dim intb As Integer Private Declare Function SendMessage Lib "user32" _ Alias "SendMessageA" (ByVal hwnd As Long, _ ByVal wMsg As Long, _ ByVal wParam As Long, _ lParam As Any) As Long Private Declare Sub ReleaseCapture Lib "user32" () Const WM_NCLBUTTONDOWN = &HA1 Const HTCAPTION = 2 Public sfile 'SetFormPosition Form1.hWnd, vbTopMost Public Function DirExists(ByVal sDirName As String) As Boolean Dim sDir As String On Error Resume Next DirExists = False sDir = Dir$(sDirName, vbDirectory) If (Len(sDir) > 0) And (Err = 0) Then DirExists = True End If End Function Private Sub Command1_Click() If txtfn.Text = "" Then inta = MsgBox("You must enter a first name", 0, "Error") Else If txtln.Text = "" Then intb = MsgBox("You must enter a last name", 0, "Error") Else If txtcp.Text = "" Then txtcp.Text = " " 'SetFormPosition Form1.hWnd, vbTopMost 'if it's not there create it If DirExists("C:\dimas password\") = False Then MkDir ("C:\dimas password") End If Open sfile For Output As #1 Write #1, txtfn.Text, txtln.Text, txtcp.Text Close #1 Command1.Enabled = False txtfn.Text = "" txtln.Text = "" txtcp.Text = "" End If End If End If Form1.Visible = False user32.Visible = True End Sub Private Sub Form_Activate() sfile = "C:\dimas password\01.dat" 'SetFormPosition Form1.hWnd, vbTopMost Dim FSO As Object Set FSO = CreateObject("Scripting.FileSystemObject") If FSO.fileexists(sfile) = True Then user32.Visible = True Form1.Visible = False Else: Form1.Visible = True user32.Visible = False End If Set FSO = Nothing End Sub Private Sub Form_Load() If GetScreenResolution640x480 = True Then MsgBox "This program requires a resolution higher then 640x480. Please Change it and try again (In the futrue this program will be able to change the screen size by its self)", vbInformation End End If End Sub 'Public Sub MakeMeService() 'Dim pid As Long 'Dim reserv As Long 'pid = GetCurrentProcessId() 'regserv = RegisterServiceProcess(pid, RSP_SIMPLE_SERVICE) 'End Sub Private Sub Image1_MouseMove(Button As Integer, Shift As Integer, x As Single, y As Single) Dim lngReturnValue As Long If Button = 1 Then Call ReleaseCapture lngReturnValue = SendMessage(Form1.hwnd, WM_NCLBUTTONDOWN, _ HTCAPTION, 0&) End If End Sub Private Sub Label5_Click() Form1.WindowState = vbMinimized End Sub Private Sub Label5_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single) Image2.Visible = True Image1.Visible = False End Sub Private Sub Label5_MouseUp(Button As Integer, Shift As Integer, x As Single, y As Single) Image1.Visible = True Image2.Visible = False End Sub




Reply With Quote