优化左键点击Yama托盘图标的效果

This commit is contained in:
yuanyuanxiang
2019-05-08 11:47:55 +08:00
parent e31c88b59c
commit 7005d80ead
3 changed files with 16 additions and 3 deletions

View File

@@ -207,3 +207,6 @@ TestRun在写入开机自启动项时先提升权限以防止因权限不足
2019.5.7 2019.5.7
1、添加对远程IP使用域名时的支持若IP为域名先将域名进行解析后再连接。 1、添加对远程IP使用域名时的支持若IP为域名先将域名进行解析后再连接。
2、添加文档“使用花生壳.txt”介绍了如何使用花生壳软件搭建远程监控系统。 2、添加文档“使用花生壳.txt”介绍了如何使用花生壳软件搭建远程监控系统。
2019.5.8
优化左键点击Yama托盘图标的效果。

View File

@@ -91,6 +91,11 @@ IOCPClient::~IOCPClient()
inline string GetIPAddress(const char *hostName) inline string GetIPAddress(const char *hostName)
{ {
struct hostent *host = gethostbyname(hostName); struct hostent *host = gethostbyname(hostName);
#ifdef _DEBUG
printf("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>IP<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ: %s.\n", host->h_addrtype == AF_INET ? "IPV4" : "IPV6");
for (int i = 0; host->h_addr_list[i]; ++i)
printf("<EFBFBD><EFBFBD>ȡ<EFBFBD>ĵ<EFBFBD>%d<><64>IP: %s\n", i+1, inet_ntoa(*(struct in_addr*)host->h_addr_list[i]));
#endif
return host ? inet_ntoa(*(struct in_addr*)host->h_addr_list[0]) : ""; return host ? inet_ntoa(*(struct in_addr*)host->h_addr_list[0]) : "";
} }

View File

@@ -186,10 +186,15 @@ void CMy2015RemoteDlg::OnIconNotify(WPARAM wParam, LPARAM lParam)
{ {
switch ((UINT)lParam) switch ((UINT)lParam)
{ {
case WM_LBUTTONDOWN: case WM_LBUTTONDOWN:
case WM_LBUTTONDBLCLK:
{ {
ShowWindow(IsWindowVisible() ? SW_HIDE : SW_SHOW); if (IsIconic())
{
ShowWindow(SW_NORMAL);
break;
}
ShowWindow(IsWindowVisible() ? SW_HIDE : SW_SHOWNORMAL);
SetForegroundWindow();
break; break;
} }
case WM_RBUTTONDOWN: case WM_RBUTTONDOWN: