Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
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.)

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.

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?

![]() |
![]() |
![]() |

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