Click here to Skip to main content
15,913,939 members
Home / Discussions / C#
   

C#

 
AnswerRe: Local IP number? Pin
leppie23-Dec-04 20:33
leppie23-Dec-04 20:33 
Generalsingleton Pin
lcarriere23-Dec-04 18:14
lcarriere23-Dec-04 18:14 
GeneralRe: singleton Pin
Heath Stewart23-Dec-04 20:20
protectorHeath Stewart23-Dec-04 20:20 
GeneralRe: singleton Pin
lcarriere24-Dec-04 4:06
lcarriere24-Dec-04 4:06 
GeneralRe: singleton Pin
Heath Stewart27-Dec-04 10:17
protectorHeath Stewart27-Dec-04 10:17 
GeneralRe: singleton Pin
lcarriere27-Dec-04 11:29
lcarriere27-Dec-04 11:29 
Generalsuspending layout, useragents, and creating shortcuts... Pin
dkarlton23-Dec-04 15:36
dkarlton23-Dec-04 15:36 
GeneralRe: suspending layout, useragents, and creating shortcuts... Pin
Heath Stewart23-Dec-04 20:48
protectorHeath Stewart23-Dec-04 20:48 
dkarlton wrote:
I posted to this board almost a month ago, and no one had a response for any of my questions.

This is a community forum - not a managed newsgroup. Older messages sometimes slip through the cracks as there are times us regulars aren't around to answer questions.

dkarlton wrote:
1) Is there a way to control the browser to not display until DocumentComplete has been called (i.e. READYSTATE_COMPLETE)? I want the page to *not* show anything until it's fully loaded, and can't figure out how to do this.

No. The browser renders objects - including the DOM as certain elements are loaded - as they are read.

dkarlton wrote:
2) Is there a way to modify the UserAgent sent by the browser? ...

While the documentation is not clear, it does state that the second-to-last parameter (PostData) is a SAFEARRAY (native type), which is a common array type in COM (since native arrays imply no bounds; SAFEARRAYs do). The CLR will marshal a string[] array as a SAFEARRAY but you need to specify UnmanagedType.SafeArray in the MarshalAsAttribute for the parameter. Without defining the interface yourself (instead of using the imported RCW) you'll have to take a chance.

Define a string[] array like so:
string[] headers = new string[] {"User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US)"};
Then pass headers as the last parameter. It's already a reference type so don't try to marshal it as a pointer. Problems will definitely arise (like, perhaps, an AV exception) if you do.

The important thing is to understand marshaling managed and native types. Read Interop Marshaling[^] in the .NET Framework SDK for more information.

dkarlton wrote:
3) I've tried, unsuccessfully, to make a call to create a desktop shortcut using IWshRuntimeLibrary. Here's my code:

A quick search[^] on "WshShell" returned the following article as the first result: Creating Shell Links (Shortcuts) in .NET Programs Using WSH
[^]. Take a look at the sample project for details, and be sure to read the documentation for the native interfaces. With that information and the marshaling information I linked above it's quite easy.

This posting is provided "AS IS" with no warranties, and confers no rights.

Software Design Engineer
Developer Division Sustained Engineering
Microsoft

[My Articles] [My Blog]
GeneralRe: suspending layout, useragents, and creating shortcuts... Pin
dkarlton27-Dec-04 14:32
dkarlton27-Dec-04 14:32 
GeneralRe: suspending layout, useragents, and creating shortcuts... Pin
Heath Stewart27-Dec-04 19:19
protectorHeath Stewart27-Dec-04 19:19 
GeneralRe: suspending layout, useragents, and creating shortcuts... Pin
Heath Stewart28-Dec-04 5:09
protectorHeath Stewart28-Dec-04 5:09 
GeneralRe: suspending layout, useragents, and creating shortcuts... Pin
dkarlton28-Dec-04 8:28
dkarlton28-Dec-04 8:28 
GeneralRe: suspending layout, useragents, and creating shortcuts... Pin
Heath Stewart28-Dec-04 8:43
protectorHeath Stewart28-Dec-04 8:43 
GeneralRe: suspending layout, useragents, and creating shortcuts... Pin
dkarlton14-Jan-05 14:44
dkarlton14-Jan-05 14:44 
GeneralRe: suspending layout, useragents, and creating shortcuts... Pin
dkarlton29-Mar-05 5:14
dkarlton29-Mar-05 5:14 
GeneralNo ToolBarButton images in runtime Pin
Skynyrd23-Dec-04 13:30
Skynyrd23-Dec-04 13:30 
GeneralRe: No ToolBarButton images in runtime Pin
Heath Stewart23-Dec-04 20:49
protectorHeath Stewart23-Dec-04 20:49 
GeneralRe: No ToolBarButton images in runtime Pin
Skynyrd24-Dec-04 0:54
Skynyrd24-Dec-04 0:54 
GeneralSendMessage issue Pin
Aviv Halperin23-Dec-04 10:32
Aviv Halperin23-Dec-04 10:32 
GeneralRe: SendMessage issue Pin
Matt Gerrans23-Dec-04 11:30
Matt Gerrans23-Dec-04 11:30 
GeneralRe: SendMessage issue Pin
Aviv Halperin23-Dec-04 13:12
Aviv Halperin23-Dec-04 13:12 
GeneralRe: SendMessage issue Pin
Heath Stewart23-Dec-04 20:57
protectorHeath Stewart23-Dec-04 20:57 
GeneralRe: SendMessage issue Pin
Aviv Halperin24-Dec-04 4:02
Aviv Halperin24-Dec-04 4:02 
GeneralRe: SendMessage issue Pin
Heath Stewart27-Dec-04 10:12
protectorHeath Stewart27-Dec-04 10:12 
GeneralRe: SendMessage issue Pin
Aviv Halperin27-Dec-04 20:41
Aviv Halperin27-Dec-04 20:41 

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.