12 2014 档案

摘要:原文地址:http://www.csharpwin.com/csharpspace/10656r1776.shtml防止程序运行多个实例的方法有多种,如:通过使用互斥量和进程名等.而我想要实现的是:在程序运行多个实例时激活的是第一个实例,使其获得焦点,并在前端显示.主要用到两个API 函数:Show... 阅读全文
posted @ 2014-12-17 16:13 E1ement 阅读(203) 评论(0) 推荐(0) 编辑
摘要:public partial class Form1 : Form { public Form1() {InitializeComponent(); SetProcessDPIAware(); //重要 IntPtr screenDC = GetDC(IntPtr.Zero); int dpi_x... 阅读全文
posted @ 2014-12-17 15:10 E1ement 阅读(557) 评论(0) 推荐(0) 编辑
摘要:屏幕PPI计算: (White^2+Height^2)^0.5/屏幕大小英寸数毫米和像素换算: mm=(px/dpi)*25.4px=(mm*dpi)/25.4 英寸=px/dpi 1英寸=25.4毫米dpi获取:方法1.using (Graphics graphic... 阅读全文
posted @ 2014-12-17 15:08 E1ement 阅读(6868) 评论(0) 推荐(0) 编辑