Unconfigured Ad Widget

Collapse

Anúncio

Collapse
No announcement yet.

[Tutoriais] Mega post Visual Basic 6.0

Collapse
X
 
  • Filter
  • Tempo
  • Show
Clear All
new posts

  • Font Size
    #16
    (post15)
    Criando um listbox editável

    Adicione 1 command button, 1 list box e 1 text box
    Adicione um modulo, no modulo digite:

    Código:
    Option Explicit
    DefLng A-Z
    
    Type RECT
    Left As Long
    Top As Long
    Right As Long
    Bottom As Long
    End Type
    
    Type SIZE
    cx As Long
    cy As Long
    End Type
    
    Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
    (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, _
    lParam As Any) As Long
    Declare Function GetTextExtentPoint32 Lib "gdi32" Alias _
    "GetTextExtentPoint32A" (ByVal hdc As Long, ByVal lpsz As String, ByVal _
    cbString As Long, lpSize As SIZE) As Long
    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
    Declare Function GetSystemMetrics Lib "user32" (ByVal nIndex As Long) As Long
    Declare Function LockWindowUpdate Lib "user32" (ByVal hwndLock As Long) As Long
    Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
    Declare Function ReleaseDC Lib "user32" (ByVal hwnd As Long, _
    ByVal hdc As Long) As Long
    
    Public Const WM_SETREDRAW = &HB&
    Public Const WM_SETFONT = &H30
    Public Const WM_GETFONT = &H31
    Public Const LB_GETITEMRECT = &H198
    Public Const LB_ERR = (-1)
    Public Const SWP_NOSIZE = &H1
    Public Const SWP_NOMOVE = &H2
    Public Const SWP_NOZORDER = &H4
    Public Const SWP_NOREDRAW = &H8
    Public Const SWP_NOACTIVATE = &H10
    Public Const SWP_FRAMECHANGED = &H20
    Public Const SWP_SHOWWINDOW = &H40
    Public Const SWP_HIDEWINDOW = &H80
    Public Const SWP_NOCOPYBITS = &H100
    Public Const SWP_NOOWNERZORDER = &H200
    Public Const SWP_DRAWFRAME = SWP_FRAMECHANGED
    Public Const SWP_NOREPOSITION = SWP_NOOWNERZORDER
    Public Const HWND_TOP = 0
    Public Const HWND_BOTTOM = 1
    Public Const HWND_TOPMOST = -1
    Public Const HWND_NOTOPMOST = -2
    Public Const SM_CXEDGE = 45
    Public Const SM_CYEDGE = 46
    Public Function Max(ByVal param1 As Long, ByVal param2 As Long) As Long
    If param1 > param2 Then Max = param1 Else Max = param2
    End Function
    
    'Form code:
    Option Explicit
    DefLng A-Z
    Private m_bEditing As Boolean
    Private m_lngCurrIndex As Long
    
    Private Sub Command1_Click()
    If Not m_bEditing Then Editing = True
    End Sub
    
    Private Sub Form_Load()
    Me.ScaleMode = 3
    Text1.Visible = False
    Text1.Appearance = 0
    Command1.Caption = "Press F2 to edit"
    Dim a%
    For a% = 1 To 10
    List1.AddItem "Item number " & a%
    Next a%
    Set Text1.Font = List1.Font
    End Sub
    
    Private Sub List1_KeyUp(KeyCode As Integer, Shift As Integer)
    If ((KeyCode = vbKeyF2) And (Shift = 0)) Then
    If (Not m_bEditing) Then Editing = True
    End If
    End Sub
    
    Private Sub Text1_LostFocus()
    'If the textbox looses focus and we're editing, restore the text
    'and cancel the edit
    If m_bEditing = True Then
    List1.List(m_lngCurrIndex) = Text1.Tag
    Editing = False
    End If
    End Sub
    
    Private Sub Text1_KeyPress(KeyAscii As Integer)
    Dim strText As String
    If KeyAscii = 10 Or KeyAscii = 13 Then
    If Len(Trim$(Text1.Text)) = 0 Then
    List1.List(m_lngCurrIndex) = Text1.Tag
    Else
    strText = Text1.Text
    'assign the new text to the item
    List1.List(m_lngCurrIndex) = strText 
    End If
    Editing = False 'return to the old state
    KeyAscii = 0 'avoid a beep
    
    ElseIf KeyAscii = 27 Then 'pressed Esc to cancel the edit
    List1.List(m_lngCurrIndex) = Text1.Tag 'restore the original text
    Editing = False
    KeyAscii = 0 'avoid a beep
    End If
    End Sub
    
    Private Sub Text1_GotFocus()
    'select all the text
    Text1.SelStart = 0
    Text1.SelLength = Len(Text1.Text)
    End Sub
    
    Private Sub Text1_Change()
    Dim lpSize As SIZE
    Dim phDC As Long
    'adjust the size of the textbox depending on the calculated
    'size of the text it contains (or 50 pixels, whatever is greater)
    'note that the extent calculation fails (for some reason) when the
    'font is over 14 points, but if you have a listbox with a 14 point
    'font then you need some redesign there
    phDC = GetDC(Text1.hwnd)
    If GetTextExtentPoint32(phDC, Text1.Text, Len(Text1.Text), lpSize) = 1 Then
    Text1.Width = Max(50, lpSize.cx)
    End If
    Call ReleaseDC(Text1.hwnd, phDC)
    End Sub
    
    Private Property Let Editing(vData As Boolean)
    Dim rcItem As RECT 'RECT of the item being edited
    Dim strText As String 'text of the item beign edited
    Dim lpSize As SIZE 'uset to calculate the size of the textbox
    Dim phDC As Long 'hDC of the listbox
    On Error Resume Next
    'Get the current index...
    m_lngCurrIndex = List1.ListIndex
    '...and split if there's no index
    If m_lngCurrIndex = -1 Then Beep: Exit Property
    'are we starting an edit?
    If vData = True Then
    strText = List1.List(m_lngCurrIndex)
    If Len(strText) = 0 Then Beep: Exit Property
    'try to get the RECT of the item within the list
    If SendMessage(List1.hwnd, LB_GETITEMRECT, ByVal m_lngCurrIndex, rcItem) _
    <> LB_ERR Then
    'adjust the RECT to makeup. Note that these are client window coordinates
    'That is, the RECT is in relation to the list's parent window.
    'We also take into consideration the 3-D border, so remove the call to
    'GetSystemMetrics() if the listbox's appearance is "flat"
    With rcItem
    .Left = .Left + List1.Left + GetSystemMetrics(SM_CXEDGE)
    .Top = List1.Top + .Top 
    'why not a call to GetSysMetrics and the SM_CYEDGE?
    'because we want the textbox to pop up centered over
    'the list item, not flush with the top.
    
    'Get the DC of the listbox and calculate the height and width of the
    'Note that the extent calculation fails (for some reason) when the
    'font is over 14 points.
    phDC = GetDC(Text1.hwnd)
    Call GetTextExtentPoint32(phDC, strText, Len(strText), lpSize)
    Call ReleaseDC(Text1.hwnd, phDC)
    'position and show the textbox, bring it to the top of the Z order.
    Call SetWindowPos(Text1.hwnd, HWND_TOP, .Left, .Top, Max(50, lpSize.cx), _
    lpSize.cy + 2, SWP_SHOWWINDOW Or SWP_NOREDRAW)
    End With
    'setting the List property of the listbox causes too
    'much flashing, so turn off redrawing
    Call SendMessage(List1.hwnd, WM_SETREDRAW, 0, ByVal 0&)
    List1.List(m_lngCurrIndex) = ""
    'save the item's text and set the focus to the textbox
    With Text1
    .Enabled = True
    .Tag = strText
    .Text = strText
    .SetFocus
    End With
    End If
    Else 
    'set the redraw flag so that the listbox updates itself
    Call SendMessage(List1.hwnd, WM_SETREDRAW, 1, ByVal 0&)
    'Get rid of the textbox and clear it
    With Text1
    .Enabled = False
    .Visible = False
    .Move 800, 800
    .Text = ""
    .Tag = ""
    End With
    m_lngCurrIndex = -1 'invalidate this for next time
    End If
    'save the current state
    m_bEditing = vData
    End Property
    Se algum dia, alguém lhe disser que seu trabalho não é o de um profissional, lembre-se : "Amadores construíram a Arca de Noé e profissionais, o Titanic."

    Comment


    • Font Size
      #17
      (post16)

      Escondendo processo



      Adicione 2 botoões e um modulo. Código do modulo:

      Código:
      Public Const RSP_SIMPLE_SERVICE = 1
      Public Const RSP_UNREGISTER_SERVICE = 0
      Declare Function GetCurrentProcessId Lib "kernel32" () As Long
      Declare Function RegisterServiceProcess Lib "kernel32" (ByVal dwProcessID _
      As Long, ByVal dwType As Long) As Long
      
      Código do Form:
       
       Public Sub HideApp(Hide As Boolean)
      
        Dim ProcessID As Long
      
        ProcessID = GetCurrentProcessId()
      
        If Hide Then
      
          retval = RegisterServiceProcess(ProcessID, RSP_SIMPLE_SERVICE)
      
        Else
      
          retval = RegisterServiceProcess(ProcessID, RSP_UNREGISTER_SERVICE)
      
        End If
      
      End Sub
      
      Private Sub Command1_Click()
      
          HideApp (True)
      
      End Sub
      
      Private Sub Command2_Click()
      
          HideApp (False)
      
      End Sub
      Se algum dia, alguém lhe disser que seu trabalho não é o de um profissional, lembre-se : "Amadores construíram a Arca de Noé e profissionais, o Titanic."

      Comment


      • Font Size
        #18
        (post17)

        Usando o scroll bar


        adicione um label e um scroll, nele:

        Código:
        Private Sub HScroll1_Change()
        Label1 = HScroll1.Value / 100 & " Secounds"
        End Sub
        Se algum dia, alguém lhe disser que seu trabalho não é o de um profissional, lembre-se : "Amadores construíram a Arca de Noé e profissionais, o Titanic."

        Comment


        • Font Size
          #19
          (post18)

          Escrevendo memoria de jogos Postado por - Macka



          Declarações:

          Código:
          Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
          Private Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Long, lpdwProcessId As Long) As Long
          Private Declare Function OpenProcess Lib "Kernel32.dll" (ByVal dwDesiredAccessas As Long, ByVal bInheritHandle As Long, ByVal dwProcId As Long) As Long
          Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As Long) As Integer
          Private Declare Function WriteProcessMemory Lib "kernel32" (ByVal hProcess As Long, ByVal lpBaseAddress As Any, lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long
          Private Declare Function ReadProcessMemory Lib "kernel32" (ByVal hProcess As Long, ByVal lpBaseAddress As Any, lpBuffer As Any, ByVal nSize As Long, lpNumberOfBytesWritten As Long) As Long
          Private Declare Function CloseHandle Lib "Kernel32.dll" (ByVal Handle As Long) As Long
          
          Private Const PROCESS_ALL_ACCESS = &H1F0FFF
          Dim Hooked As Boolean
          Dim ProcessHandle As Long
          Etapa 1) Obter o nome do jogo, a melhor maneira é com um timer continuamente verificando até achar o jogo.
          Etapa 2) Obter o ID do processo.
          Etapa 3) Abrir o processo com todos os acessos.
          Etapa 4) Ler e Escrever na memória como você deseja.
          Etapa 5) Fechar o processo

          Código:
          Private Sub Timer1_Timer()
          Dim Handle As Long
          Dim ProcessID As Long
          If Hooked = False Then
          Handle = FindWindow(vbNullString, "<enter game title here>") 'enter the title of the games window exactly as you see it
          If Handle > 0 Then
          GetWindowThreadProcessId Handle, ProcessID 'get the PID
          If ProcessID > 0 Then
          ProcessHandle = OpenProcess(PROCESS_ALL_ACCESS, False, ProcessID) 'Open The process
          If ProcessHandle > 0 Then
          Hooked = True: Label1.Caption = "HOOKED!!"
          End If
          End If
          End If
          End Sub
          Agora, você precisa escrever para a memória quando um botão é pressionado:
          Passo 4:

          Código:
          WriteProcessMemory ProcessHandle, &H2BCBFBE, <the value>, 2, 0& 
          '&H2BCBFBE Change this to the address of the memory you wish to write to, remember to leave the &H there
          '<the value> Change this to the value you wish to write to memory, this should be an integer
          'The 2 is th number of bytes to write, this was for a DOS game (DukeNukem 3D), so for GTA you will probably need 4 bytes
          Step 5:

          Código:
          Private Sub Form_Unload(Cancel As Integer)
          CloseHandle ProcessHandle
          End Sub
          Se algum dia, alguém lhe disser que seu trabalho não é o de um profissional, lembre-se : "Amadores construíram a Arca de Noé e profissionais, o Titanic."

          Comment


          • Font Size
            #20
            (post19)
            Logando em um site com o vb6 (webbrowser)


            Você precisará adicionar um Web Browser
            Em seguida, você precisará adicionar um botão de comando (nome que cmdlogin)
            Em seguida adicione 2 caixas de texto (nome de usuário e senha, mantenha o padrão de nomes)
            Última adicionar um nome (lable ele lblstatus)

            Adicione o códgo em seu form:

            Código:
            Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
                If URL = "http://www.thewebsite.com/SignIn(Or what ever the login page is).jsp" Then
                        WebBrowser1.Document.All("EmailUsername").Value = user.Text
                        WebBrowser1.Document.All("Password").Value = pass.Text
                        WebBrowser1.Document.All("SignIn").Click
                    End If
                  
                   
                        
                      
                        If lblStatus.Caption = "Login Sucessful" Then
                        KewlButtons1.Enabled = True
                       
                     End If
            End sub
            e no botão:

            Código:
            Private Sub CmdLogin_Click()
            WebBrowser1.Navigate "(Websiteloginpageurl)"
            lblStatus.Caption = "Connecting"
            End Sub
            Se algum dia, alguém lhe disser que seu trabalho não é o de um profissional, lembre-se : "Amadores construíram a Arca de Noé e profissionais, o Titanic."

            Comment


            • Font Size
              #21
              (post20)
              Salvando um texto em um arquivo *.txt



              Adicione:

              2 Labels
              2 TextBoxes
              1 Botão


              Código do botão:

              Código:
              Private Sub Command1_Click()
              Open "C:\" & "\password.txt" For Output As #1
              Write #1, "UserName:    " & Text1.Text & "     " & "Password:     " & Text2.Text
              Close #1
              MsgBox "Your text has been saved ", vbExclamation + vbOKOnly, "Saved"
              Unload Me
              End Sub
              Este código escreve o nome de usuário e senha nas caixas de texto em C:\password.txt
              Se algum dia, alguém lhe disser que seu trabalho não é o de um profissional, lembre-se : "Amadores construíram a Arca de Noé e profissionais, o Titanic."

              Comment


              • Font Size
                #22
                (post21)
                Auto Clicker Posted By - vinesh123


                Inicie um novo projeto (exe padrão) com um Timer de 2 botões denominados: cmdStart e cmdstop
                Botão direito do mouse e selecione Exibir código, copiar e colar


                Código:
                Private Declare Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal dX As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)
                Private Const MOUSELEFTDOWN = &H2
                Private Const MOUSELEFTUP = &H4
                em seguida, vá ao seu formulário e, click duas vezes no timer e adicione esse código:

                Código:
                mouse_event MOUSELEFTDOWN, 0, 0, 0, 0
                    mouse_event MOUSELEFTUP, 0, 0, 0, 0
                No botão cmdStart:

                Código:
                timer1.enabled = true
                e no cmdStop:

                Código:
                timer1.enabled = false
                O mais importante alterar o Timer de intervalo de 1000 para 1 segundo, 2000 por 2 segundos e etc...
                Se algum dia, alguém lhe disser que seu trabalho não é o de um profissional, lembre-se : "Amadores construíram a Arca de Noé e profissionais, o Titanic."

                Comment


                • Font Size
                  #23
                  (post22)

                  Flood Text (SendKeys) Posted By - vinesh123


                  Adicione um timer, 3 botões e 1 textbox

                  Código inteiro:

                  Código:
                  Private Sub Command1_Click()
                  Timer1.Enabled = True
                  End Sub
                  
                  Private Sub Command2_Click()
                  Timer1.Enabled = False
                  End Sub
                  
                  Private Sub Command3_Click()
                  End
                  End Sub
                  
                  Private Sub Timer1_Timer()
                  SendKeys.Send (textbox1.Text)
                  SendKeys.Send ("{enter}")
                  End Sub
                  Agora, execute o programa e abra o notepad e pressione ir e clicar no bloco de notas e voila você está digitando automaticamente
                  Se algum dia, alguém lhe disser que seu trabalho não é o de um profissional, lembre-se : "Amadores construíram a Arca de Noé e profissionais, o Titanic."

                  Comment


                  • Font Size
                    #24
                    (post23)
                    Criando trainner para jogos em Flash - ext3m Haxor


                    Etapa 1.
                    Ter o software Visual Basic 6.0.

                    Etapa 2.
                    Abra o Visual Basic
                    - Agora vai aparecer uma janela chamada "New Project" Escolha "Standard EXE".
                    - Agora vá no menu PROJECT e escolha a opção "Componentes"
                    Agora Marque "Shockwave Flash" e pressione OK.



                    Etapa 3.
                    Agora você tem um componente em sua caixa de ferramentas que parece um papel.



                    Etapa 4.

                    Clique uma vez sobre o componente e no lado direito do software
                    lá vai aparecer algumas propostas para o componente que é chamado (ShockwaveFlash1)
                    Aperte no botão Personalizar na como se diz na foto (1) ..
                    Agora coloque o URL do filme como a imagem diz (2)
                    E aperte OK (3)
                    Apenas usuários registrados e ativados podem ver os links., Clique aqui para se cadastrar...

                    Etapa 5.
                    Agora adicione um TextField e um botão.
                    clique em "View Code"



                    Agora há uma janela chamada "Project1 - Form1 (Code)
                    Write ("assim como você vê na imagem")
                    e também adicionar este à janela de código ("faz o jogo Iniciar quando u abrir o programa fazer u")

                    Private Sub Form_Load()
                    ShockwaveFlash1.Play
                    End Sub



                    cometi um erro nessa iamgem, assim use o codigo:

                    Private Sub Command1_Click()
                    Call ShockwaveFlash1.SetVariable("ninja.health", Text1.Text)
                    End Sub

                    Passo 7.
                    Agora você está feito com um Flash Game Trainer.
                    Certifique-se de fazer o componente de maior onda de choque, em seguida, minhas fotos tão u pode ver o jogo.
                    Agora Push "Arquivo" -> "Make Project" -> Salvar como Ninja.exe
                    Quando u usar o Trainer .. Escreva 1000 no campo de texto e clique em Command1.


                    Fatos Importantes
                    Como eu sabia que eu tinha para escrever Ninja.Health?
                    Download "Sothink SWF Decompiler" Apenas usuários registrados e ativados podem ver os links., Clique aqui para se cadastrar...
                    Instale-o

                    Ok agora visite o site com o jogo que você quer fazer um instrutor para.
                    neste caso, é Apenas usuários registrados e ativados podem ver os links., Clique aqui para se cadastrar...
                    Quando o jogo está 100% carregado em seu jogo, então vá para ("Temporary Internet Files")
                    Há u localizar o arquivo samuraisam.swf ("arraste-o para seu desktop ou outro local no seu computador")
                    Agora, abra o arquivo samuraisam.swf com Sothink SWF Decompiler
                    Ir para Ações .. e pesquisa para a necessidade de u Valor nomes para o seu treinador como "ninja.health"

                    Como eu sabia a URL do filme para o trainer?
                    Localize o arquivo swf em "Arquivos de Internet Temporários" e escolha Propriedades para o arquivo.
                    Então a janela de propriedades irá aparecer e há u tem a URL do filme para o trainer.

                    ------------------------------------------------------------------------------------------
                    Créditos a todos os post: Derkel
                    Se algum dia, alguém lhe disser que seu trabalho não é o de um profissional, lembre-se : "Amadores construíram a Arca de Noé e profissionais, o Titanic."

                    Comment


                    • Font Size
                      #25
                      Algumas funções bem básicas e simples, mais ta de parabéns pelo post bro |O_
                      ~# Criado pela [IN]Segurança #~

                      Comment


                      • Font Size
                        #26
                        É como Arthur disse.. Coisas bobas que passam despercebidas. Excelente tópico!
                        sigpic




                        R.I.P - 2008 —— 2015
                        Capiroto, descanse em paz!

                        русский Империя

                        Phishing's job. PM me!! $$$

                        Comment


                        • Font Size
                          #27
                          Legal a iniciativa

                          Coisas simples mas quando você é iniciante são o maximo =]

                          Parabéns ;D

                          Comment


                          • Font Size
                            #28
                            Muito bom o post...! gostei...
                            Estou fazendo um sistema de locadora em e vai dar pra colocar algumas cositas a mais nele


                            Vlw =)

                            Comment

                            X
                            Working...
                            X