Click here to Skip to main content
16,010,360 members
Home / Discussions / C#
   

C#

 
AnswerRe: Console.WriteLine ? Pin
Elina Blank13-Jun-06 9:59
sitebuilderElina Blank13-Jun-06 9:59 
Questionhow to close an application from another form? Pin
donkaiser13-Jun-06 5:49
donkaiser13-Jun-06 5:49 
AnswerRe: how to close an application from another form? Pin
led mike13-Jun-06 5:57
led mike13-Jun-06 5:57 
AnswerRe: how to close an application from another form? Pin
donkaiser13-Jun-06 5:58
donkaiser13-Jun-06 5:58 
GeneralRe: how to close an application from another form? Pin
Roy Heil14-Jun-06 3:38
professionalRoy Heil14-Jun-06 3:38 
QuestionHow to print tabs in a textbox Pin
WebMaster13-Jun-06 5:46
WebMaster13-Jun-06 5:46 
QuestionDataSets: SQL Statement versus Relations.Add Pin
leckey13-Jun-06 5:40
leckey13-Jun-06 5:40 
QuestionBrowser Helper Object, problem with SHDocVw.DWebBrowserEvents2_Event.DocumentComplete Pin
klepa11235813-Jun-06 5:02
klepa11235813-Jun-06 5:02 
I'm writing Browser Helper Object (IExplorer plug-in) in C#, Microsoft VS 2005, Framwork 2.0.
1. I implement interface IObjectWithSite and add event handler for events SHDocVw.DWebBrowserEvents2_Event.DocumentComplete and SHDocVw.DWebBrowserEvents2_Event.OnQuit in function SetSite :
[System.Runtime.InteropServices.ComImport, System.Runtime.InteropServices.Guid( "FC4801A3-2BA9-11CF-A229-00AA003D7352" ), System.Runtime.InteropServices.InterfaceType( System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown )]
public interface IObjectWithSite
{
void SetSite( [System.Runtime.InteropServices.In, System.Runtime.InteropServices.MarshalAs( System.Runtime.InteropServices.UnmanagedType.IUnknown )] object pUnkSite );
void GetSite( [System.Runtime.InteropServices.In] ref System.Guid riid, [System.Runtime.InteropServices.Out] System.IntPtr ppvSite );
}
[System.Runtime.InteropServices.ComVisible( true ), System.Runtime.InteropServices.Guid( "C06B3B91-769A-42d5-8BCD-CF70F8589FBA" ), System.Runtime.InteropServices.ClassInterface( System.Runtime.InteropServices.ClassInterfaceType.None )]
public class DOMPeek : IObjectWithSite
{
void IObjectWithSite.SetSite( object pUnkSite )
{
if(m_IUnkSite != null)
{
System.Runtime.InteropServices.Marshal.ReleaseComObject( m_IUnkSite );
}
m_IUnkSite = pUnkSite;
try
{
SHDocVw.DWebBrowserEvents2_Event WebBrowserEvents = (SHDocVw.DWebBrowserEvents2_Event)m_IUnkSite;
WebBrowserEvents.DocumentComplete += new SHDocVw.DWebBrowserEvents2_DocumentCompleteEventHandler( OnDocumentComplete );
WebBrowserEvents.OnQuit += new SHDocVw.DWebBrowserEvents2_OnQuitEventHandler( OnQuit );
}
catch // cast or no such interface exception
{
}
return;
}
void IObjectWithSite.GetSite( ref System.Guid riid, System.IntPtr ppvSite )
{
}
2. Implement event handlers OnQuit and DocumentComplete
void OnQuit()
{
System.Windows.Forms.MessageBox.Show( "OnQuit" );
}
void OnDocumentComplete( object pDispatch, ref object VariantURL )
{
System.Windows.Forms.MessageBox.Show( "OnDocumentComplete : " + VariantURL );
}
3. I register the object DOMPeek as Browser Helper Object in windows register.

Then I run IExplorer and see the messageBox "OnDocumentComplete : about:blank". Then I close IE window and see the messageBox "OnQuite".

The problem consist in that I take this result only in MSWindosw2003sp1 (server) with MS VS2005 installed. In MSWindowsXPsp2 without any updates, without MS VS2005, but with all Framework installed I didn't see the messageBox "OnDocumentComplete : about:blank", but see the messageBox "OnQuit". What's problem??? What updates need for correct working in MSWindowsXPsp2???
Then I try to install all updates for MSWindowsXPsp2 from Microsoft site and again didn't see the messageBox "OnDocumentComplete : about:blank", but see the messageBox "OnQuit". Then I try to install MS VS2005 but didn't install all updates for MSWindowsXPsp2 and again didn't see the messageBox "OnDocumentComplete : about:blank", but see the messageBox "OnQuit". Finally I install all updates for MSWindowsXPsp2 from microsoft site and then MS VS2005 then I see the messageBox "OnDocumentComplete : about:blank" and "OnQuit". But if I install MS VS2005 and then all updates for MSWindowsXPsp2 then not woking (didn't see the messageBox "OnDocumentComplete : about:blank", but see the messageBox "OnQuit").

What's problem??? What specifically updates need for correct working in MSWindowsXPsp2???
QuestionTextbox automatic display Pin
PaulaM13-Jun-06 4:47
PaulaM13-Jun-06 4:47 
AnswerRe: Textbox automatic display Pin
NaNg1524113-Jun-06 5:12
NaNg1524113-Jun-06 5:12 
Questionconvert argb to rgb Pin
edel_ong13-Jun-06 4:44
edel_ong13-Jun-06 4:44 
AnswerRe: convert argb to rgb Pin
Wjousts13-Jun-06 4:46
Wjousts13-Jun-06 4:46 
GeneralRe: convert argb to rgb Pin
edel_ong13-Jun-06 4:52
edel_ong13-Jun-06 4:52 
GeneralRe: convert argb to rgb Pin
Josh Smith13-Jun-06 5:01
Josh Smith13-Jun-06 5:01 
AnswerRe: convert argb to rgb Pin
Guffa13-Jun-06 6:18
Guffa13-Jun-06 6:18 
QuestionGraphic Proccess Pin
pirogramci13-Jun-06 4:37
pirogramci13-Jun-06 4:37 
AnswerRe: Graphic Proccess Pin
Mr. Rogers13-Jun-06 6:27
Mr. Rogers13-Jun-06 6:27 
Questionmode and compression format of tiff file Pin
pbmcoder13-Jun-06 4:29
pbmcoder13-Jun-06 4:29 
QuestionVS 2005 ListViews not holding background color Pin
acezrwild81713-Jun-06 3:56
acezrwild81713-Jun-06 3:56 
QuestionInsert text into webform from desktop app Pin
psyonara13-Jun-06 3:26
psyonara13-Jun-06 3:26 
Questionmove next record from the current record in dataview Pin
Mohammed Elkholy13-Jun-06 3:15
Mohammed Elkholy13-Jun-06 3:15 
QuestionEvent issue Pin
atulonweb@hotmail.com13-Jun-06 2:35
atulonweb@hotmail.com13-Jun-06 2:35 
AnswerRe: Event issue Pin
MCSD-Gandalf13-Jun-06 3:38
MCSD-Gandalf13-Jun-06 3:38 
AnswerRe: Event issue Pin
Josh Smith13-Jun-06 4:41
Josh Smith13-Jun-06 4:41 
GeneralRe: Event issue Pin
atulonweb@hotmail.com13-Jun-06 17:58
atulonweb@hotmail.com13-Jun-06 17:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.