c# - Get untitled notepad contents -
i looking solution in c# or in language following: 1) let have opened notepad , have write inside. file unsaved. 2) via program create save "foo.txt" notepad file , close it. in c# can process name or id can have process. how make process save , close? or maybe @ least data of notepad , can save via systemio. problem how process data of process , in particular example notepad text (remember text unsaved no way recover path). thanks lot. or maybe @ least data of notepad as others have said, it's not best approach far... ...but sure, can that. here's example retrieves contents of open notepad instances , spits them out in console: public partial class form1 : form { public form1() { initializecomponent(); } private const int wm_gettext = 0xd; private const int wm_gettextlength = 0xe; [system.runtime.interopservices.dllimport("user32.dll", setlasterror = true)] public static extern intptr f