That works just fine, thanks. Is there any way I can have the console window do things while Notepad is open and being used? At present, while Notepad is open and active, the console window just waits for the 10 minutes to be up. It would be nice if I could have the console window display a countdown of the time left while Notepad is being used.
--- In [email protected], Thomas Hruska <[EMAIL PROTECTED]> wrote: > > remarknibor wrote: > > Thanks for the advice. Everything seems to be working well. My code > > is below. My only problem is how to open Notepad with a pre- existing > > (blank) file that I've created. More simulating keypresses? Or is > > there a way of doing it when CreateProcess is used? > > > > > > STARTUPINFO si; > > PROCESS_INFORMATION pi; > > > > DWORD dwCode = 0; > > HWND hwnd; > > > > ZeroMemory(&si, sizeof(STARTUPINFO)); > > > > si.cb = sizeof(STARTUPINFO); > > si.dwFlags = STARTF_USESHOWWINDOW; > > si.wShowWindow = SW_SHOWNORMAL; > > > > int i; > > > > if(CreateProcess(NULL, // No module name (use command line) > > "notepad.exe", // The command line to be executed > > notepad.exe SomeExistingFile.txt > > > -- > Thomas Hruska > CubicleSoft President > Ph: 517-803-4197 > > *NEW* MyTaskFocus 1.1 > Get on task. Stay on task. > > http://www.CubicleSoft.com/MyTaskFocus/ >
