우리는 응용 프로그램이 Windows CE 6.0 기반 장치에서 제목 표시 줄없이 전체 화면 모드로 실행되기를 원합니다. 이 응용 프로그램은 .NET Compact Framework 3.5 (C#)를 사용하여 개발 중입니다. 모든 샘플 코드 또는 기사에 대한 포인터가 높이 평가됩니다..NET Compact Framework 3.5를 사용하여 Windows CE 6.0에서 전체 화면 응용 프로그램을 만드는 방법은 무엇입니까?
4
A
답변
5
먼저 P/Invoke를 통해 작업 표시 줄을 숨겨야합니다. 여기 to convert 정말 쉽게해야합니다 C 코드는 다음과 같습니다
HWND hwndTaskbar = ::FindWindow(_T("HHTaskBar"), NULL);
::ShowWindow(hwndTaskbar, SW_HIDE);
당신이, 당신의 디스플레이가 얼마나 큰지를 결정하고 그 크기로 폼의 크기를 조정 Screen.PrimaryScreen를 사용 그렇게되면.
5
사용이 코드 :
public class FullScreenEngine
{
// Fields
private IntPtr _hWndInputPanel;
private IntPtr _hWndSipButton;
private IntPtr _hWndTaskBar;
private Rectangle _desktopArea;
public FullScreenEngine()
{
Init();
}
public bool SetFullScreen(bool mode)
{
try
{
if (mode)
{
if (_hWndTaskBar.ToInt64() != 0L)
{
ShowWindow(_hWndTaskBar, SW_HIDE);
}
if (_hWndInputPanel.ToInt64() != 0L)
{
ShowWindow(_hWndInputPanel, SW_HIDE);
}
if (_hWndSipButton.ToInt64() != 0L)
{
ShowWindow(_hWndSipButton, SW_HIDE);
}
WorkArea.SetWorkArea(new RECT(Screen.PrimaryScreen.Bounds));
}
else
{
if (_hWndTaskBar.ToInt64() != 0L)
{
ShowWindow(_hWndTaskBar, SW_SHOW);
}
if (_hWndInputPanel.ToInt64() != 0L)
{
//ShowWindow(_hWndInputPanel, SW_SHOW);
}
if (_hWndSipButton.ToInt64() != 0L)
{
ShowWindow(_hWndSipButton, SW_SHOW);
}
WorkArea.SetWorkArea(new RECT(_desktopArea));
}
}
catch (Exception)
{
return false;
}
return true;
}
private bool Init()
{
try
{
_desktopArea = Screen.PrimaryScreen.WorkingArea;
_hWndInputPanel = FindWindowW("SipWndClass", null);
_hWndSipButton = FindWindowW("MS_SIPBUTTON", null);
_hWndTaskBar = FindWindowW("HHTaskBar", null);
}
catch (Exception)
{
return false;
}
return true;
}
private const uint SW_HIDE = 0;
private const uint SW_SHOW = 1;
[DllImport("coredll.dll")]
private static extern int ShowWindow(IntPtr hwnd, uint command);
[DllImport("coredll.dll")]
private static extern IntPtr FindWindowW(string lpClassName, string lpWindowName);
// Nested Types
public struct RECT
{
public int Left;
public int Top;
public int Right;
public int Bottom;
public RECT(Rectangle rect) : this()
{
Left = rect.Left;
Right = rect.Left+rect.Width;
Top = rect.Top;
Bottom = rect.Top + rect.Height;
}
}
private static class WorkArea
{
[DllImport("coredll.dll")]
private static extern bool SystemParametersInfo(uint uAction, uint uparam, ref RECT rect, uint fuWinIni);
private const uint WM_SETTINGCHANGE = 0x1a;
const uint SPI_GETWORKAREA = 48;
const uint SPI_SETWORKAREA = 47;
public static bool SetWorkArea(RECT rect)
{
return SystemParametersInfo(SPI_SETWORKAREA, 0, ref rect, WM_SETTINGCHANGE);
}
public static RECT GetWorkArea()
{
var rect = new RECT();
SystemParametersInfo(SPI_GETWORKAREA, 0, ref rect, 0);
return rect;
}
}
}
관련 문제
- 1. .Net Compact Framework 3.5를 사용하여 DataGrid의 조건부 서식 지정
- 2. .Net Compact Framework 응용 프로그램을 현지화하는 가장 빠르고 좋은 방법은 무엇입니까?
- 3. Compact Framework 응용 프로그램을 업그레이드하는 방법은 무엇입니까?
- 4. 응용 프로그램을 배포합니다. NET for Windows Mobile 6.x
- 5. Windows XPE의 .NET Compact Framework
- 6. Windows CE 6.0에서 OnMButtonDblClk를 작동시키는 방법은 무엇입니까?
- 7. Sql Server CE 3.5 및 .NET Compact Framework 2.0 SP2
- 8. .NET Framework 및 .NET Compact Framework에서 라이브러리를 컴파일하는 방법은 무엇입니까?
- 9. Windows 7에서 .net framework 3.5를 구성하는 방법
- 10. Windows CE 6.0에서 IE로 그래프 만들기
- 11. .NET Compact Framework - 데이터베이스
- 12. MFC로 전체 화면 창을 만드는 방법은 무엇입니까?
- 13. Compact Framework - 기본 생성자가없는 형식을 동적으로 만드는 방법은 무엇입니까?
- 14. Windows Forms .NET 응용 프로그램을 트레이 아이콘으로 만드는 방법은 무엇입니까?
- 15. 경량 3D 그래픽 엔진 .NET (Compact Framework 및 Full Framework)
- 16. .NET Compact Framework에서 XElement.Load 네이티브 예외 Windows CE 5.0
- 17. .NET Compact Framework 연결 문자열 암호화/보안
- 18. XAML 및 Windows Mobile (.Net Compact Framework)
- 19. .NET Compact Framework SDK 다운로드
- 20. Windows CE UI Componets
- 21. .NET Compact Framework 인쇄 라이브러리
- 22. RESTful 웹 서비스, .net compact framework 및 많은 HTTP 메소드
- 23. .NET Compact Framework 3.5에서의 SSL 지원
- 24. C#에서 Windows CE 5.0 응용 프로그램을 에뮬레이트/디버그하는 방법은 무엇입니까?
- 25. .NET Compact Framework 용 FParsec를 작성하는 방법은 무엇입니까?
- 26. Windows 응용 프로그램에 .NET Framework 3.5.3이 필요합니다.
- 27. .net Compact Framework 4.0
- 28. .NET Compact Framework 응용 프로그램은 Windows Phone 7과 호환됩니까?
- 29. Compact Framework 타겟팅
- 30. .NET Compact Framework 역 호환성 3.5 및 2.0
는 이러한 API를 호출하기위한 몇 가지 C 번호를 적어주세요 수 있습니다. 죄송 합니다만 P/Invoke에 대해 많이 알지 못합니다. – Gopinath
CF 응용 프로그램을 작성하려면 P/Invoke를 배워야합니다. 주위에는 방법이 없습니다. 이것들은 정말로 간단합니다. 나는 당신을 시작할 수있는 링크를주었습니다. 나는 당신에게 물고기, 낚싯대 만주는 것이 아닙니다. 덕분에 – ctacke
. 나는 P/Invoke를 배우기 시작했다 :) – Gopinath