It's because GetProfileInt(L"Mapi", L"Mail", 0) and SearchPath(L"mapi32.dll") are called within the handler for WM_INITMENU. For some reason, a custom message (WM_APP) is sent everytime you left click on the main part of the window (whether it's a web browser, or code), this custom message does something which sends a WM_INITMENU and thus investgates win.ini and the path.
Even worse, the web browser window sends the custom message constantly when the mouse is within the window (you don't even have to be moving the mouse:
Open Pelles C so it shows the new start page
Open Spy++ and point it at main IDE window (the whole thing, not just the web browser bit) and put it on message view
Move the mouse onto the start page and leave it
You get a constant loop of 6 message items - the custom message, WM_INITMENU, and WM_MENUSELECT all being sent and returned from