I have tried to write a program, in which the GetOpenFileName dialog box does not close. However, it seems to be missing something, since it does close, ya dig?
I think that the problem is the OFNHookProc function, but I cannot identify it:
I have localised the problem to the SetWindowLong function. It fails when I run the program (it returns 0), but GetLastError returns 0 (it doesn't give me an error message). Since I am running on a 64 bit platform (Windows 8), I tried using SetWindowLongPtr instead, but nothing changed.
By the way, I do receive the CDN_FILEOK message, that I have confirmed. SetWindowLong is the only problem.
Nailed it! I had all kinds of ludicrous solutions to finding the right HWND, and I did not check the parameters for OFNHookProc of some reason. Anyway, goodbye.