I'm using `GetOpenFileName` and setting the `lpstrInitialDir` member of the `OPENFILENAME` struct to the directory I want as the initial directory. However on Win7 my app seems to remember what directory the user last opened and it ignores the `lpstrInitialDir` settings and goes to the last directory. 

[Apparently this is by design](http://msdn.microsoft.com/en-us/library/ms646839(VS.85).aspx)

> 
> lpstrInitialDir  
> 
>  LPCTSTR  
> 
>  The initial directory.
>  The algorithm for selecting the initial directory varies on different platforms.
> 
> 
> Windows 7:
> 
> 
> 1.If lpstrInitialDir has the same value as was passed the first time the
>  application used an Open or Save As
>  dialog box, the path most recently
>  selected by the user is used as the
>  initial directory.  
> 
>  2.Otherwise, if lpstrFile contains a path, that path is the initial
>  directory.  
> 
>  3.Otherwise, if lpstrInitialDir is not NULL, it specifies the initial
>  directory.
> 
> 
> 

Does anyone know how to stop this happening? 

I want the directory I specify to be the initial directory regardless of what the file the user last opened i.e. I want condition 3 above to apply. I did the obvious and had a search through the registry but I couldn't find anything related to the problem.