Ok so heres what I am trying to do to help you understand my question. I am making my WINAPI load hidden so it's not in the taskbar and is only running as a process using ShowWindow(hwnd, SW_HIDE) on case WM_CREATE:

Now what I am trying to do is make my api run a file on my c:\ .
For example I got a program that I use that is a mouse macro recorder. It records mouse clicks and movements etc.. and it saves the recorded file as c:\ace.scp . So if I clicked on c:\ace.scp the recording runs the recorded clicks and so forth, and if I run c:\ace.scp through command line console it runs etc.. but what I am trying to do is make my api run it. So in my api as with my console experience what I did was placed system("c:\ace.scp"); right under my WM_CREATE case, and it runs the ace.scp, but it keeps a console window open. I dont want the console window open at all. Is there a way to run the ace.scp, or any executable without using system("DPATH"); ??? Like an windows API version that doesnt execute the program through an obvious console?

I'm really hoping to get a simple function that can do this and not a huge block of code, but either way whatever works.

Ok so heres what I am trying to do to help you understand my question. I am making my WINAPI load hidden so it's not in the taskbar and is only running as a process using ShowWindow(hwnd, SW_HIDE) on case WM_CREATE:

Now what I am trying to do is make my api run a file on my c:\ .
For example I got a program that I use that is a mouse macro recorder. It records mouse clicks and movements etc.. and it saves the recorded file as c:\ace.scp . So if I clicked on c:\ace.scp the recording runs the recorded clicks and so forth, and if I run c:\ace.scp through command line console it runs etc.. but what I am trying to do is make my api run it. So in my api as with my console experience what I did was placed system("c:\ace.scp"); right under my WM_CREATE case, and it runs the ace.scp, but it keeps a console window open. I dont want the console window open at all. Is there a way to run the ace.scp, or any executable without using system("DPATH"); ??? Like an windows API version that doesnt execute the program through an obvious console?

I'm really hoping to get a simple function that can do this and not a huge block of code, but either way whatever works.

ShellExecute(NULL, "open", "c:/program files/AutoMacroRecorder/ace.scp", NULL, NULL, SW_HIDE);


WOOT FOUND IT.. unless someone has something better

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.