The aim of my program is to trigger Save As dialog of Notepad via Save As item in Notepad's menu.
SendMessage(hWndOfNotepad, WM_COMMAND, SaveAsMenuItemId, IntPtr.Zero);
Console.log("Done!");
When run the code above, Notepad's Save As dialog show up and the console will log "Done!" untill user click Save Button. Why does my program have to wait? How to avoid it?