Computing.Net > Forums > Programming > Invisible app in C

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Invisible app in C

Reply to Message Icon

Name: drigz
Date: February 18, 2004 at 05:40:52 Pacific
OS: winxp
CPU/Ram: -
Comment:

I've made 4 progs which, when run, post a message to my media player (either play/pause, stop, next or previous). i did this to make media center work on my multimedia keyboard but thats irrelevant. basically, i have the following code:

#include <windows.h>
#include <stdio.h>
#define WM_MC_COMMAND (WM_APP + 1000)

int main(int argc, char *argv[])
{
HWND mcHWND;

mcHWND = FindWindow("MJFrame", NULL);
//PostMessage(mcHWND, WM_MC_COMMAND, 10000, 0);
//PostMessage(mcHWND, WM_MC_COMMAND, 10002, 0);
//PostMessage(mcHWND, WM_MC_COMMAND, 10003, 0);
PostMessage(mcHWND, WM_MC_COMMAND, 10004, 0);
return 0;
}

but changed (removing and adding //) 4 times to do each function. this work, but whenever i run one of the .exes, am empty console window pops up for a split second. is there any way i can execute the same code but without the console window popping up (it seems that my keyboard can only run an exe, and without any parameters). thanks. (im using visual c++). (there is a full header for the media center control here: http://www.musicex.com/mediacenter/DevZone/MCCommands.h but i just used selective bits for simplicity.)




Sponsored Link
Ads by Google

Response Number 1
Name: Dr. Nick
Date: February 18, 2004 at 17:27:02 Pacific
Reply:

Here you go, I think this should work for you:

Go to Project > Settings > Link Tab.

In Project Options edit box replace '/subsystem:console' with '/subsystem:windows'

Select 'Output' in the 'Category' combobox and put 'mainCRTStartup' in the 'Entry-point symbol' box.

Rebuild the application and run it. It should run without opening a console window, but remember that all text I/O is lost.


0

Response Number 2
Name: drigz
Date: February 19, 2004 at 03:53:35 Pacific
Reply:

I'm using VC++.NET, and I managed to find /subsystem:console and changed that, but try as I may, I cannot find the second option, and now it gets a link error when I try to compile it. By the looks of it, I reckon the second step would fix the link error. Where in .NET can I change this?



0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Invisible app in C

help with console app in C++ www.computing.net/answers/programming/help-with-console-app-in-c/12107.html

SSH in c++ app www.computing.net/answers/programming/ssh-in-c-app/4020.html

App path in C++ www.computing.net/answers/programming/app-path-in-c/11660.html