Copy detail view contents on CTRL-C (removed the popup context menu approach since it wasn't language independent). This code sucks, please improve it :)

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@841 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
sunjammerx 2002-08-30 23:06:19 +00:00
parent 1518061acf
commit 88d1eb693f

View file

@ -1405,24 +1405,14 @@ static BOOL CALLBACK InstProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
}
}
//>>>Ximon Eighteen aka Sunjammer 30th August 2002
//+++Popup "Copy Details To Clipboard" menu when RMB clicked in DetailView
//+++Currently this has no language support for the popup menu text, I'm
//+++looking to possibly change this code to work off CTRL-C instead of a
//+++popup menu to avoid the language problem.
if (uMsg == WM_NOTIFY && ((NMHDR*)lParam)->code == NM_RCLICK)
//+++If CTRL-C is pressed (yeah I know this has got to be the most stupid
//+++way to test for this) copy the DetailPrint'd strings to the clipboard.
if (uMsg == WM_NOTIFY && ((NMHDR*)lParam)->code == LVN_KEYDOWN &&
((VK_CONTROL == ((NMLVKEYDOWN*)lParam)->wVKey && GetKeyState('C') == -127) ||
('C' == ((NMLVKEYDOWN*)lParam)->wVKey && GetKeyState(VK_CONTROL) == -127)))
{
int count = ListView_GetItemCount(insthwnd);
if (count > 0)
{
DWORD pos = GetMessagePos();
HMENU menu = CreatePopupMenu();
AppendMenu(menu,MF_STRING,1,"Copy Details To Clipboard");
if (1==TrackPopupMenu(
menu,
TPM_NONOTIFY|TPM_RETURNCMD,
GET_X_LPARAM(pos),
GET_Y_LPARAM(pos),
0,insthwnd,0))
{
char textBuf[1024];
int i,total = 0;
@ -1461,7 +1451,6 @@ static BOOL CALLBACK InstProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPa
CloseClipboard();
}
}
}
//<<<
return HandleStaticBkColor();
}