Context Menu object reference is re-used each time.
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@1165 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
42bee80396
commit
ba40bb2d26
2 changed files with 11 additions and 10 deletions
|
@ -76,6 +76,7 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrevInst, char *cmdParam, int cmd
|
|||
|
||||
BOOL CALLBACK DialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) {
|
||||
static HINSTANCE hRichEditDLL = 0;
|
||||
static HMENU hmnu = 0;
|
||||
if (!hRichEditDLL) hRichEditDLL= LoadLibrary("RichEd32.dll");
|
||||
switch (msg) {
|
||||
case WM_INITDIALOG:
|
||||
|
@ -122,15 +123,15 @@ BOOL CALLBACK DialogProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) {
|
|||
case WM_CONTEXTMENU:
|
||||
{
|
||||
if ((HWND)wParam==GetDlgItem(g_hwnd,IDC_LOGWIN)) {
|
||||
HMENU m = LoadMenu(g_hInstance,MAKEINTRESOURCE(IDM_LOGWIN));
|
||||
if (m) {
|
||||
HMENU s = GetSubMenu(m,0);
|
||||
if (s) {
|
||||
int xPos,yPos;
|
||||
xPos = (int)(short)LOWORD(lParam);
|
||||
yPos = (int)(short)HIWORD(lParam);
|
||||
TrackPopupMenu(s,NULL,xPos,yPos,0,g_hwnd,0);
|
||||
}
|
||||
if (!hmnu) {
|
||||
hmnu = LoadMenu(g_hInstance,MAKEINTRESOURCE(IDM_LOGWIN));
|
||||
if (hmnu) hmnu = GetSubMenu(hmnu,0);
|
||||
}
|
||||
if (hmnu) {
|
||||
int xPos,yPos;
|
||||
xPos = (int)(short)LOWORD(lParam);
|
||||
yPos = (int)(short)HIWORD(lParam);
|
||||
TrackPopupMenu(hmnu,NULL,xPos,yPos,0,g_hwnd,0);
|
||||
}
|
||||
}
|
||||
return TRUE;
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#undef _RICHEDIT_VER
|
||||
|
||||
// Defines
|
||||
#define NSIS_URL "http://sourceforge.net/projects/nsis/"
|
||||
#define NSIS_URL "http://nsis.sourceforge.net/"
|
||||
#define USAGE "Usage:\r\n\r\n - File | Load Script...\r\n - Drag the .nsi file into this window\r\n - Right click the .nsi file and choose \"Compile NSI\""
|
||||
#define COPYRIGHT "Copyright (c) 2002 Robert Rainwater"
|
||||
#define DOCPATH "http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/*checkout*/nsis/NSIS/docs/index.html?rev=HEAD"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue