Thursday, May 25, 2006

Useful Alt+Space Shortcuts

Pressing Alt+Space will for most windows activate the "top-left corner menu" for the window. There are a few useful tasks that can be performed from this menu using the keyboard that generally otherwise could only be performed by using the mouse.

In a command prompt window, Alt+Space, e, p -- Performs a clipboard paste. This is handy to perform a quick paste at the command prompt without needing to take your hands off the keyboard. (A Paste can also be performed in a command prompt window by right-clicking the window if "QuickEdit Mode" is enabled (in the Properties dialog), or by right-clicking and then selecting Paste from the context menu if QuickEdit is disabled).

Alt+Space, n -- Minimizes the current window. Also, Alt+Space, x will maximize the window, and Alt+Space, r will "restore" the window to its original size after it has been maximized.

Alt+Space, m -- Puts the current window into "move" mode. In this mode, you can move the position of the current window with the arrow keys. This can be useful for retrieving a window which is completely off the current screen (if you had multiple monitors connected and then disconnected the monitor on which the window was located, for example).

Sunday, May 14, 2006

Giving up on DHCP with Linksys wireless router

I've been continuing to have trouble with the wireless functionality of my home Linksys router, a model BEFW11S4. As I posted previously, I've never quite had the wireless connectivity with my PDA (a Dell Axim X30 PocketPC) working the way I wanted. Sometimes I activate the wireless connection on the PDA and it works perfectly; other times I try to connect, and although the PDA can see the router (with the correct SSID and excellent signal strength), it will never get a valid IP address. (I have the PDA set to get an IP via DHCP; apparently the router is just never assigning the PDA an IP address.)

I did end up upgrading the router firmware to the latest version (1.52.02). This seems to have resolved the problem with the router's DHCP server where it was never reusing IP addresses (and thus eventually running out), but now the router is just kind of acting kind of flaky; sometimes the PDA will get an IP address and be able to connect to the Internet immediately, sometimes the PDA will get an IP after a long delay (several minutes); and sometimes the PDA will just never get an IP. Since the PDA does occasionally connect successfully, that tells me that the issue is probably not with my security configuration.

Further, occasionally if the PDA is connected but then briefly loses contact with the router, it will lose its IP and its connection. This happens even after I've just been using the wireless connection for a short time (so the PDA's lease on the IP address should not yet have expired).

At least once, when the PDA has been unable to connect, if I cycle the power on the router (unplug it and then plug it back in), the PDA is then immediately able to connect with no problem.

My DVR was also unable to connect to the wireless network for a while yesterday -- I also resolved this by cycling the power on the router. This seems to indicate that the problem is with the router, not with the configuration or hardware of my PDA.

I finally decided to throw in the towel and forget about using DHCP with my PDA, and instead just assigned it a static IP address. This seems to be working fine; I haven't had any connectivity issues with the PDA since assigning the static address. Also, I didn't have to enter DNS server information on the PDA to be able to connect to the Internet successfully; just entering the static IP and the gateway (router) IP was sufficient. This is good, since it should keep the hassle of switching between a static IP (when I'm using the PDA at home) and a dynamic IP (when I'm anywhere else) to a minimum.

I poked around for a solution on Usenet briefly (searching for "BEFW11S4 DHCP" on Google Groups), and although I saw some posts about people having trouble with this model router and DHCP, I didn't see any good solutions. One person reported exchanging their BEFW11S4 for another copy of the same model, and they didn't have any problems after that, so maybe the DHCP functionality on these models is hit-or-miss.

In any event, I'm glad I have a decent workaround for the issue for now. Next time I go shopping for a wireless router, though, I'll probably look at brands other than Linksys.

Update 5/15/2006: Unfortunately, my workaround of using a static IP address on the PDA isn't as convenient as I thought. Initially, as noted above, I thought there was no need to enter DNS server information on the PDA; it had appeared that the PDA was picking this information up from the router. However, the PDA is reporting "Site Not Available" errors for any site I hadn't visited recently; appearently, DNS mappings for recently-visited sites were cached on the PDA, so things appeared to be working ok at first as I tested visiting sites that I had visited recently.

A further annoyance is information I manually enter when setting the PDA to use a static IP (the IP address, subnet mask, gateway IP address, and now primary and secondary DNS server IP addresses) gets cleared whenever I set the PDA to use a dynamic IP (when I'm online with the PDA away from home), so I have to re-enter all of that information whenever I return home. (This is the fault of the PDA software, not the router, but it does compound the problem with the router's DHCP service being so flaky.)

I may have to keep tinkering with the router to see if I can get the DHCP service to where it "just works".

Wednesday, May 10, 2006

After installing: Do I *really* need to reboot?

Oftentimes, after installing some new software application that uses an InstallShield wizard (or similar tool) for its setup, a prompt to reboot the machine appears, stating that the new application can't be used until the reboot is performed. I've asked myself the question: Do I really need to reboot my machine to use the program?

I came across a utility that helps answer this question. At least in some cases, the reason that the install program wants to reboot the machine is that a file that it tried to write during the install couldn't be written because it was already in use by another process, so the installer sets up a task to write the file the next time the machine is rebooted (at which time the target file should be unlocked because the process that was locking it before was cleared during the reboot).

The PendMoves command-line utility from Sysinternals displays a list of these "pending move" operations. By running pendmoves and looking at the results, you can get more information to help decide whether a reboot is really necessary before running the app. For example, if the only file that is pending write is a help file, it's likely to be safe to run the application even without the latest version of that file installed yet.

I'm not sure how well this technique works with Windows updates from Microsoft, but it has worked well for me for standard software application installs.

Visual Studio Keyboard Shortcuts

I was looking for a way to expand and collapse Visual Studio .NET regions, and found one today on Visual Studio Hacks; Ctrl+M, Ctrl+M (chord key combination) expands or collapses the current region. This works on both user-defined regions (from #region and #endregion) and on regions that the IDE itself defines, such as class/method XML comments.

Another Visual Studio .NET keyboard shortcut/feature (also appearing on the linked Visual Studio Hacks page) which I use a lot is Ctrl+Shift+V. Like the standard Ctrl+V supported by most apps, this does a Clipboard Paste, but if you continue to hold down Ctrl+Shift and press V again, the text that was just pasted is replaced with the next-most-recently Copied text. This feature is known as the Clipboard Ring.

Wednesday, May 03, 2006

Notepad.exe selection/scroll bug

I found another bug with Notepad.exe earlier today. When Notepad has word wrap turned off, an entire long (longer than the window width) line of text is selected, and the window is scrolled all the way to the left, then when the Notepad window loses focus, it automatically (and unexpectedly) scrolls all the way to the right.

This means you can't have two Notepad windows on the screen, each with a long line of text selected, and each scrolled to the left, at the same time. This is inconvenient when trying to use side-by-side Notepad instances to compare a line of text in two similar files (with the line being compared selected in each window to make that line stand out).