Export (0) Print
Expand All

The Web Woman Talks

As of December 2011, this topic has been archived. As a result, it is no longer actively maintained. For more information, see Archived Content. For information, recommendations, and guidance regarding the current version of Internet Explorer, see Internet Explorer Developer Center.

Tom Moran
Rafael M. Muñoz
Microsoft Corporation

February 7, 2000

Contents

History is now history - How to clear the history list?
Size matters - Limiting download size for Microsoft Agent
What's in a title? - How to get the title of the document loaded in Internet Explorer
A one, and a two, and a three ... - Counting characters in a TEXTAREA
Going to the source for the complete scoop - A question about using Java

The Web Men Talking Award - VBnet
The Web Men in Short

We welcome Kusuma Vellanki—our much-awaited Web Woman Talking. Kusuma will join us every other month or so to help answer your Web-development questions. We realize this means a new photo and name. We'll get right on it.

In the meantime, the Web Team Talking addresses matters of history and size, titles and TEXTAREA—all this, plus Java.

Fasten your seatbelts for a short month and a wild ride.

History is now history

Dear Web Men:

Is there some way of preventing pages from appearing on the History List?

Thank you forwards,

Oliver Berke

The Web Men reply:

The answer is in mostly in caching! Huh, you say? Bear with us.

There are two history lists, session and global. The global history is the list displayed when a user brings up the History bar. These items represent sites visited across all sessions by that user and are taken from the user’s Temporary Internet Files folder. To avoid having a URL added to this list, you can specify that the file should not be cached; hence, it won’t be present in the Temporary Internet Files folder. Check out KB article Q234067, "HOWTO: Prevent Caching in Internet Explorer" Non-MSDN Online link for information on how to avoid caching. A better solution is to have your Web administrator control browser settings through auto configuration files, and to then specify a value of zero for the "Day to keep pages in History" Internet option.

That's not all! For those programmers among us, here's some code to clear the History cache programmatically. You can implement a Browser Helper Object (BHO) and clear thehistory after navigation if you so wish. See Q179230, "IEHelper-Attaching to Internet Explorer 4.0 using a Browser Helper Object" Non-MSDN Online link for a BHO sample

#include <shlguid.h> // Needed for CLSID_CUrlHistory
#include <urlhist.h> // Needed for IUrlHistoryStg2 and IID_IUrlHistoryStg2
IUrlHistoryStg2* pHistory;  // We need this interface for clearing the history.
        HRESULT hr;
        DWORD cRef;
        CoInitialize(NULL);
        // Load the correct Class and request IUrlHistoryStg2
        hr = CoCreateInstance(CLSID_CUrlHistory, NULL, CLSCTX_INPROC_SERVER,
IID_IUrlHistoryStg2, reinterpret_cast<void **>(&pHistory));
        if (SUCCEEDED(hr))
        {
         // Clear the IE History
         hr = pHistory->ClearHistory();
        }
        // Release our reference to the 
        cRef = pHistory->Release();
        CoUninitialize();

To avoid having your files added to the session history list, use location.replace to overwrite the current URL in history with the URL a user visits next. This functionality is most often requested because the Web developer does not want the user to go back to stale content. In this case, you can avoid content from being cached -- so even if the URL is present in the session history list, you can be assured that the data will be obtained from your server. Note the side effect: Without caching, there is a roundtrip to the server every time the page is requested, which may raise a performance issue for large files.

Size matters

Dear Web Men:

I am creating my own agent and am having trouble getting the file to a reasonable size.  It is currently 11 MG.  Do you have any suggestions for agent building information or do you have any tips for file compression?

James Hanrahan

The Web Men reply:

Making your own?  That is so cool. We love the Agent technology and think it is some of the most fun (and most useful) technology at Microsoft.  Send us a link to it when you’re done.  But 11 MG? You’ve definitely got some work to do.  Most characters tend to be in the 1-3 MG range, but we've seen them as low as about 100 KB, depending on how they are implemented. To get the best answer to your question, we talked with Tandy Trower, who has been with Microsoft Agent since the beginning.  He explained that the size of your character file  really depends on several things:

  • The size of the character's frame (or, to be more precise, the size of the images used in the character's frame). For example, Peedy is larger than Merlin because Peedy's frame is wider and includes images where he stretches out his wings.
  • The shape of the character. Each character image outer border/outline is stored. The more regular the shape, the better it can be compressed. Peedy is worse than Merlin because his toes include individual pixels, whereas Merlin is mostly pear-shaped. Even when Merlin extends his hands, they are fairly large shapes.  So watch how detailed you make the anatomy.
  • The colors used in the character's images. We'll stress it again: Regularity means better compression. The more you use the same color, the better the character editor can compress the image. All the Microsoft characters are quite expensive, because they are nicely shaded to appear three-dimensional. However, a more conventional cartoon character, such as Mickey Mouse or Dilbert -- with no shading would have large amounts of continuous color and would compress better.  Adjacency is important as well. For example, Rafael in a pink and white polka dot dress would not compress as well as Rafael in a half-pink and half-white dress.
  • The number of images used in the character's animation file. Reusing images saves file size. All the Microsoft characters use the same bitmap file for their starting position. This file is stored only once when the character is built.
  • The number of frames in an animation. The more frames (therefore, the more images) you use, the larger the resulting file will be. Figure out which animations you think will be used most, and make those more detailed; then skimp a bit on the lesser-used animations.
  • The number of animations you have. This goes along with the above point.  The more animations you have, the larger the file size. Microsoft's characters average about 80 animations -- but unless you are defining a "default character," you can have as many or as few as you like.
  • Using exit branches as your return animations. Return animations are the ones you use to return the character to a neutral position before the next animation is played, allowing a smooth transition. Typically, using your exit branches as your return animation means you are reusing images already in the animation. As noted earlier, images reused across animations are stored only once, saving you substantial space.
  • The number of sound effects, and the compression used. Sound effects included with the character are typically expensive, because sound files are large. The more you use, the larger the resulting character file. All the Microsoft characters use sound effects sparingly, and all use a common sound compression codec to reduce their size.

To summarize: Minimize the image size, keep to a fairly regular shape and color usage, reuse images wherever possible, reduce frames and images in an animation as much as possible, and compress and minimize use of any sounds.

Related information:

Interested in implementing Microsoft Agent technology?  Info and downloads are at MSDN Online.

Want to see what other people have done?  Try the Agent Web Ring Non-MS link for some great examples of what is possible.

What’s in a title?

Dear Web Men:

I have used  the InternetExplorer.Document.title property to retrieve the title of a downloaded HTML document in a Visual Basic program. Problem is my editor converts the title property to 'Title' as soon as I remove my cursor from the line, and gives an unspecified error when it encounters that line. In debug mode, if I change the capital T to small t, then the program executes smoothly and gives the proper value of the title property. Please let me know if there is any workaround.

Thanks,

Manish

The Web Men reply:

Manish, the problem that you are seeing is related to timing. You need to wait until the top-level document is completely loaded before you can access the Document.Title property. Refer to  KB article Q180366, "HOWTO: Determine When a Page Is Done Loading in WebBrowser Control" Non-MSDN Online  link, which shows how to detect when the page is completely loaded. Here’s some code to access the Document.Title property.

Dim WithEvents MyExplorer As InternetExplorer
Private Sub Command1_Click()
Set MyExplorer = CreateObject("InternetExplorer.Application")
MyExplorer.Navigate "http://msdn.microsoft.com/"
MyExplorer.Visible = True
End Sub

Private Sub MyExplorer_DocumentComplete(ByVal pDisp As Object, URL As Variant)
    If (pDisp Is MyExplorer) Then
    MsgBox MyExplorer.Document.Title
    Else
    Debug.Print "Not the top one yet \n"
    End If
End Sub

A one, and a two, and a three ...

Dear Web Men:

Is it possible to limit the number of lines a user can enter into a TEXTAREA on a Web page? The input is going into a database field containing instructions, and we don't want five pages of how to do something. I would like to use a TEXTAREA rather than a single line text box, so the user can see most/all of what is being entered. Using the onchange event, each individual character could be counted, but that is expensive overhead for a large TEXTAREA. Is there a better way?

Bonnie Knapp

The Web Men reply:

Bonnie, we have to agree that counting each character one at a time would be very expensive.  In fact, we are pretty sure we would lose count after we ran out of fingers and toes.

Unfortunately, the TEXTAREA object doesn’t have any specific way of limiting text. With the <INPUT type=text> element, however, you can use the MAXLENGTH attribute to limit the number of characters.  It's even pretty sweet—because when the limit is reached, no further input is accepted.

Another option would be to provide a visual cue for your users and request that they stay under a certain amount of characters.  This can easily be done with the following two lines of code:

<TEXTAREA ROWS="5" COLS="38" NAME="instructions" ONBLUR=count.value=this.value.length></TEXTAREA>
<INPUT TYPE="text" SIZE=3 ID=count NAME=count readonly>

What happens is that when the TEXTAREA object loses input focus, the onblur event is fired, and the length is obtained and displayed in the "count" text box.  As you can see, we have also made the "count" text box eadonly, so that it cannot be used for user input.

If you combine this with a FORM object, you can also validate the character count and alert users when they have gone over the allotted amount of characters.

Going to the source for the complete scoop

Dear Web Men:

Happy New Year!

Nice articles in the MSDN library, but this is not why I bother you with my message. I hope you can spare a few seconds to answer my question. I have to build a Web site for the physics dept. at my University. The problem is that I spend a lot of time working at home, on a Windows platform, and at school I have to work with Linux servers and clients. Because of that, I have chosen Java applets. I want to know if it is possible to upgrade my Visual J++ to use the new APIs from Sun (JDK 1.2 - JFC). I have installed the JDK 1.2, and I added to CLASSPATH the paths to all the *.jar files I could find in the JDK 1.2 directory. I was even able to compile with Visual J++ code written with Swing, but I couldn't run it with JView.exe (it ran only with java.exe). Please help me with this. The last two days I spent digging through menus and docs with no result.

Thank you!

Alexandru Gris

The Web Men reply:

Alexandru, you definitely have touched on a hot issue.  We went directly to the source, the Java Development and Support teams, to discuss this topic and get the total scoop.  They explained that you could actually break this question down to two topics, one of supportability and the other of expanding the richness of Visual J++® Non-MSDN Online link.

Let's start with the issue of supportability. We are going to refer to the official Microsoft response:

"Microsoft has not announced a date for JDK 1.2 support as of yet.  As you probably know, we are in litigation with Sun and cannot comment on future plans."

Now with that said, let's address the issue of expanding the richness of Visual J++.  As you know, in Java development you can create your own package, which is basically a collection of classes that share a common namespace.  You can find a current list of packages available in the Microsoft virtual machine (VM) Non-MSDN Online link in the online documentation for the Microsoft SDK for Java Non-MSDN Online link.  Creating your own package is a great way to share your classes with one another as a complete unit.

Packages that are compatible with the Microsoft VM can easily be referenced and used within Visual J++. For complete information, refer to the Microsoft KB article Q243022, "HOWTO: Use Third-Party Packages from Visual J++ 6.0" Non-MSDN Online link.

For more information on this topic refer to the following resources:

The Web Men Talking Award

Do you dabble in Visual Basic, or do you consider yourself a hard core VB,er?  If so, this month's winner of the Web Men Award is for you. Our site this month is VBnet - The Visual Basic Developers Resource Centre Non-MS link.

Now we must admit that their use of frames can make it a little hard to navigate at first -- but once you get the feel for it, you won't even notice them.  Tom especially likes the use of the light blue for the logo and the pastel used in the bottom navigation bar.  We all agree that this site is definitely a great resource for all levels of developers.

Kusuma was impressed by the use of canned searches to immediately produce various search results from the Microsoft Knowledge Base Non-MSDN Online link.  You can find these searches under Dev Resources in the Knowledge Base Q-Search.

We all agreed that the Code samples area in the Code Library was a great resource.  There you will find samples that can include a small write-up, a snapshot of the sample application, a downloadable executable, the code necessary to create the sample, and references to related topics on the site.

Other great highlights:

  • API Index
  • FAQs Library
  • References to newsgroups
  • Book referrals

The folks at VBnet have definitely made this a required favorite for all Visual Basic programmers.

The Web Men in Short

Q: Zbigniew wants to avoid the vertical scrollbar in a full-screen-enabled Internet Explorer window.

A: Specify SCROLL=NO in the <BODY> tag of the page being displayed.  Note that window.open with scrollbars=no attribute has the opposite effect.

Q: Ritche wants to know if he has to purchase both the "SQL Server and Five Client Access Licenses for $1,399.00." and the ICP to start using ASP, Perl, and SQL Server for developing dynamic Web pages.

A: If you are just developing, our understanding is that you don’t need the Internet Connector licenses.  Once you are ready to deploy in the Internet, you will need them.  Check the SQL Server Web site Non-MSDN Online link for more information.

Q: G. Edwin and Tom Meadows both want to programmatically delete the history in Internet Explorer.

A: The security features of the browser do not allow this as a programmable option through script. Refer to History is now history for other possibilities.

Q: Matthias wants to hide the rectangular selection that Internet Explorer draws around a hyperlink after it is clicked.

A: Use the blur function: <A HREF=http://www.microsoft.com onclick="javascript:this.blur()">Go to MS</A>

Q: Rey Nuñez wants to detect if there is an opener window and the closed state if present.

A: Use if ((window.opener != null) || (typeof(window.opener) == "undefined")), and refer to KB article Q241109 Non-MSDN Online link.

Q: Tom Sexton asks what to use to develop a Web auction site.

A: Site Server Commerce Edition has an auction component.  Download the overview document Non-MSDN Online link. We’re sure there are other possibilities out there that can be shared through the commenting feature.

Q: Loretta Johnson wants a sample Web-based knowledge base she can use to implement her own.

A: See the MIND article Non-MSDN Online link to get started.

Q: In general, readers want to let their peers know of any samples or approaches that are different to something mentioned in this column.

A: Use the commenting feature at the top of this page, and your comments will be read by millions, thousands, hundreds, a few really cool people.

Rafael M. Muñoz, when not playing or coaching his favorite pastime (volleyball), provides technical assistance as a full-time developer support engineer for Microsoft Developer Support.

Thomas Moran, when not struggling to maintain some semblance of sanity (working with Rafael certainly doesn't help), toils with a prodigious team that creates articles and other content from Microsoft's Developer Support.

Kusuma Vellanki is one of the few people who like winters in Washington state more than summers. When not working as a Developer Support Engineer for the Internet Client team, she can be found torpedoing out of control down the ski slopes.

The Web Men's Greatest Hits

List of Web Men Topics


  
Show:
© 2014 Microsoft