Log in

View Full Version : Extending Context menu for Windows mobile 5.0 Samrtphone of Contacts


kamii47
07-29-2006, 11:19 AM
Could any body give me a smaple for Extending Context menu for Windows mobile 5.0 Samrtphone Contacts Menu.

I have coverted an application from windows mobile 5.0 pocket pc to windows mobile 5.0 smartphone

I Have use CePimCommand.

void CePimCommand (HWND hWnd, PIMTYPE ptData, UINT uDataCount,

HANDLE *rghData, void *pReserved)

{
if (uDataCount > 0)
{

WNDCLASS wc;

memset(&wc, 0, sizeof(wc));


wc.style = 0;

wc.lpfnWndProc = (WNDPROC) WndProc;

wc.hInstance = g_hInst;

wc.hIcon = 0;

wc.hCursor = 0;

wc.hbrBackground = (HBRUSH) GetStockObject(WHITE_BRUSH);

wc.lpszClassName = DummyWindow1;


RegisterClass(&wc);


if(!CreateWindow(DummyWindow1, DummyWindow1, 0,

CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,

NULL, NULL, g_hInst, NULL))

{

}

else

{

HWND wnd = FindWindow(DummyWindow, DummyWindow);

SendMessage(wnd, WM_TEST, 0, 0);

PostMessage(hNetClient, WM_EDIT_CONTACT_EXT, (CEOID) *rghData, 0);

}

}

}


and this is my class

class CContextMenuSample : public IContextMenu, IObjectWithSite
{

public:
// constructors
CContextMenuSample();

// destructor
~CContextMenuSample();

// IUnknown methods
STDMETHOD (QueryInterface) (REFIID riid, LPVOID *ppv);
STDMETHOD_(ULONG, AddRef) (void);
STDMETHOD_(ULONG, Release) (void);

// IContextMenu methods
STDMETHOD (GetCommandString) (UINT idCmd, UINT uFlags, UINT *pwReserved,
LPSTR pszName, UINT cchMax);
STDMETHOD (InvokeCommand) (LPCMINVOKECOMMANDINFO pici);
STDMETHOD (QueryContextMenu) (HMENU hmenu, UINT indexMenu, UINT idCmdFirst,
UINT idCmdLast, UINT uFlags);

// IObjectWithSite methods
STDMETHOD (GetSite) (REFIID riid, void **ppvSite);
STDMETHOD (SetSite) (IUnknown *pUnkSite);

// CContextMenuSample methods
// None

protected:
ULONG m_cRef; // reference count
IUnknown *m_punkSite; // site (owner) pointer

};


What Can I do ??

thedinplug
11-08-2006, 08:55 AM
Hello kamii47,

Sorry I cannot help you but I would infact like to do the exact same thing so would be interested to see how you get on. If I find out more information I will let you know.

Thanks.

Ian.