上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 25 下一页
摘要: 设置鼠标为手型SetCursor(LoadCursor(0,IDC_HAND)); 阅读全文
posted @ 2013-02-17 13:52 fff8965 阅读(197) 评论(0) 推荐(0) 编辑
摘要: Graphics g = Graphics.FromImage(bm1); 阅读全文
posted @ 2013-02-17 13:19 fff8965 阅读(235) 评论(0) 推荐(0) 编辑
摘要: 使用c++创建窗口程序非常不方便,可以用.net的winform api来创建ui再用c++来粘合程序。c++项目中导入.net方法:项目上右键->公共语言运行时支持选“公共语言运行时支持(/clr)”。也可以直接创建c++的“Windows窗体应用程序项目”如果创建的是Win32项目,那么使用.net中的类有三种方法:1.用using namespace System,相当于c#中的using。2.用#using <System.dll>这样的语法先把类导进来才可以用,#using是c++的.net专用语法,不带公共语言运行时的项目不能用。3.直接在类名的前面加命名空间,如 阅读全文
posted @ 2013-02-16 10:28 fff8965 阅读(831) 评论(0) 推荐(0) 编辑
摘要: Window.GetWindow(【Visual】) 静态方法可以获得任意组件的顶层窗口。 阅读全文
posted @ 2013-01-30 15:28 fff8965 阅读(560) 评论(0) 推荐(0) 编辑
摘要: window = Window.GetWindow(【Visual】);Point offset = 【Visual】.TransformToAncestor(window).Transform(new Point(0, 0))上面代码可以获得任意组件的窗口坐标。获取鼠标相对于任意组件的位置用Mouse.GetPosition(IInputElement relativeTo)或MouseEventArgs.GetPosition(IInputElement relativeTo)获取屏幕鼠标位置用win32apiusing System;using System.Collections.Ge 阅读全文
posted @ 2013-01-30 15:27 fff8965 阅读(1378) 评论(0) 推荐(0) 编辑
摘要: using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows;using System.Windows.Controls;using System.Windows.Data;using System.Windows.Documents;using System.Windows.Input;using System.Windows.Media;using Syste... 阅读全文
posted @ 2013-01-30 09:56 fff8965 阅读(503) 评论(0) 推荐(0) 编辑
摘要: //GDI+为图片的加载、存储,屏蔽了内部编解码、压缩解压缩等的具体细节,给程序员带来了极大的方便 //目前版本的GDI+支持bmp jpeg gif tiff png等几种格式 //下面的程序基本思路是先将目标DC上的内容存到内存BITMAP //再使用GDI+Bitmap::FromHBITMAP加载内存位图,并保存成文件 //此版本在Win32和MFC环境下测试通过 // //使用GDI+ 保存HDC为位图文件 #include <rpc.h> #include <rpcndr.h> #include <unknwn.h> #include <g 阅读全文
posted @ 2013-01-25 16:39 fff8965 阅读(3293) 评论(0) 推荐(0) 编辑
摘要: 在WM_CREATE消息中加上如下代码 SetTimer(hWnd,1,30,NULL); SetTimer(hWnd,2,1000,NULL);就会定时收到消息WM_TIMER,wParam为1的30毫秒一次,wParam为2的1秒一次。 阅读全文
posted @ 2013-01-23 17:39 fff8965 阅读(349) 评论(0) 推荐(0) 编辑
摘要: 在dll项目上右键->属性->配置属性.调试->命令,添上exe文件的路径,设置dll为启动项目,运行后vs就会启动exe并停到断点上。 阅读全文
posted @ 2013-01-22 10:37 fff8965 阅读(245) 评论(0) 推荐(0) 编辑
摘要: 转自:http://www.cnblogs.com/manyou/archive/2012/07/20/2600565.html问题描述:对 PInvoke 函数“xxFunction()”的调用导致堆栈不对称。原因可能是托管的 PInvoke 签名与非托管的目标签名不匹配。请检查 PInvoke 签名的调用约定和参数与非托管的目标签名是否匹配问题解决:1、在c#中函数声明处改一个参数,[DllImport("xx.dll", EntryPoint=“xxFunction”, CallingConvention = CallingConvention.Cdecl)]调用时不 阅读全文
posted @ 2013-01-22 10:35 fff8965 阅读(416) 评论(0) 推荐(0) 编辑
上一页 1 ··· 14 15 16 17 18 19 20 21 22 ··· 25 下一页