Hi Jimmy! Thanks for your reply! I guess this may be a way to accomplish this effect. Although the Snap widget doesn't use any redirects... Best, Constantin
conman110
Posts
-
how is that done?? -
how is that done??Hello, lately I looked at the Snap Shots preview widget (www.snap.com) and wondered how a specific feature has been implemented: If you select the options (top right corner) and select something (f.e. a longer delay until the window pops up) the information is stored in a cookie belonging to the snap.com domain. This is no problem, because the options panel shown in the widget is an iframe which is loaded from the snap.com domain. My question is now, how they get the information in the cookie belonging to the domain snap.com, if the javascript runs in the contex of a completely different domain?? It works, you can try... but how is this done? All I know is, that it is prohibited to access cookies of other domains. Thanks! I am very interested in any ideas! Constantin
-
JavaScript and BHO communication?Hello, I'd like to know if it's possible for a JavaScript executed by the browser to send information to a browser helper object (BHO) also running in this browser? The reason is that I'd like to store the login information (the login functionality is implemented in JavaScript) in my BHO instead of a cookie. Is something like that possible? By the way, a server-side session based solution is not possible in my case. Thanks, Constantin
-
DocumentComplete and reloadI included the technique described in this article and found out that it works under most circumstances but not all: The event pair DownloadBegin/DownloadComplete which is used to detect the refresh of the page gets also trigged if the page uses a remote scripting technique. So we would get a false alarm each time the page appends a script node to the DOM. I played around with another Add-on (the Snap Shot Add-On from www.snap.com) and found out, that it somehow gets DocumentComplete to be triggered if the user presses the pages refresh button. But how do they do that? And is there maybe a reason that DocumentComplete isn't called when the page reloads? Best regards Constantin
-
DocumentComplete and reloadI found an article covering this problem: http://www.codeproject.com/internet/detecting_the_ie_refresh.asp[^]
-
DocumentComplete and reloadHello, I developed a simple browser helper object in VC++ as an ATL project which listens for the DocumentComplete event of the DWebBrowserEvents2 interface. When testing it I discovered that this event is not fired if the user presses the reload button. Why is that? And what is the proper event which is fired, when the document is loaded and is fired again, when the document is reloaded? Thanks for your attention. Constantin
-
Register browser helper objectThank you Sohail, you gave me the information I needed! Best regards! Constantin
-
Register browser helper objectOk, but my question actually is, how I should adjust my setup project so the COM object is registered on the target machine (what steps have to be done in the registry) and what has to be done to register this COM object as an BHO (also which steps are required in the registry, but I guess it's the key you were refering to in your link)? You see, it seems the COM object gets automatically registered by Visual Studio when building the project and this has to be done by the setup project when installing the BHO on another machine also. Constantin
-
Register browser helper objectHello Sohail, it helped a little bit:
A BHO is a COM server and should be registered both as a COM server and as a BHO.
But how do I do this in with my setup project. I guess the second step is done by registering the COM as an BHO:
HKLM {
SOFTWARE {
Microsoft {
Windows {
CurrentVersion {
Explorer {
'Browser Helper Objects' {
ForceRemove {1E1B2879-88FF-11D2-8D96-D7ACAC95951F}
}}}}}}}This code snippet is also from the link you provided, but shouldn't I change
ForceRemove {...}
toNoRemove {...}
, because I want the key to be persistent after running the setup... And how do I do the first step - registering my COM server - in the setup project? Thanks in advance! Constantin -
Register browser helper objectHello, I wrote a simple Broser Helper Object as an ATL COM component which works just fine when running it from Visual Studio or registering it with regsvr32. Also I created a setup project for deployment of the BHO. What I would like to know is what I need to do in my setup project so the DLL file is registered correctly and becomes executed when the Internet Explorer starts. Does someone know which steps I must process exactly? Thanks!! Constantin
-
ATL COMThe ATL (Active Template Library) is a library to make COM programming easier. The WTL (Windows Template Library) extendes the ATL for more GUI support (for example splitter windows ect.) So the WTL is something like MFC to make windows GUI programming easiert and somehow object oriented ;) You find here at codeproject some good tutorials how to use ATL/WTL especially if you have a background in MFC at http://www.codeproject.com/wtl Search for the articles "WTL for MFC programmers" from Michael Dunn. Constantin
-
WTL work around WM_NOTIFYHi, I came up with a way how to call member functions directly so sending WM_NODIFY messages is no longer neccessary and I am interested in your opinions! I have a MDI window (derived from CMDIFrameWindowImpl) that notifies the active MDI child (CChildFrame derived from CMDIChildWindowImpl) if its document should be opened/saved/reopened ect... The only way I knew to do this was to send the MDI child a WM_NOTIFY message with different notification code and NMHDR*. I thought it would be nice to call member function like Save(), Open(CString file),... directly on the CChildFrame object because it would be a lot easier to read and the casting of NMHDR* would no longer be neccessary. So here is the code:
// The notification code #define ATL_GET_THIS 100 template<typename T> T* AtlGetObject(HWND hWnd) { NMHDR nmhdr = { hWnd, 0, ATL_GET_THIS }; return (T*)(::SendMessage(hWnd, WM_NOTIFY, 0, (LPARAM)&nmhdr)); }
The CChildFrame must handle the ATL_GET_THIS notification:BEGIN_MSG_MAP_EX(CChildFrame) ... NOTIFY_CODE_HANDLER_EX(ATL_GET_THIS, _AtlOnNotifyGetThis) ... END_MSG_MAP() LRESULT _AtlOnNotifyGetThis(NMHDR* /*phdr*/) { return (LRESULT)this; }
So the code in the parent to call some member function in the active MDI child would look like this:CChildFrame* pWndChild = AtlGetObject(MDIGetActive()); CString sFilename = pWndChild->GetFilename(); CFileDialog dlg(FALSE, 0, sFilename); if (dlg.DoModal() == IDOK) { pWndChild->SaveAs(dlg.m_ofn.lpstrFile); }
What do you say? I know it works, but are there some traps I didn't see? And if this is a good idea, why is nothing like this in the ATL/WTL already? Or there is and I didn't see it? Thanks for your time! Constantin -
Cstring with ATLYou need atlmisc.h which comes with the other WTL headers you have to download from microsoft. Then you need to define _WTL_USE_CSTRING to forward declare the CString class. Look at the Beginner WTL tutorials here at codeproject (for example WTL for MFC programmers Part II covers including CString right at the beginning) --Constantin
-
debugging VSIP packageHi! I have a problem with debugging my VSIP package. Wenn I build my package and start the build Project from Visual Studio a new Visual Studio Experimental opens with my Package. Trace infos and debug output appear in the original Visual Studio window which holds the package solution. But then I have problems with my package because the DTE object belongs not to the Visual Studio instance which runs my package, it belongs to the original Visual Studio instance (I simply printed the current project name to find this out, it's always the packages project and not the dummy project I loaded into the VS Experimental instance.) When I close all Visual Studio threads and start manually Visual Studio Experimental it works fine, the current project is the current project of the Visual Studio instance my package runs in. Does someone have any ideas why that happens? In another forum someone suggesed to start a new Exp instance manually and the attach this debug output with Debug/Processes in the projects instance. Is that the only way? Thanks in advance! - Constantin
-
MFC tray iconHi folks! I want to program a tool that only stays as a tray-icon. My problem is how to design it in MFC. The application is a CWinApp, but without a Window in m_pMainWnd it closes immediately. How do I build an application that runs without a window? Do I need a valid hwnd for Shell_NotifyIcon()? (I tryed with NULL as hwnd and it seemed to work..) One solution may be to create a window but never show it. But perhaps there is a better way out there... :) Thanks! constantin
-
Possible to change window style after creation?Oh! you see I am not very used to MFC and didn't find it myself :) Guess that's what I searched. I'll try it... Thanks! Constantin
-
Possible to change window style after creation?My question is, if it's possible to change the style (dwStyle) and the extended style (dwExStyle) of a created window. I am working on a window that is a normal OVERLAPPEDWINDOW but when I switch to fullscreen it should be a POPUP etc. Do I have to Destroy and create a new window? Thanks! Constantin
-
Possible to build static Libs with Ressources?Seems as if that's the only way. Thanks!
-
Possible to build static Libs with Ressources?I have tryed to build a static library which includes a method to show a dialog (defined in a ressource file) The linker warning I get is: GLAP.res : warning LNK4221: no public symbols found; archive member will be inaccessible Guess that's why the dialog never shows up when I use the generated lib in in a project. Does anybody know what's the problem? Is it possible to build static libs with ressources like dialogs at all? Thanks! Constantin