MSTechpages
  • Home
  • Knowledge Base
  • Reviews
  • Articles
  • About
News

Windows XP Logon Picture

Sep 10, 2026·Dustin

Estimated Reading Time: 1 min

Ever wonder how Windows XP chose which picture to use as a logon picture? Some attributed it to the name (and some claimed it chose one due to their ethnicity), others just by random. Well, yes, it’s completely by random. And, it is a simple algorithm that does it. Raymond Chen gives you a look at how it’s done and how it has some safeguards to not completely crash the system if someone adds way too many pictures.

The function uses a one-pass random selection algorithm. I can immediately think of two benefits of this decision. First, compared to the naïve two-pass algorithm of counting up all the items, then randomly picking a number from 1 to n, and then iterating a second time to find the item at that index, it’s more efficient because it reduces the amount of calls into the file system, which is where the bottleneck is. Furthermore, the one-pass algorithm avoids complications if the number of files in the directory changes while the code is running.

Related Products on Amazon
USB Flash DriveShop on Amazon
External SSDShop on Amazon
Wireless KeyboardShop on Amazon
PC Cleaning KitShop on Amazon

MSTechPages is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.com. As an Amazon Associate, we earn from qualifying purchases at no extra cost to you.

Dustin

Dustin is the founder and head editor of MSTechpages. He started the site to help other users of Windows. He has been very active with helping others throughout the years, from USENET to Microsoft Answers to the latest Microsoft Communities as well as other internet forums such as Reddit. He is a Sr. System Administrator, holds several industry certifications and degrees.

Related Articles

News

Windows 11 26H2 In Release Preview Channel

Aug 28, 2026·Dustin
News

Microsoft Cleaning Up Search in Windows 11

Jul 14, 2026·Dustin
News

RTX Spark and New Surface Laptop Ultra

Jun 2, 2026·Dustin

Windows Insider Builds

Beta
26220.9223
Beta (26H1)
28020.2731
Experimental
26340.9233
Experimental (26H1)
28120.276
Experimental (Future)
29648.1
Recent Knowledge Base Articles
  • Disable Touch Screen in Windows
  • Add “End Task” To Right Click Application on Taskbar
  • Offline install of .Net Framework 3.5 using DISM
  • Disable Autohide Scrollbars
  • Install Active Directory RSAT in Windows 10 1809 or later
  • Disable File Grouping in File Explorer
  • Forget Wireless Networks
  • Show Hidden Files & Folders
  • Enable Night Light Mode
  • How to Fix a Network Printer Showing Offline
MSTechpages

Your source for Windows news, tutorials, and Insider builds.

Windows

  • Windows 11
  • Windows Insider
  • Canary Channel
  • Cumulative Updates

Resources

  • Knowledge Base
  • Articles
  • Reviews

Company

  • About
  • Contact
  • Privacy Policy
  • Advertise

© 2026 MSTechpages. All rights reserved.

Privacy