Hola a todos compañeros, tengo una duda y es que no sé ejecutar un "bloc de notas" con una instrucción en C.
Es decir, mi objetivo es abrir un bloc de notas que tengo ya hecho con instrucciones en C para luego modificar mi documento en el propio bloc de notas.
Ya tengo el programa hecho pero me falta la instrucción que serviría para ejecutar el bloc de notas.
Podrías ayudarme por favor, les estaré agradecido!
Buen día!
podría ser así.
(void)system("notepad.exe");
o
ShellExecute(NULL,"open","notepad.exe",NULL,NULL,SW_SHOWNORMAL);
saludos
unos links con información detallada, código..
http://www.experts-exchange.com/Programming/System/Windows__Programming/A_1595-Execute-a-Program-with-C.html
http://stackoverflow.com/questions/5822113/opening-systemroot-system32-calc-exe-from-a-32-bit-process-redirects-to-anothe
http://bytes.com/topic/c/answers/761198-how-can-i-run-execute-another-application-calc-exe-anotherapplication-vc
en resumen, tenés estas posibilidades:
CitarShellExecute
ShellExecuteEx
CreateProcess
CreateProcessAsUser
CreateProcessWithLogonW
system
_exec
_spawn, _wspawn
Ok, probaré las distintas soluciones a ver cual me convence más. Muchísimas gracias por la ayuda prestada
Cita de: Danyfirex en 7 Mayo 2013, 01:33 AM
podría ser así.
..................................
ShellExecute(NULL,"open","notepad.exe",NULL,NULL,SW_SHOWNORMAL);
Esta última incluyendo la librería windows.h.
Saluditos! .... .. (http://st.forocoches.com/foro/images/smilies/aaaaa.gif)
ShellExecute(NULL,"open","notepad.exe",NULL,NULL,SW_SHOWNORMAL);
Este me convence pero donde pone "notepad.exe" no podría poner una variable char?
Cita de: Borluck en 7 Mayo 2013, 17:03 PM
ShellExecute(NULL,"open","notepad.exe",NULL,NULL,SW_SHOWNORMAL);
Este me convence pero donde pone "notepad.exe" no podría poner una variable char?
Puedes usar :
char note[]="notepad.exe";
ShellExecute( NULL, "open", note, NULL, NULL, SW_SHOWNORMAL );
Saluditos!... .. (http://st.forocoches.com/foro/images/smilies/SimpHomer.gif)
MUCHÍSIMAS GRACIAS!!!! ;-) ;-) funciona!!!!