The following snippet of code can be used to determine whether a Windows Mobile ComboBox (in .NET Compact Framework) is currently dropped down or not:
private const int CB_GETDROPPEDSTATE = 0x0157;
private bool IsComboBoxDroppedDown(ComboBox comboBox)
Message comboBoxMessage = Message.Create(comboBox.Handle, CB_GETDROPPEDSTATE, IntPtr.Zero, IntPtr.Zero);
return (comboBoxMessage.Result != IntPtr.Zero);
I found a pretty easy way of disabling the password protection in the new Excel Worksheet files (XLSX) used by Excel 2007 and 2010. Just follow these simple steps:
- Change the file extension from .XLSX to .ZIP
- Extract the file to a folder with your favorite unzipper (7-Zip is what I used)
- Go to the xlworksheet sub-folder that you just extracted
- There should be one or more files named like: sheet1.xml (sheet2.xml, etc). Inside of one of those files is an XML tag: <sheetProtection password=… />. Delete that entire XML tag.
- Re-zip the files back up
- Rename from .ZIP to .XLSX
UPDATE: This method only applies to password protected workbooks. If the file is secured with the “Encrypt with Password” feature, it will not work.
UPDATE 2: It is important that you don’t have Windows configured to hide file extensions (which unfortunately is the default behavior). To enable displaying file name extensions, follow this Microsoft support article.
The code below will return all users on the machine that are not marked as disabled. Be sure to add a reference to System.DirectoryServices.
private const int UF_ACCOUNTDISABLE = 0x0002;
private List<DirectoryEntry> GetActiveMachineUsers()
List<DirectoryEntry> returnValue = new List<DirectoryEntry>();
DirectoryEntry localMachine = new DirectoryEntry("WinNT://" + Environment.MachineName);
foreach (DirectoryEntry user in localMachine.Children)
if (user.SchemaClassName == "User")
if (((int)user.Properties["UserFlags"].Value & UF_ACCOUNTDISABLE) != UF_ACCOUNTDISABLE)
I’ve created a new WordPress blog, as it seems I lost the domain I’ve had for the last 11+ years (digitalpropulsion.org). I’m not too worried about it, but I figured it was time to start up a new one. You can find more of my social links at about.me/aplocher.
This WordPress blog will be used primarily for programming and misc technology posts. I’ll continue using my Tumblr account for videos, ridiculous pics, and links to other articles.
Over the next few days I’ll be reposting some of my older programming posts.