کسی مقاله ای در مورد طرز استفاده توابع API در VB.NET نداره
Printable View
کسی مقاله ای در مورد طرز استفاده توابع API در VB.NET نداره
استفاده از API ها بر میگرده به تجربه شما و اینکه حتماً باید API ها را بشناسید
برای استفاده از API ها این دو مثال مفیده
C#
[System.Runtime.InteropServices.DllImport("kernel32 ")]
private static extern int Beep(int dwFreq,int dwDuaration);
Beep(200,100);
VB
Private Declare Function Beep Lib "kernel32" (ByVal dwFreq As _
Integer, ByVal dwDuration As Integer) As Integer
Beep(200,100)
2
C#
[System.Runtime.InteropServices.DllImport("User32")]
private static extern System.IntPtr GetWindowDCSystem.IntPtr i);
چون در .NET Framework چیزی به نام Pointer نداریم ولی یه چیز ی داریم به نام System.IntPtr
private void Form1_Paint(object sender, System.Windows.Forms.PaintEventArgs e)
{
System.IntPtr pt=GetWindowDC(this.Handle);
Graphics g=Graphics.FromHdc(pt);
g.DrawIcon(this.Icon,200,0);
}
Private Declare Function GetWindowDC Lib "User32" (ByVal i As _
System.IntPtr) As System.IntPtr
Private Sub Form1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MyBase.Paint
Dim pt As System.IntPtr = GetWindowDC(Me.Handle)
Dim g As Graphics = Graphics.FromHdc(pt)
g.DrawIcon(Me.Icon, 200, 0)
End Sub
شما دنبال چه API می گردید؟
موفق باشید
این را پیدا کردم ولی برای VB6 است . باید یه کمی بیشتر بررسیش کنی