|
Hy there,
i'me looking for infos like tutorials and workshop on programming plug-ins for the internet explorer. How can I access to the favorites and how can i make a button with my functionality? These questions should be answered through the tutorial.
Thanks and regards
boa
|
|
|
|
|
|
boaconstrictor wrote:
i'me looking for infos like tutorials and workshop on programming plug-ins for the internet explorer.
<windir>\Program Files\Microsoft SDK\Samples\web\bits
This is a pretty cool example using BITS (background downloading). You need XP to run BITS, however, this code is a IE Plugin, so it could help you.
Good luck.
R.Bischoff | C++
.NET, Kommst du mit?
|
|
|
|
|
|
I've written a browser helper object that passes the HWND and IWebBrowser2* of an IE window to my dialog-based MFC app.
I need to use the IWebBrowser2* in my app, but doing so would (and does) cause an access violation. How can I use the information I have to create a valid IWebBrowser2* that still references the same instance of IE??
- KH
|
|
|
|
|
khan2000 wrote:
How can I use the information I have to create a valid IWebBrowser2* that still references the same instance of IE??
You can't, you're trying to pass a pointer between two processes (IE and your MFC app). Each process has its own memory space, and cannot see memory in other processes via a simple pointer.
You'll need to create your own communication system between the BHO and the dialog, and have the dialog tell the BHO what IWebBrowser2 methods to call.
--Mike--
I'm bored... Episode I bored.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
You can use the marshalling feature of the COM. It's not a piece of cake, but it works, when you do it correctly. The trick is in two functions:
CoMarshalInterface and
CoUnmarshalInterface
I never did it interprocess, so you have to make your own research, but the princip is following - in app 1, in your case the browser helper object you will create the IStream* through function CreateStreamOnHGlobal . This IStream* you should pass to the CoMarshalInterface with your IWebBrowser2* . After succesfull call, you will have all required marshalling properties stored in a global memory stream.
Look for the GlobalAlloc();GlobalLock();GetHGlobalFromStream() etc functions for description how to work with that kind of shared memory and how to pass it between process boundaries.
Then in second process you'll get somehow the IStream* back, put it to the CoUnmarshalInterface to retrieve the IWebBrowser2* back.
So hope this helps and let the force be with you...
|
|
|
|
|
Hello everyone! I recently came upon a very helpful article on this site which detailed the use of stacked dialog pages to create a netscape-like prefrences design. After working around with the code for a little while, I got exactly the results I needed, except for one thing: I do not know how to access a control within one of the stacked pages from the main dialog.
Let me explain: what I intend to do is automatically set focus to a control within each of the property pages as the user selects the name of the page from a list box. For example, they may select temperature (It's a conversion program), and then the temperature pane will appear within a little frame I've created. However, when I try to set focus to a control within that pane, I have trouble. The problem only occurs when I try to access controls inside the pane from the main dialog. Does anyone have any idea on how I might be able to get this working? Thanks.
Btw, I've provided a link to a screenshot of my program, so you can get an idea of what I'm going for. I've also included a link to the page where I found the excellent tutorial on stacked dialogs.
Screenshot of my program[^]
Stacked Dialog Tutorial[^]
"Ignorance is the sin of the many, whereas knowledge is the salvation of few."
Aanidaani
|
|
|
|
|
In the list box 'selection changed' handler, have it tell the dialog handler for the frame containing the control you're interested in to set the focus to a particular item. It goes like this: list box -> frame dialog handler -> set focus.
Software Zen: delete this;
|
|
|
|
|
Thanks for the tip. Unfortunately I had some problems using your method, but I did find an answer that works in my case. What I did was change the OnShowWindow message handler for all my panes and, depending on each pane, I changed the focus to the input box I needed. This way, just before the window is drawn, the input box gets focus, and I can do the whole thing within the pane's class itself, instead of externally. Thanks again.
"Ignorance is the sin of the many, whereas knowledge is the salvation of few."
Aanidaani
|
|
|
|
|
Is it possible to create a modeless dialog that does not
pop itself or owning application above all desktop windows ?
I tried following, but didn't work:
D->initiallyHidden=1;
D->Create(IDD,0);
D->SetWindowPos(NULL,0,0,0,0,
SWP_SHOWWINDOW|SWP_NOOWNERZORDER|SWP_NOACTIVATE|SWP_NOMOVE|SWP_NOSIZE);
I got some success with:
CWnd *w=GetForegroundWindow();
D->Create(...)
if(w)w->SetForegroundWindow();
but it makes dialogs parent application flicker.
|
|
|
|
|
My first thought is to use ShowWindow() instead of SetWindowPos() and play around with the parameter (SW_SHOWNOACTIVATE looks like the right one). You need to turn off the Visible style in the dialog resource, otherwise it will automatically be shown during the Create() call.
--Mike--
I'm bored... Episode I bored.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
I'm reading MSDN but am not really sure whats happening:
dbName = "";
size=128;
LPSTR psz = dbName.GetBuffer(size);
SO does this mean that I've fixed things so that I can copy somethig less than 128 bytes into dbName? SO if I just did dbName = "aaaaaaaaaaaaaaaaa" directly who takes care of the fact that dbName was zero bytes long ("" emoty) before?
When is one method better than another? Or --- when it is necessary to do the GetBuffer strategy?
|
|
|
|
|
Check out my C++ string classes[^] article where I cover CString in detail.
But to summarize, dbName.GetBuffer(128) makes sure that the dbName buffer is at least 128 characters long (allocating more space for you, if necessary) and returns a non-const pointer to the buffer. You can then use that pointer as if it were a normal C-style string.
When you call any other CString methods (such as the = operator), that pointer may become invalid because some CString methods delete/reallocate the buffer.
nss wrote:
SO if I just did dbName = "aaaaaaaaaaaaaaaaa" directly who takes care of the fact that dbName was zero bytes long before?
CString manages its own memory (except for when you explicitly take control of the memory with GetBuffer() ).
--Mike--
I'm bored... Episode I bored.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Will do. Many thanks! MFC is always surprising me....
|
|
|
|
|
can anyone tell me how to put the whole content of scrollview into one bit bitmap?by the way, I don't know the content of the window,is it difficult?
thanks
|
|
|
|
|
Shouldn't just create a compatible DC, a bitmap the size of the scrollview, select the bitmap into the DC, and then sending WM_PRINT to the scrollview work?
|
|
|
|
|
I want to check the registry to see if a certain key TestViewBox exists. If it does, then I want to delete it (so all the stuff under it vanishes too - correct? ). Then I want to recreate it, and put in fresh entries under that key (a subkey and then values).
I'm thinking:
LONG res = RegOpenKeyEx(keyHandle1, "TestViewBox",
0, KEY_ALL_ACCESS, &keyHandle2);
if (res)
{
RegCreateKeyEx(keyHandle1, "TestViewBox", 0, "",
REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL,
&keyHandle2, &disp);
RegCreateKeyEx(keyHandle2, "MyTestApp", 0, "",
REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL,
&keyHandle3, &disp);
RegSetValueEx(keyHandle3, NumberOfBoxes,
0, REG_DWORD, (BYTE*)&numberOfBoxes, sizeof(DWORD));
{
Of course I will be checking the returnvalues from each registry function....
|
|
|
|
|
If RegOpenKeyEx does not fail it means that the key exists. You can then delete it with RegDeleteKey
modified 12-Sep-18 21:01pm.
|
|
|
|
|
Use ::RegDeleteKey(). On Windows W9X, this deletes this key, subkeys and values. But on W2K/NT/XP, it doesn't, you have to delete the subkeys yourself (recursive key deletion before you can delete this key).
PS : be sure to release the key handles as well. Like a lot of developers, you seem to mix all together and reuse handles without freeing them first.
|
|
|
|
|
RegOpenKeyEx(HKEY_CURRENT_USER, "Software",
0, KEY_ALL_ACCESS, &keyHandle1);
LONG res = RegOpenKeyEx(keyHandle1, "MyCompany4",
0, KEY_ALL_ACCESS, &keyHandle2);
if (!res)
{
res = RegOpenKeyEx(keyHandle2, "MyApplication4",
0, KEY_ALL_ACCESS, &keyHandle3);
}
SO is this good? Am terrified I might erase the "SoftWare " key or something and destroy myself!!! So I need to know if its safe first....
if (!res)
{
res = RegDeleteKey(keyHandle2,"MyApplication4");
}
if (!res)
{
res = RegDeleteKey(keyHandle1, "MyCompany4");
}
RegCloseKey(keyHandle1);
RegCloseKey(keyHandle2);
RegCloseKey(keyHandle3);
(check res ) and Open the software key again and write the new subkeys.....
|
|
|
|
|
I would replace this :
if (!res)
{
res = RegDeleteKey(keyHandle2,"MyApplication4");
}
if (!res)
{
res = RegDeleteKey(keyHandle1, "MyCompany4");
}
RegCloseKey(keyHandle1);
RegCloseKey(keyHandle2);
RegCloseKey(keyHandle3);
with this :
if (!res)
{
RegCloseKey(keyHandle3);
RegDeleteKey(keyHandle2,"MyApplication4");
}
RegCloseKey(keyHandle2);
res = RegDeleteKey(keyHandle1, "MyCompany4");
RegCloseKey(keyHandle1);
Don't use the same res variable for all keys. Add braces to combine the cases, instead of putting them sequentially.
|
|
|
|
|
Thank you so much for the pointers....
|
|
|
|
|
I recently integrated an installer/uninstaller into my program (third party) and unfortunately calling GetCurrentDirectory and SetCurrentDirectory for loading and saving files points to C:\Documents and Settings\... I need all the files to be saved and loaded from the directory in which the .exe is located in. Is there a similar function (Win32) to GetCurrentDirectory which would get the application path eg. C:\Program Files\My Application\...exe?
|
|
|
|
|
GetModuleFileName does the job
modified 12-Sep-18 21:01pm.
|
|
|
|
|