码迷,mamicode.com
首页 >  
搜索关键字:dllimport    ( 445个结果
C#获取设备的IP和Mac类
/// /// 此类用于获得设备的Ip和Mac /// public class Mac { [DllImport("Iphlpapi.dll")] private static extern int SendARP(Int32 dest, ...
分类:Windows程序   时间:2015-06-16 12:23:34    阅读次数:167
Treat wchar_t as built-in type不一致导致的链接错误
今天用VS2013新建了一个工程,生成时出现很多怪异的链接错误,比如:error LNK2019: unresolved external symbol "__declspec(dllimport) public: static class MTString __cdecl MTString::fr...
分类:其他好文   时间:2015-06-15 21:51:38    阅读次数:104
[原]C#与非托管——初体验
P/Invokes初看起来非常简单,利用DllImport进行extern函数的声明,程序就可以在调用extern函数的时候自动查询调用到对应的非托管函数,有些类似Java的native函数,但更为简单,不需要编写相应的C函数导出。例如 [DllImport(LIB, CallingConventi...
分类:Windows程序   时间:2015-06-07 21:33:36    阅读次数:134
C# 控制台窗口的显示与隐藏
1. 定义一个Consolse帮助类,如下:[csharp]view plaincopy//////控制台帮助类///publicstaticclassConsoleHelper{//////获取窗口句柄////////////[DllImport("user32.dll",SetLastError...
分类:Windows程序   时间:2015-06-06 13:25:04    阅读次数:292
用C#调用Windows API向指定窗口发送按键消息
用C#调用Windows API向指定窗口发送消息一、调用Windows API。 C#下调用Windows API方法如下: 1、引入命名空间:using System.Runtime.InteropServices; 2、引用需要使用的方法,格式:[DllImport("DLL文件")]方法的声...
分类:Windows程序   时间:2015-06-03 15:24:43    阅读次数:215
C# winform 右下角弹出窗口结果
usingSystem.Runtime.InteropServices;[DllImport("user32")]privatestaticexternboolAnimateWindow(IntPtr hwnd, intdwTime, intdwFlags);//下面是可用的常量,按照不合的动画结果...
分类:Windows程序   时间:2015-06-02 19:32:08    阅读次数:137
[工具-005] C#如何绑定HotKey
由于某种需要,需要做一个控制鼠标在屏幕乱点的程序,运用C#的[DllImport("user32.dll")]private static extern int mouse_event(int dwFlags, int dx, int dy, int cButtons, int dwExtraI.....
分类:Windows程序   时间:2015-06-01 20:14:22    阅读次数:140
手写定时器
/// /// 关键代码 /// /// [System.Runtime.InteropServices.DllImport("kernel32.dll")] static extern uint GetTickCount(); static void Delay(uint ms) { uin...
分类:其他好文   时间:2015-06-01 00:44:41    阅读次数:143
窗体去掉边框后不能拖动的问题
在C# WinForm中,边框不显示就会造成窗体无法拖动的情况,把下边的代码添加上去就可以解决。1.导入命名空间using System.Runtime.InteropServices;2.输入如下代码[DllImport("user32.dll")]public static extern boo...
分类:Windows程序   时间:2015-05-31 19:56:34    阅读次数:122
[转]WPF实现MDI窗体的方法
(效果不是很好,仅供参考)第一:新建一个类Win32Native,引入win32的外部函数。代码如下: public class Win32Native { [System.Runtime.InteropServices.DllImport("user32.dll", EntryPoint ...
分类:Windows程序   时间:2015-05-28 15:51:23    阅读次数:402
445条   上一页 1 ... 28 29 30 31 32 ... 45 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!