|
IWebBrowser interface notifies the window some events, such as DocumentComplete, NavigateComplete, BeforeNavigate, DownloadComplete etc. 'DocumentComplete' will be notified when a document is completely loaded into browser. Then you can get a IDispatch pointer to the loaded document by calling IWebBrowser::get_Documet(). In the case of Word, you will get IDispatch pointer to the _Document interface of Object Model of MS Word Application. See Object Model of MS Word by opening it's type library (MSWORD.OLB) using OLEView.exe tool of Visual Studio. _Document has methods put_Saved() & get_Saved(). You can create wrapper classes for the required interfaces of that Object model.
following is the rough code..
IDispatch *pDsip = 0;
IWebBrowser::get_Document(&pDisp);
_Document wordDoc(pDisp); //_Document is the wrapper for _Document interface
if(!wordDoc.get_Saved())
{
//Message here..
//Call wordDoc.Save to save document
}
Investigate on Word interfaces to do something to hide tool bar.. Its possible.
Hope this will help u..
--Cool_Dev--
|
|
|
|
|
I have an interface, I1 declared in library A, another interface I2 in library B. I2 has a property whose type is I1.
Now I want to use I2 in project A, so I "#import 'B.tlb' rename_namespace('B'), named_guids", then compile failed with error C4772, for interface I1 that in B.tlh can not be indentified. How to resolve this problem?
|
|
|
|
|
Use the auto_search[^] attribute on #import to automatically perform a #import of things B references.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Thanks for your suggestion, but it does not work. Because I have not write code using I2, if I comment the import clause, project A can be compiled well. But if I add import clause, compiled with error C4772.
|
|
|
|
|
Ah, I see - hadn't noticed the circular dependency...
Have you tried #including the .h file generated from project A's IDL file before the #import - because that's all you need really - a definition of I1 before the #import statement.
You may need to play with #import attributes to get the namespaces correct, but that's about all you should need.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
I'm working on a shell extension that will:
1. add an item to the context menu from a right click in the background of a folder in explorer (not a right click ON a folder)
2. add an item to the context menu from a right click on an exe file
First question is... can I do this with ONE shell extension or does it have to be two separate modules? I'm really hoping I can do it all at once.
Secondly, I'm wondering what the best way to "package" a shell extension is (for easy installation later). Right now the DLL is being accessed from my project folder but that is just a temporary solution. I need to install it somewhere....where should it live and what's the best way to get it there? Should I create an installer of some sort?
|
|
|
|
|
You could do that with one or two extensions. IShellExtInit::Initialize() is called with different parameters when you click on a file versus the background, so you can tell those two cases apart. Check out part 1[^] and part 7[^] of my shell extension series for more details.
Having two extensions doesn't mean you need two DLLs. Each extension is just a coclass, and there's nothing preventing you from having multiple coclasses in one DLL.
--Mike--
Dunder-Mifflin, this is Pam
|
|
|
|
|
Thanks Mike! I figured this was possible so I'll keep working on it. I've looked at your part7 tutorial, and you created two separate classes that derive from IShellExtInit, so I'll need to do this as well, right? It seems like I'll need one to handle right clicking on a file, and one to handle right clicking in the background. I don't see how else IShellExtInit::QueryContextMenu can differentiate.
modified on Friday, October 23, 2009 12:40 AM
|
|
|
|
|
In the case where you right-click files, Initialize() gets an IDataObject* that contains the list of selected items. In the case where you right-click the background, Initialize() gets a PIDL that tells you the folder.
--Mike--
Dunder-Mifflin, this is Pam
|
|
|
|
|
Is there any way to get the instance of EXCEL.EXE from Process ID using COM?
Similar to GetActiveObject, is there any other thing through which we can get the instances of multiple EXCEL.EXE running in Task Manager?
After getting handle to each EXCEL.EXE, I want to track all workbooks and sheets. I am using EXCEL automation to do this using C++. Getting all workbooks and sheets is done. But after getting PID of EXCEL.exe's , how to get that object?
I am getting PID for each process using psapi.h.
I think I am not asking a question, which I am not supposed to or I shouldn't ask.
In C#.net we have BinkToMoniker to get the object. Is there any such thing in C++(unmanaged).
Thanks in advance.
Regards,
KTT
|
|
|
|
|
|
KTTransfer wrote: In C#.net we have BindToMoniker to get the object. Is there any such thing in C++(unmanaged).
AFAIK, BindToMoniker is an equivalent of C++ CoGetObject function.
With best wishes,
Vita
|
|
|
|
|
Hey I tried all the ways but.....no
Aim: To attach all the multiple processes of EXCEL.EXE's running in taskmanager and reading all sheets and workbooks using EXCEL automation.
But using EXCEL automation only one instance of EXCEL we can connect using GetActiveObject.
In above case only active instance is retrieved and even EXCEL.exe which is opened first is retrieved.But want to retrieve all workbooks and sheets in the running instances of EXCEL.EXE.
Only way to differentiate between two EXCEL.EXE's running in taskmanager is PID.
So want to connect the EXCEL instance using PID and then retrieving the workbooks and worksheets.
IS there any way to get it, please give me clue.
Thanks in Advance.
Regards,
KTTransfer.
|
|
|
|
|
KTTransfer wrote: IS there any way to get it, please give me clue.
EXCEL registers each of his documents in ROT. Maybe, it's your case: you can enumerate all of EXCEL documents in ROT. PID is wrong way.
With best wishes,
Vita
|
|
|
|
|
http://support.microsoft.com/default.aspx/kb/238975
In above site(as suggested by superman) ,it is clearly written that EXCEL registers only one instance of EXCEL.EXE in ROT. The other instance can only be retrieved if names of workbooks are known.
Even in the same site, it is mentioned that for multiple instance refer the site:
http://support.microsoft.com/kb/190985
But as per my requirement I need to track all excel.exe's running in processes using MFC(No gui, only exe)application but not setting anything in EXCEL as mentioned in above site.
If you get any clue from above mentioned sites, please let me know.
Thanks in advance.
Regards,
KTTransfer
|
|
|
|
|
If you read the first page you link to, you have: However, because Office applications also register their documents in the ROT, you can successfully attach to other instances by iterating the ROT looking for a specific document, attaching to this document, and then getting the Application object from this document. For a code example of iterating the ROT and looking for a document name, click the article number below to view the article in the Microsoft Knowledge Base:...
You don't even have to reference each individual instance as all documents (from all instances of excel) is in the ROT. If you need the application object for a document, it's also there via the document object.
|
|
|
|
|
|
Please do not post the same question in multiple forums, read the guidelines[^].
|
|
|
|
|
Hi,
We have used the same code as given in
http://blogs.msdn.com/oldnewthing/archive/2004/04/23/118893.aspx
to capture objects under mouse in timer.But we are facing memory leakage problem.
While debuging this code we got the point of leakage is in function
AccessibleObjectFromPoint.
We already using IAccesible::Release function and VariantClear to release memory
but still memory leakage is there.
Any one know ,how to release memory used after AccessibleObjectFromPoint is called.
Please help.
Thanx in advance.
-Jay
|
|
|
|
|
The leak could be from accessing a member function of IAccesible and not freeing its output parameter like the SysFreeString in the link.
You should consider using ATL classes like CComPtr[^] which is a smart pointer and do not need to be released.
Some other useful ATL classes are -
CComBSTR[^]
CComVariant[^]
«_Superman_»
I love work. It gives me something to do between weekends.
Microsoft MVP (Visual C++)
|
|
|
|
|
Hi,
Thanx for reply.
Actualy we had removed all IAccessible function calls to clear that doubt,So now there is only one function call in timer that AccessibleObjectFromPoint() ,But still there is a memory leakage.
If you have any knowledge regarding this please let us know.
Thanx again,
-Jay
|
|
|
|
|
Hi. I call my own external function from html:
my.html
var data = "";
data = window.external.MyOwnDhtmlFunction();
In derived class CMyDhtmlDlg:
1.
CMyDhtmlDlg()
{ EnableAutomation(); }
2.
STDMETHODIMP CMyDhtmlDlg::GetExternal(IDispatch **ppDispatch)
{
*ppDispatch = GetIDispatch(TRUE);
return TRUE;
}
3. BOOL CMyDhtmlDlg::OnInitDialog()
{ SetExternalDispatch(GetIDispatch(TRUE)); }
4.
BEGIN_DISPATCH_MAP(CMyDhtmlDlg, CDHtmlDialog)
DISP_FUNCTION(CMyDhtmlDlg, "MyOwnDhtmlFunction", MyOwnDhtmlFunction, VT_BSTR, VTS_NONE)
END_DISPATCH_MAP()
Its all ok in windows xp sp2 ie 6.0. I can call MyOwnDhtmlFunction from html. But its doesnt work in windows xp sp1 ie. 6.0. How can i make it work in win xp sp1 under ie 6.0. And one more thing, what are the system requirements for CdhtmlDialog ? Can i use it in windows NT sp6 with ie 6.0 ?
Please help me. Thanks for reply and sorry for my bad english.
Its me
|
|
|
|
|
Hi all... in my application i want get the original GetInfoTip() text, after it i want edit and show the new modified Text.
Now i use IQueryInfo for "hook" the GetInfoTip() function and work very well, but i must rewrite all file information tip text myself.. I have added:
NoRemove *
{
NoRemove ShellEx
{
{00021500-0000-0000-C000-000000000046} = s '{MYKEY}'
}
}
It's for all file and i have some trouble for reset the InfoTip text... any mode for get original default?
I have tryed this code:
IShellFolder* shFolder = NULL;
IQueryInfo* pInfo;
LPITEMIDLIST pidl = NULL;
SHGetDesktopFolder(&shFolder);
SHILCreateFromPath(file, &pidl, 0);
if (SUCCEEDED(shFolder->GetUIObjectOf(NULL, 1, (LPCITEMIDLIST*)&pidl, IID_IQueryInfo, NULL, (void**)&pInfo)))
{
pInfo->GetInfoTip(0, &pwszTip);
pInfo->Release();
if (pwszTip)
{
MessageBox(NULL, pwszTip, NULL, MB_OK);
}
}
But it still show the tip text of My Computer icon
Thanks in advance.
|
|
|
|
|
anyone???
modified on Saturday, October 10, 2009 4:33 PM
|
|
|
|
|
Did You check this code for any other type of files (.cpp, .h or anything else) ?
May be Shell does not analyze registry entry *.
|
|
|
|