扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
作者:IUNKNOW 来源:vchelp 2007年10月21日
关键字:
STDMETHODIMP CCopyright::ShowInfoDlg() STDMETHODIMP CCopyright::MaxWindow() STDMETHODIMP CCopyright::MiniWindow() STDMETHODIMP CCopyright::Test() STDMETHODIMP CCopyright::ShowInfoDlg() { // TODO: Add your implementation code here USES_CONVERSION; CUserInfoDlg dlg; dlg.m_bstrName = m_bstrName; dlg.m_bstrEmail = m_bstrEmail; if(dlg.DoModal() == IDOK) { m_bstrName = dlg.m_bstrName; m_bstrEmail = dlg.m_bstrEmail; } CRegKey reg; reg.Create(HKEY_CURRENT_USER,_T("Software\\Evesoft\\AddIns")); reg.SetValue(OLE2CT(m_bstrName),_T("NAME")); reg.SetValue(OLE2CT(m_bstrEmail),_T("EMAIL")); reg.Close(); return S_OK; } STDMETHODIMP CCopyright::MaxWindow() { // TODO: Add your implementation code here CComPtr<IDispatch> pDispWindows; CComQIPtr<IWindows, &IID_IWindows> pWindows; m_spApplication->get_Windows(&pDispWindows); pWindows = pDispWindows; pDispWindows = NULL; CComPtr<IUnknown> pUnk; CComQIPtr<IEnumVARIANT, &IID_IEnumVARIANT> pNewEnum; if (SUCCEEDED(pWindows->get__NewEnum(&pUnk)) && pUnk != NULL) { pNewEnum = pUnk; VARIANT varWindow; CComQIPtr<IGenericWindow, &IID_IGenericWindow> pWindow; while (pNewEnum->Next(1, &varWindow, NULL) == S_OK) { pWindow = varWindow.pdispVal; VariantClear(&varWindow); CComBSTR bstrCaption; pWindow->get_Caption(&bstrCaption); //dsWindowStateMaximized ×î´ó»¯ pWindow->put_WindowState(dsWindowStateMaximized); } } return S_OK; } STDMETHODIMP CCopyright::MiniWindow() { // TODO: Add your implementation code here CComPtr<IDispatch> pDispWindows; CComQIPtr<IWindows, &IID_IWindows> pWindows; m_spApplication->get_Windows(&pDispWindows); pWindows = pDispWindows; pDispWindows = NULL; CComPtr<IUnknown> pUnk; CComQIPtr<IEnumVARIANT, &IID_IEnumVARIANT> pNewEnum; if (SUCCEEDED(pWindows->get__NewEnum(&pUnk)) && pUnk != NULL) { pNewEnum = pUnk; VARIANT varWindow; CComQIPtr<IGenericWindow, &IID_IGenericWindow> pWindow; while (pNewEnum->Next(1, &varWindow, NULL) == S_OK) { pWindow = varWindow.pdispVal; VariantClear(&varWindow); CComBSTR bstrCaption; pWindow->get_Caption(&bstrCaption); //dsWindowStateMaximized ×î´ó»¯ pWindow->put_WindowState(dsWindowStateMinimized); } } return S_OK; } STDMETHODIMP CCopyright::Test() { // TODO: Add your implementation code here MessageBox(NULL,"Ð»Ð»Ê¹Ó Ã£¬¶¡Ó±ÉÏ","ÖÂл",MB_OK | MB_ICONINFORMATION); return S_OK; } |
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。