how could I make an Invisible program!!!?
Hi all;
this is my first subject, I'm a new C++ programmer, and I've a question:
How could I make an Invisible Console-application that works in the backgraound of the PC without any thing that we can see on the screen
I mean what's the code that makes an Application without that dos screen
I just want a program that works but we can't see it
Thanks all;
Good luck
Re: how could I make an Invisible program!!!?
You can create a NT service, If you don't plan on supporting Win98/95/Me
NT services will run in background and do not appear on taskbar or tray.
OR
Make a C++ Windows application, but hide the default dialog , or remove it.
Re: how could I make an Invisible program!!!?
Use invisible code. :D
There are several choices, all can be inmplemented in Visual C++ 6.0:
1. make a service - this might be an overkill
2. use a Windows application but use winmain as you would do with main
3. make a console application but destroy it's console.
for 2
The simplest is 2. How to create it: Use New Project, Win 32 application. you will end up with the code bellow which does exactelly what you need.
Code:
// PlainWnd.cpp : Defines the entry point for the application.
//
#include "stdafx.h"
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
// TODO: Place code here.
return 0;
}
Re: how could I make an Invisible program!!!?
I'm sorry but I want an Invisible " Console Application " not visual win api
Re: how could I make an Invisible program!!!?
Quote:
Originally Posted by virus975
I'm sorry but I want an Invisible " Console Application " not visual win api
There is no Visual Win Api involved.
We are discussing here about Console applications, Windows applications, Dialog Applications etc as application frameworks provided with Visual Studio. There are some other differences but in this case they are irrelevant.
The Windows application that you want to avoid assumes a window, a message loop and much more.
Re: how could I make an Invisible program!!!?
Quote:
Originally Posted by virus975
I'm sorry but I want an Invisible " Console Application " not visual win api
You can create a Windows application but don't create any windows. It'll run but nothing will show up on the screen.
Re: how could I make an Invisible program!!!?
Quote:
Originally Posted by virus975
I'm sorry but I want an Invisible " Console Application " not visual win api
you can use this code to make your console invisible, but it will work only on win2000 and higher.
Code:
typedef HWND (WINAPI *tGetConsoleWindow)(void);
tGetConsoleWindow pGetConsoleWindow = 0;
HINSTANCE handle = ::LoadLibrary("Kernel32.dll");
if ( handle )
pGetConsoleWindow = (tGetConsoleWindow)::GetProcAddress(handle, "GetConsoleWindow");
if ( pGetConsoleWindow )
{
HWND hwnd = pGetConsoleWindow();
::ShowWindow(hwnd,SW_HIDE);
}
if ( handle )
::FreeLibrary(handle);
Cheers
Re: how could I make an Invisible program!!!?
I'll see the codes
and waiting for other members
thanks all.
Re: how could I make an Invisible program!!!?
With this request and a name like Virus975, maybe you should explain what you're up to before we provide much more info.
Re: how could I make an Invisible program!!!?
I sware I'm not planning anything but this is my username in everywhere ( in all forums, msn, yahoo, anywhere you want )
cause I use only one user and pass.
Re: how could I make an Invisible program!!!?
Just busting your chops, but we do have to be careful about aiding and abetting the enemy. :)
Re: how could I make an Invisible program!!!?
Re: how could I make an Invisible program!!!?
What exactly are you trying to accomplish?
What will the program do?
Do you want an icon in the system tray for you application?
Re: how could I make an Invisible program!!!?
I want to make a hidden program(without that console screen) like this simple one:
int main()
{
do {
static int i = 1;
i++;
}while ( i != 100);
return 0;
}
Re: how could I make an Invisible program!!!?
There is nothing this program is doing with console.. Then why are you insisting on a console program ?
You can as well do the same in a win32 program as PadexArt already suggested in post #3