From 88790eed4ffd9ca555c8f9b73cb014a93b57a34f Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 22 Jun 2015 20:38:56 +0000 Subject: Menu_ModifyItem unbound from CLISTMENUITEM structure git-svn-id: http://svn.miranda-ng.org/main/trunk@14334 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/HTTPServer/src/main.cpp | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'plugins/HTTPServer/src/main.cpp') diff --git a/plugins/HTTPServer/src/main.cpp b/plugins/HTTPServer/src/main.cpp index 7343d10006..bdca6bfcf0 100644 --- a/plugins/HTTPServer/src/main.cpp +++ b/plugins/HTTPServer/src/main.cpp @@ -622,10 +622,8 @@ static int nProtoAck(WPARAM /*wParam*/, LPARAM lParam) { // Developer : KN ///////////////////////////////////////////////////////////////////// -INT_PTR nToggelAcceptConnections(WPARAM wparam, LPARAM /*lparam*/) { - CLISTMENUITEM mi = { 0 }; - mi.flags = CMIM_NAME | CMIM_ICON; - +INT_PTR nToggelAcceptConnections(WPARAM wparam, LPARAM /*lparam*/) +{ if (!hDirectBoundPort) { NETLIBUSERSETTINGS nus = { 0 }; nus.cbSize = sizeof(nus); @@ -644,27 +642,22 @@ INT_PTR nToggelAcceptConnections(WPARAM wparam, LPARAM /*lparam*/) { if (!hDirectBoundPort) { TCHAR szTemp[200]; mir_snprintf(szTemp, TranslateT("Failed to bind to port %s\r\nThis is most likely because another program or service is using this port") , - nlb.wPort == 80 ? "80" : nus.szIncomingPorts); + nlb.wPort == 80 ? "80" : nus.szIncomingPorts); MessageBox(NULL, szTemp, MSG_BOX_TITEL, MB_OK); return 1001; } dwLocalPortUsed = nlb.wPort; dwLocalIpAddress = nlb.dwInternalIP; - mi.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_DISABLE_SERVER)); - mi.ptszName = LPGENT("Disable HTTP server"); + Menu_ModifyItem(hAcceptConnectionsMenuItem, LPGENT("Disable HTTP server"), LoadIcon(hInstance, MAKEINTRESOURCE(IDI_DISABLE_SERVER))); } else if (hDirectBoundPort && wparam == 0) { Netlib_CloseHandle(hDirectBoundPort); hDirectBoundPort = 0; - mi.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_SHARE_NEW_FILE)); - mi.ptszName = LPGENT("Enable HTTP server"); + Menu_ModifyItem(hAcceptConnectionsMenuItem, LPGENT("Enable HTTP server"), LoadIcon(hInstance, MAKEINTRESOURCE(IDI_SHARE_NEW_FILE))); } else return 0; // no changes; - if (hAcceptConnectionsMenuItem) - Menu_ModifyItem(hAcceptConnectionsMenuItem, &mi); - if (! bShutdownInProgress) db_set_b(NULL, MODULE, "AcceptConnections", hDirectBoundPort != 0); -- cgit v1.2.3