I am developing an application using Win32 GetOpenFileName win32 API. When the window opened even if I click cancel memory usage incredibly increases from 2 mb to 8 mb. What could be the reason of this behaviour?
Most likely it's something else in your prograsm. Comment out the call to GetOpenFileName() then re-run your test to see what happens. My guess is that the program will still display the same behavior.