From 31e98290178b61a4fd32b5926ac2a0f37a0838b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Nicolaysen=20S=C3=B8rnes?= Date: Wed, 4 Jul 2007 14:14:02 +0200 Subject: [PATCH] wordpad: Disable copy/cut in menu when appropriate. --- programs/wordpad/wordpad.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/programs/wordpad/wordpad.c b/programs/wordpad/wordpad.c index 1b859b775da..9f0fdf8a722 100644 --- a/programs/wordpad/wordpad.c +++ b/programs/wordpad/wordpad.c @@ -778,6 +778,11 @@ static LRESULT OnInitPopupMenu( HWND hWnd, WPARAM wParam, LPARAM lParam ) PARAFORMAT pf; int nAlignment = -1; REBARBANDINFOW rbbinfo; + int selFrom, selTo; + + SendMessageW(hEditorWnd, EM_GETSEL, (WPARAM)&selFrom, (LPARAM)&selTo); + EnableMenuItem(hMenu, ID_EDIT_COPY, MF_BYCOMMAND|(selFrom == selTo) ? MF_GRAYED : MF_ENABLED); + EnableMenuItem(hMenu, ID_EDIT_CUT, MF_BYCOMMAND|(selFrom == selTo) ? MF_GRAYED : MF_ENABLED); pf.cbSize = sizeof(PARAFORMAT); SendMessageW(hwndEditor, EM_GETPARAFORMAT, 0, (LPARAM)&pf);