PDA 프로그램을 개발하다보면 고객의 요구에 의해 inputpanel을 사용해야 하는 경우가 있습니다.
화면 디자인에 따라 inputpanel의 위치를 이동을 해야 할 때 사용 할 수 있는 예제 코드이오니 참고하세요...
using System.Runtime.InteropServices;
[DllImport("coredll.dll")]
private static extern bool SipSetInfo(ref SIPINFO pSipInfo);
[DllImport("coredll.dll")]
private static extern bool SipGetInfo(ref SIPINFO pSipInfo);
private struct SIPINFO
{
public Int32 cbSize;
public Int32 fdwFlags;
public RECT rcVisibleDesktop;
public RECT rcSipRect;
public Int32 dwImDataSize;
public Int32 pvImData;
}
private struct RECT
{
public Int32 left;
public Int32 top;
public Int32 right;
public Int32 bottom;
}
public void SetPosition(Int32 top, Int32 left)
{
SIPINFO mySi = new SIPINFO();
bool result = true;
mySi.cbSize = System.Runtime.InteropServices.Marshal.SizeOf(typeof(SIPINFO));
result = SipGetInfo(ref mySi);
mySi.rcSipRect.top = top;
mySi.rcSipRect.left = left;
mySi.rcSipRect.bottom = top + 80;
result = SipSetInfo(ref mySi);
}
private void button_Click(object sender, EventArgs e)
{
SetPosition(120, 0);
}
'C#' 카테고리의 다른 글
[C#]텍스트 파일의 라인수 구하기 예제 (0) | 2016.01.28 |
---|---|
[C#]폼 또는 프로그램 종료, 닫히는 원인 확인하는 예제 (0) | 2016.01.28 |
[C#/PDA]작업표시줄(Taskbar) 활성화/비활성화 예제 (0) | 2016.01.28 |
[C#]문자열에서 숫자 여부 확인 예제 (0) | 2016.01.28 |
[C#]텍스트 박스에 숫자만 입력할 수 있는 예제 (0) | 2016.01.28 |