用wince开发手机软件,手机全屏怎么设置,不要任务栏、命令栏和输入法(c#代码) 用wince开发手机软件,手机全屏怎么设置,不要任务栏、命令栏和输入法(c#代码) 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 需要使用coredll里的那些个windowsAPI。FindWindows什么的。及不清楚了。 public class FullScreenMgn { public const int SPI_SETWORKAREA = 47; public const int SPI_GETWORKAREA = 48; public const int SW_HIDE = 0x00; public const int SW_SHOW = 0x0001; public const int SPIF_UPDATEINIFILE = 0x01; [DllImport("coredll.dll", EntryPoint = "FindWindow")] private static extern IntPtr FindWindow(string lpWindowName, string lpClassName); [DllImport("coredll.dll", EntryPoint = "ShowWindow")] private static extern bool ShowWindow(IntPtr hwnd, int nCmdShow); [DllImport("coredll.dll", EntryPoint = "SystemParametersInfo")] private static extern int SystemParametersInfo(int uAction, int uParam, ref Rectangle lpvParam, int fuWinIni); /// <summary> /// 设置全屏或取消全屏 /// </summary> /// <param name="fullscreen">true:全屏 false:恢复</param> /// <param name="rectOld">设置的时候,此参数返回原始尺寸,恢复时用此参数设置恢复</param> /// <returns>设置结果</returns> public static bool SetFullScreen(bool fullscreen, ref Rectangle rectOld) { //IntPtr Hwnd = 0; IntPtr Hwnd = FindWindow("HHTaskBar", null); if (Hwnd == IntPtr.Zero) return false; if (fullscreen) { ShowWindow(Hwnd, SW_HIDE); Rectangle rectFull = Screen.PrimaryScreen.Bounds; SystemParametersInfo(SPI_GETWORKAREA, 0, ref rectOld, SPIF_UPDATEINIFILE);//get SystemParametersInfo(SPI_SETWORKAREA, 0, ref rectFull, SPIF_UPDATEINIFILE);//set } else { ShowWindow(Hwnd, SW_SHOW); SystemParametersInfo(SPI_SETWORKAREA, 0, ref rectOld, SPIF_UPDATEINIFILE); } return true; } } 调用SetFullScreen方法时后面那个参数怎么取得? 3楼贴的代码哪里看到的。呵呵。我写的。调用方法你需要在一开始非全屏时候记录下非全屏时候的工作区域。Rectangle rect;SetFullScreen(true,ref rect);取消SetFullScreen(false,ref rect); 怎么条语句有错啊 [DllImport("coredll.dll", EntryPoint = "FindWindow")];错误 1 应输入类型 错误 2 类、结构或接口成员声明中的标记“;”无效 添加命名空间引用鼠标点击DllImport这个单词,移动一下,右下角有一个按钮出现,点击,选择添加引用。 上传到csdn下载了。你下载就可以看到效果。[C#]wince/mobile下的全屏和取消方法http://download.csdn.net/source/2855505 C#可创建方框可拖曳并用线标识方框间的关系 如何开发(附图)? 数据库到底在开发怎么使用的 转码问题! 寻找 CPU脖子100%的问题的解决方案 winform程序中智能提示怎么做? 如何用代码设置DataGrid的列宽度? 请问提示“该服务器不愿意处理该请求。”是什么错误? 一个关于刷新的问题? 在C#里如何用程序自动生成一篇WORD文档? c#中如何重载一个函数 如何在datagridview中添加数据库中没有的新字段? wince 窗体全屏显示问题(C#开发)
FindWindows什么的。
及不清楚了。
public class FullScreenMgn
{
public const int SPI_SETWORKAREA = 47;
public const int SPI_GETWORKAREA = 48;
public const int SW_HIDE = 0x00;
public const int SW_SHOW = 0x0001;
public const int SPIF_UPDATEINIFILE = 0x01;
[DllImport("coredll.dll", EntryPoint = "FindWindow")]
private static extern IntPtr FindWindow(string lpWindowName, string lpClassName);
[DllImport("coredll.dll", EntryPoint = "ShowWindow")]
private static extern bool ShowWindow(IntPtr hwnd, int nCmdShow);
[DllImport("coredll.dll", EntryPoint = "SystemParametersInfo")]
private static extern int SystemParametersInfo(int uAction, int uParam, ref Rectangle lpvParam, int fuWinIni); /// <summary>
/// 设置全屏或取消全屏
/// </summary>
/// <param name="fullscreen">true:全屏 false:恢复</param>
/// <param name="rectOld">设置的时候,此参数返回原始尺寸,恢复时用此参数设置恢复</param>
/// <returns>设置结果</returns>
public static bool SetFullScreen(bool fullscreen, ref Rectangle rectOld)
{
//IntPtr Hwnd = 0;
IntPtr Hwnd = FindWindow("HHTaskBar", null);
if (Hwnd == IntPtr.Zero) return false;
if (fullscreen)
{
ShowWindow(Hwnd, SW_HIDE);
Rectangle rectFull = Screen.PrimaryScreen.Bounds;
SystemParametersInfo(SPI_GETWORKAREA, 0, ref rectOld, SPIF_UPDATEINIFILE);//get
SystemParametersInfo(SPI_SETWORKAREA, 0, ref rectFull, SPIF_UPDATEINIFILE);//set
}
else
{
ShowWindow(Hwnd, SW_SHOW);
SystemParametersInfo(SPI_SETWORKAREA, 0, ref rectOld, SPIF_UPDATEINIFILE);
}
return true;
} }
调用方法你需要在一开始非全屏时候记录下非全屏时候的工作区域。
Rectangle rect;
SetFullScreen(true,ref rect);取消
SetFullScreen(false,ref rect);
错误 1 应输入类型
错误 2 类、结构或接口成员声明中的标记“;”无效
鼠标点击DllImport这个单词,移动一下,右下角有一个按钮出现,点击,选择添加引用。
[C#]wince/mobile下的全屏和取消方法
http://download.csdn.net/source/2855505