[DllImport("coredll.dll")]
private static extern int FindWindow(string lpClassName, string lpWindowName);
[DllImport("coredll.dll")]
internal extern static int EnableWindow(int hwnd, int fEnable);
[DllImport("coredll.dll")]
public static extern int ShowWindow(int hwnd, int nCmdShow);
int hTaskBarWnd;
谢谢你的回复,但[DllImport("coredll.dll")]在vs2005里总是报错,错误如下
d:\my documents\visual studio 2005\projects\rfid1\rfid1\rfid1Dlg.h(33) : error C2337: 'DllImport' : attribute not found
请问你这个是用在C#里的么,这段代码放在哪个文件里面呢?
下面是一个例子,去掉无关的信息。
using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.IO;
using System.Diagnostics;
namespace TQBeep
{
public partial class Beep : Form
{
[DllImport("coredll.dll")]
private static extern int FindWindow(string lpClassName, string lpWindowName);//×′ì¬à¸2ù×÷
[DllImport("coredll.dll")]
internal extern static int EnableWindow(int hwnd, int fEnable);
[DllImport("coredll.dll")]
public static extern int ShowWindow(int hwnd, int nCmdShow);
int hTaskBarWnd;