自己动手实现动态外网ip管理和动态DNS域名解析 (三)

2014-11-24 12:06:12 · 作者: · 浏览: 7
h;

strFolder += "\\autoupdateip\\";

if (!CreateDirectory(strFolder,NULL) && GetLastError() != ERROR_ALREADY_EXISTS)

{

MessageBox(_T("创建临时目录失败!"));

return _T("");

}

return strFolder + c_szSettingFilename;

}

LRESULT CUpdateIpDlg::OnNotifyIcon(WPARAM wParam,LPARAM IParam)

{

if ((IParam == WM_LBUTTONDOWN) || (IParam == WM_RBUTTONDOWN))

{

ModifyStyleEx(0,WS_EX_TOPMOST);

ShowWindow(SW_RESTORE);

//Shell_NotifyIcon(NIM_DELETE, &NotifyIcon);

}

return 0;

}

void CUpdateIpDlg::addNotification(){

NotifyIcon.cbSize=sizeof(NOTIFYICONDATA);

NotifyIcon.hIcon=AfxGetApp()->LoadIcon(IDR_MAINFRAME);

NotifyIcon.hWnd=m_hWnd;

lstrcpy(NotifyIcon.szTip,_T("Auto Update IP by weibin"));

NotifyIcon.uCallbackMessage=WM_NC;

NotifyIcon.uFlags=NIF_ICON | NIF_MESSAGE | NIF_TIP;

Shell_NotifyIcon(NIM_ADD,&NotifyIcon);

}

摘自 brainy