码迷,mamicode.com
首页 > Windows程序 > 详细

C# 使用WIN32API设置外部程序窗口无边框

时间:2014-11-20 20:00:26      阅读:490      评论:0      收藏:0      [点我收藏+]

标签:style   blog   ar   color   使用   sp   on   div   log   

使用代码

 var wnd = win32.FindWindowA(null, "窗口标题");
 Int32 wndStyle = win32.GetWindowLong(wnd, win32.GWL_STYLE);
 wndStyle &= ~win32.WS_BORDER;
 wndStyle &= ~win32.WS_THICKFRAME;
 win32.SetWindowLong(wnd, win32.GWL_STYLE, wndStyle);

用到的常量

const int WS_THICKFRAME = 262144; 
const int WS_BORDER = 8388608;

引用的函数

[DllImport("user32.dll")]
public static extern IntPtr FindWindowA(string lpClassName, string lpWindowName);
[DllImport("user32.dll")]
public static extern int GetWindowLong(IntPtr hWnd, int nIndex);
[DllImport("user32.dll")]
public static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong);

 

C# 使用WIN32API设置外部程序窗口无边框

标签:style   blog   ar   color   使用   sp   on   div   log   

原文地址:http://www.cnblogs.com/vonly/p/4111265.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!