wince 窗体全屏显示问题(C#开发)
我希望达到的效果是:全屏显示,不要任务栏、命令栏和输入法
下面是我写的代码但是没任何效果,忘高手指点
还有点就是MoveWindow方法里面的参数应该怎么取得?
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 SmartDeviceProject1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
const uint SHFS_SHOWTASKBAR = 0x0001;
const uint SHFS_HIDETASKBAR = 0x0002;
const uint SHFS_SHOWSIPBUTTON = 0x0004;
const uint SHFS_HIDESIPBUTTON = 0x0008;
const uint SHFS_SHOWSTARTICON = 0x0010;
const uint SHFS_HIDESTARTICON = 0x0020;
const int SW_HIDE = 0x00;
const int SW_SHOW = 0x0001;
[DllImport("aygshell.dll")]
static extern uint SHFullScreen(IntPtr hwndRequester, uint dwState);
[DllImport("coredll.dll")]
public static extern IntPtr GetCapture();
[DllImport("coredll.Dll", EntryPoint = "MoveWindow")]
public static extern int MoveWindow(IntPtr hwnd, int x, int y, int nWidth, int nHeight, bool bRepaint);
[DllImport("coredll.Dll")]
public static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
private void Form1_Load(object sender, EventArgs e)
{
IntPtr hwnd = GetCapture();
// MoveWindow(hwnd, 50, 0, 0, 50, true);
SHFullScreen(hwnd, SHFS_HIDETASKBAR | SHFS_HIDESIPBUTTON);//隐藏工具条和输入法
ShowWindow(hwnd, SW_HIDE);
}
}
}