2009-06-01 5 views
1

Windows Mobile에서 연락처 컨텍스트 메뉴를 확장하고 싶습니다. 사용자가 전화 걸기 및 기타 기능이있는 연락처를 마우스 오른쪽 단추로 클릭 할 때 내 사용자 지정 프로그램을 실행하기 위해 내 항목을 확장하고 추가하려고합니다.windows에서 컨텍스트 메뉴 확장 모바일 연락처

답변

1

나는 또 다른 012,336 발견여기가 너에게 맞을 것 같아.

// Initialize the below code snippet in the beginning of the class 
internal struct SHRGINFO 
{ 
public int cbSize; 
public IntPtr hwndClient; 
public int ptDownX; 
public int ptDownY; 
public SHRGFLags dwFlags; 
} 

[Flags] 
internal enum SHRGFLags 
{ 
SHRG_RETURNCMD = 0x00000001, 
SHRG_NOTIFYPARENT = 0x00000002, 
SHRG_LONGDELAY = 0x00000008, 
SHRG_NOANIMATION = 0x00000010, 
} 
[DllImport("aygshell")] 
extern private static int SHRecognizeGesture(ref SHRGINFO shr); 

[DllImport("coredll.dll", SetLastError = true)] 
public static extern IntPtr GetActiveWindow(); 


//call the showContMenu() method in Mouseup or MouseDown event 
public void showContMenu(int x, int y) 
{ 
SHRGINFO shr = new SHRGINFO(); 
shr.cbSize = Marshal.SizeOf(typeof(SHRGINFO)); 
shr.dwFlags = SHRGFLags.SHRG_RETURNCMD; 
shr.ptDownX = x; 
shr.ptDownY = y; 
shr.hwndClient = GetActiveWindow(); 

int ret = SHRecognizeGesture(ref shr); 

if (ret == 1000) 
contextMenu1.Show(this, new System.Drawing.Point(x, y)); 

} 
3

당신이 Windows Mobile 5 SDK를 설치하는 경우, 당신은 몇 가지 관련 샘플을 발견 할 것이다 :

C :

  • 포켓 PC \ CPP \ Win32에서

    • Callingcard \ \ 프로그램 파일 \ 윈도우 모바일 5.0 SDK \ 샘플 InboxMenuExtensibility
    • ReadViewMenuExt는