Digiwar - the Yeep-blog

July 19th, 2006

InternetGetCookie/InternetSetCookie (WinInet) changed with Internet Explorer 7

So last week I was implementing the Google Authentication for Installed Applications in Feed Vortex and after I solved the cross-thread GUI access problems I ran into a new batch of problems. You see, Google authenticates using cookies, but when you use the Google Authentication API for desktop applications you only get the value that needs to be stored in the cookie and not the cookie itself. Since I P/Invoke the WinInet functions, I needed to store the cookie using the InternetSetCookie API and then the WinInet APIs themselves will figure out what cookie to get.

But it wasn’t so simple. Using Fire Fox I noticed that Google stores its cookies with the domain “.google.com” and the path “/”. But when I try to do that I get error 12006 (ERROR_INTERNET_UNRECOGNIZED_SCHEME). Allright, so I add “http://” to the front, but then I confronted with error 123 (ERROR_INVALID_NAME). This confused me. But then I remembered I was running IE7 Beta 3 on my desktop, so I put the code on my laptop which still uses goold old IE6 and it works.

One of the changes for IE7 is their more secure URL cracking methods. But apparently IE7 also updates the WinInet.dll, which other applications use. So it’s new security fixes will have effect on other applications, not just applications that use an embedded IE, but all applications that use WinInet. So I spend half a day figuring out what to do. And in the end I found out that using “http://www.google.com” as the cookie domain works as well.

[Now playing: The Project Hate MCMXCIX - With Desperate Hands So Numb]

July 12th, 2006

Reboot-craze

What is it with rebooting these days? I was so happy with Windows 2000 and then with Windows XP where Microsoft removed tens, maybe even hundreds of reasons Windows needed to reboot. Only driver updates or service pack installs should require a reboot.

Yet, when I wanted update Acrobat Reader, I had to reboot a total of 4 times(!!!!!) It’s just a program to read and render files! Why would it need a reboot?

Then I wanted to uninstalled a game. After uninstalling, it also wanted to reboot? Why? It’s a fucking game!!

Are developers getting lazy again? Just making you reboot after everything to make sure it works? Or do they install some really nasty piece of malware, under the guise of “protecting their intellectual property”, like Sony did.

Whatever is the case, it just sucks!

[Last played: Nightwish - Beauty Of The Beast]

July 12th, 2006

Treeview boldness

This is something I’ve had on my “to-write”-list for some time now.

When I started working on Feed Vortex I wanted to have a treeview with the feeds you we’re subscribed to and when you’d have unread articles the feed would have its name in a bold font and the number of unread articles would be in paranthesis behind the name of the feed.

It was pretty simple: just get the font object from the treenode, make it bold and put it back. Easy as that.

Until I looked at the treeview. The longest feed label seemed truncated. I first thought this had to do with the window I had put the treeview on, but this wasn’t the case. It turns out that the treeview determines how much space it should reserve for its labels only when you create it, or add a new treenode to it. Basing it on the font it has at that time.

So the solution was actually pretty simple. Create the treeview with a bold font by default and then add a treenode with a regular font. The other way around doesn’t work. Also, just to be sure, I added some additional spaces to the end of the label, just to make absolutely sure I have enough space left to display the label when I set the font to bold.

[Last played: Nightwish - Beauty Of The Beast]

|