求一个c#.net小程序

包含开发说明借鉴学习一下flk1987@163.com
2024年11月15日 10:44
有2个网友回答
网友(1):

全屏幕黑色
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

网友(2):

什么要求都没有?