求一个c#.net小程序

包含开发说明借鉴学习一下flk1987@163.com... 包含开发说明
借鉴学习一下
flk1987@163.com
展开
 我来答
elicui
2007-12-29
知道答主
回答量:5
采纳率:0%
帮助的人:0
展开全部
全屏幕黑色
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;

namespace WindowsApplication12
{
public partial class Form1 : Form
{
public Form1 ()
{
InitializeComponent ();
}

public const int HWND_NOTOPMOST= -2;

public const int SWP_SHOWWINDOW=0x0040;
[DllImport("user32.dll")]
private static extern IntPtr FindWindowEx(int hwnd2, int hWnd2, string lpsz1, string lpsz2);
[DllImport("user32.dll")]
private static extern int GetWindowLong (IntPtr hwnd, int nIndex);
[DllImport("user32.dll")]
private static extern int SetWindowPos(IntPtr hwnd, int hWndInsertAfter, int x, int y, int cx, int cy, int wFlags);
private void Form1_Load(object sender, EventArgs e)
{
IntPtr test = FindWindowEx(0, 0, "Shell_TrayWnd", "");
Console.WriteLine(test.ToString());

int test5 = SetWindowPos(test, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_SHOWWINDOW);

this.TopMost = true;
this.FormBorderStyle = FormBorderStyle.None;

this.Width = Screen.PrimaryScreen.Bounds.Width;
this.Height = Screen.PrimaryScreen.Bounds.Height;
this.Top = 0;
this.Left = 0;
}
}
}

WindowsState选Max,FormBorderStyle选None可以实现全屏,如果想在中间需要根据运行电脑的分辨率计算
或者使用DirectShow

参考资料: funlove9 :C# 程序全屏幕黑色的方法

christiankula
2008-01-11 · TA获得超过1007个赞
知道小有建树答主
回答量:1275
采纳率:0%
帮助的人:0
展开全部
什么要求都没有?
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式