码迷,mamicode.com
首页 >  
搜索关键字:dllimport    ( 445个结果
winform 移动窗体,和窗体阴影(引用)
无边框窗体移动://窗体移动API [DllImport("user32.dll")] public static extern bool ReleaseCapture(); [DllImport("user32.dll")] public static extern bool SendMessag ...
分类:移动开发   时间:2016-12-11 23:14:02    阅读次数:270
winfrom的两种拖拽方式和界面阴影
//窗体阴影API const int CS_DropSHADOW = 0x20000; const int GCL_STYLE = (-26); [DllImport("user32.dll", CharSet = CharSet.Auto)] public static extern int S ...
分类:Windows程序   时间:2016-12-11 18:02:58    阅读次数:198
用C#调用Windows API向指定窗口发送按键消息
一、调用Windows API。 C#下调用Windows API方法如下: 1、引入命名空间:using System.Runtime.InteropServices; 2、引用需要使用的方法,格式:[DllImport("DLL文件")]方法的声明; [DllImport("user32.dll ...
分类:Windows程序   时间:2016-11-26 09:36:18    阅读次数:275
winform控件在Enable=false的情况下改变它的字体颜色
[System.Runtime.InteropServices.DllImport("user32.dll ")] public static extern int SetWindowLong(IntPtr hWnd, int nIndex, int wndproc); [System.Runtim ...
分类:Windows程序   时间:2016-11-11 20:30:11    阅读次数:346
C# 解决调用winform窗体顶置且解决任务栏图片显示问题
窗体顶置两种方法:方法1:///<summary>///设置当前活动的窗口///</summary>[DllImport("user32.dll",CharSet=CharSet.Auto)]privatestaticexternintSetWindowPos(IntPtrhWnd,inthWndInsertAfter,intx,inty,intWidth,intHeight,intflags);///<summary>///得..
分类:Windows程序   时间:2016-11-09 13:28:41    阅读次数:241
2013-7-22判断键盘上某键抬起按下状态
[DllImport("user32.dll", CharSet = CharSet.Auto)] public static extern short GetAsyncKeyState(int nVirtKey); if (GetAsyncKeyState(40) < 0) //40为下箭头对应键 ...
分类:其他好文   时间:2016-10-15 22:13:09    阅读次数:109
2016.5.30让窗口处于最顶层的方法,比TopMost灵活
最简单的方法Form. Activate() 稍复杂的方法用API,目前没有看出比第一种方法有什么好处(可操作其它窗口,这就是好处2016.7.31) [System.Runtime.InteropServices.DllImport("user32.dll", EntryPoint = "SetF ...
分类:其他好文   时间:2016-10-15 19:42:38    阅读次数:110
2015.3.5 VS2005调用VC6 dll 时结构参数的传递
结构只能以地址方式进行传递,dll只能传递结构不能传递类 VS端: [DllImport(@"D:\程序\VC程序\MfcDllspace\Debug\space.dll")] private static extern bool PassStruct(IntPtr skintptr); [Stru ...
分类:其他好文   时间:2016-10-15 19:32:49    阅读次数:120
2015.4.21 SetWindowPos函数用法
定义:[DllImport("user32.dll")] public static extern bool SetWindowPos(IntPtr hWnd, int hWndlnsertAfter, int X, int Y, int cx, int cy, uint Flags); 调用:AP ...
分类:Windows程序   时间:2016-10-15 19:16:24    阅读次数:217
C#控制其它程序
[DllImport("user32.dll", EntryPoint = "FindWindow", SetLastError = true)] private static extern IntPtr FindWindow(string lpClassName, string lpWindowN ...
分类:Windows程序   时间:2016-09-27 17:48:17    阅读次数:249
445条   上一页 1 ... 18 19 20 21 22 ... 45 下一页
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!