نمایش نتایج 1 تا 2 از 2

نام تاپیک: کمک...توضیح خط به خط کد تابع api

Threaded View

پست قبلی پست قبلی   پست بعدی پست بعدی
  1. #1

    Unhappy کمک...توضیح خط به خط کد تابع api

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Linq;
    using System.Text;
    using System.Windows.Forms;
    using System.Runtime.InteropServices;
    using System.Drawing.Printing;


    namespace WindowsFormsApplication12
    {
    public partial class Form1 : Form
    {
    public Form1()
    {
    InitializeComponent();
    }

    public struct DOCINFO
    {
    public int cbSize;
    public string lpszDocName;
    public string lpszOutput;
    public string lpszDatatype;
    }

    public struct POINTAPI
    {
    public int x;
    public int y;

    }

    [DllImport("gdi32.dll",SetLastError=true ) ]
    public static extern int PolyDraw(int hdc, POINTAPI lppt, Byte lpbTypes, int cCount);

    [DllImport("gdi32.dll", EntryPoint="StartDocA", SetLastError=true)]
    public static extern int StartDoc(int hdc, ref DOCINFO lpdi);

    [DllImport("gdi32.dll",SetLastError=true)]
    public static extern int StartPage(int hdc);

    [DllImport("gdi32.dll",SetLastError=true)]
    public static extern int EndPage(int hdc);

    [DllImport("gdi32.dll",SetLastError=true)]
    public static extern int EndDoc(int hDC);

    [DllImport("gdi32.dll", EntryPoint = "CreateDCA")]
    public static extern int CreateDC(string lpDriverName, string lpDeviceName, string lpOutput, int lpInitData);



    private void Form1_Load(object sender, EventArgs e)
    {


    }

    private void button1_Click(object sender, EventArgs e)
    {
    int printer = CreateDC("winspool", printDocument1.PrinterSettings.PrinterName, null, 0);
    POINTAPI Pt2;
    Byte bTypes1;
    DOCINFO DI = new DOCINFO();

    DI.cbSize = Marshal.SizeOf(DI);
    DI.lpszDocName = "API-Guide Code Demonstration";
    DI.lpszOutput = null;
    DI.lpszDatatype = null;
    Pt2.x = 50;
    Pt2.y = 30;
    bTypes1 = 0x2;
    PolyDraw(printer,Pt2,bTypes1,2);
    StartDoc(printer, ref DI);
    StartPage(printer);
    EndPage(printer);
    EndDoc(printer);
    }
    }
    }
    آخرین ویرایش به وسیله red_nima2010 : پنج شنبه 16 آذر 1391 در 22:35 عصر

تاپیک های مشابه

  1. کمک در باره چند تابع API
    نوشته شده توسط mohammadhemmati در بخش برنامه نویسی در 6 VB
    پاسخ: 10
    آخرین پست: سه شنبه 13 اردیبهشت 1390, 15:46 عصر
  2. پاسخ: 1
    آخرین پست: یک شنبه 26 شهریور 1385, 20:20 عصر
  3. کمک در مورد یک تابع API
    نوشته شده توسط Hamedm در بخش برنامه نویسی در 6 VB
    پاسخ: 8
    آخرین پست: شنبه 15 مرداد 1384, 17:41 عصر
  4. سوال در بارة یک تابع API (PolyBezier)
    نوشته شده توسط BehnamPro در بخش VB.NET
    پاسخ: 2
    آخرین پست: پنج شنبه 15 آبان 1382, 00:47 صبح
  5. تابع API ارسال پیام در شبکه
    نوشته شده توسط SADAF در بخش شبکه و Networking‌
    پاسخ: 5
    آخرین پست: سه شنبه 22 مهر 1382, 10:38 صبح

برچسب های این تاپیک

قوانین ایجاد تاپیک در تالار

  • شما نمی توانید تاپیک جدید ایجاد کنید
  • شما نمی توانید به تاپیک ها پاسخ دهید
  • شما نمی توانید ضمیمه ارسال کنید
  • شما نمی توانید پاسخ هایتان را ویرایش کنید
  •