Results 1 to 2 of 2

Thread: How do I call C++ Windows API functions from VB.NET?

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2003
    Location
    Cali,USA
    Posts
    9

    How do I call C++ Windows API functions from VB.NET?

    ok i made a program in visual basic .NET
    thats opens a outside program(Mirc) , goes to a certain chanel and identify my name
    i was wondering how i would minize that outside program after that is all done

    not sure if this will help but this is what i have so far
    Code:
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            Shell("c:\wirc\wirc.exe", AppWinStyle.MinimizedFocus)
            Me.Focus()
            timer1.Enabled = True
            Me.Visible = False
            
        End Sub
    
        Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles timer1.Tick
            Dim temp As String
    
            FileOpen(1, "C:\test.txt", OpenMode.Input)
            temp = LineInput(1)
            FileClose(1)
            System.Windows.Forms.SendKeys.Send("/msg [email protected] identify ")
            System.Windows.Forms.SendKeys.Send(temp)
            System.Windows.Forms.SendKeys.Send("{ENTER}")
    
    
            timer2.Enabled = True
            timer1.Enabled = False
        End Sub
    
        Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles timer2.Tick
            System.Windows.Forms.SendKeys.Send("/join #cohacks")
            System.Windows.Forms.SendKeys.Send("{ENTER}")
            timer2.Enabled = False
            End
        End Sub
    
    
    
    
        
    End Class

  2. #2
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    You call an APi just like you do in VB6...

    As far as I have seen so far, you only have to concern yourself with changing any LONGS declared in a VB6 API call to INTEGERS in the .Net call...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width