Click here to Skip to main content
15,911,035 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: How to use Win API: CreateProcess ? Pin
ThatsAlok26-Dec-05 17:46
ThatsAlok26-Dec-05 17:46 
QuestionHelp Connecting a unconnected Network-Drve Pin
meinhard_risch23-Dec-05 5:36
meinhard_risch23-Dec-05 5:36 
QuestionDrop from Shell Dll - Strategy Question Pin
depotdog23-Dec-05 5:24
depotdog23-Dec-05 5:24 
QuestionRunning a console app hidden, no window Pin
Gunn31723-Dec-05 4:43
Gunn31723-Dec-05 4:43 
AnswerRe: Running a console app hidden, no window Pin
PJ Arends23-Dec-05 10:21
professionalPJ Arends23-Dec-05 10:21 
AnswerRe: Running a console app hidden, no window Pin
Michael Dunn23-Dec-05 20:28
sitebuilderMichael Dunn23-Dec-05 20:28 
GeneralRe: Running a console app hidden, no window Pin
Gunn3174-Jan-06 3:45
Gunn3174-Jan-06 3:45 
AnswerRe: Running a console app hidden, no window Pin
vipinasda24-Dec-05 7:16
vipinasda24-Dec-05 7:16 
How about try this?
Q124103: "HOWTO: Obtain a Console Window Handle (HWND)"

and then in the main(), do a ShowWindow(SW_HIDE);

#include <windows.h>
#include <stdio.h>

HWND GetConsoleHwnd(void)
{
#define MY_BUFSIZE 1024 // Buffer size for console window titles.
HWND hwndFound; // This is what is returned to the caller.
char pszNewWindowTitle[MY_BUFSIZE]; // Contains fabricated
// WindowTitle.
char pszOldWindowTitle[MY_BUFSIZE]; // Contains original
// WindowTitle.

// Fetch current window title.

GetConsoleTitle(pszOldWindowTitle, MY_BUFSIZE);

// Format a "unique" NewWindowTitle.

wsprintf(pszNewWindowTitle,"%d/%d",
GetTickCount(),
GetCurrentProcessId());

// Change current window title.

SetConsoleTitle(pszNewWindowTitle);

// Ensure window title has been updated.

Sleep(40);

// Look for NewWindowTitle.

hwndFound=FindWindow(NULL, pszNewWindowTitle);

// Restore original window title.

SetConsoleTitle(pszOldWindowTitle);

return(hwndFound);
}

main()
{
ShowWindow(GetConsoleHwnd() , SW_HIDE);
while(1)
Sleep(10000);
}


Vipin Aravind - MVP
AnswerRe: Running a console app hidden, no window Pin
Owner drawn26-Dec-05 17:27
Owner drawn26-Dec-05 17:27 
QuestionAnalyze sound volume? Pin
Matrim Cauthon23-Dec-05 3:03
Matrim Cauthon23-Dec-05 3:03 
Questionadd colors to buttons Pin
Manmohan_198323-Dec-05 2:58
Manmohan_198323-Dec-05 2:58 
AnswerRe: add colors to buttons Pin
FarPointer23-Dec-05 3:57
FarPointer23-Dec-05 3:57 
GeneralRe: add colors to buttons Pin
Manmohan_198325-Dec-05 18:21
Manmohan_198325-Dec-05 18:21 
GeneralRe: add colors to buttons Pin
FarPointer25-Dec-05 20:28
FarPointer25-Dec-05 20:28 
GeneralRe: add colors to buttons Pin
ThatsAlok25-Dec-05 21:03
ThatsAlok25-Dec-05 21:03 
Questionunsigned char Pin
Smith#23-Dec-05 0:36
Smith#23-Dec-05 0:36 
AnswerRe: unsigned char Pin
Russell'23-Dec-05 0:52
Russell'23-Dec-05 0:52 
AnswerRe: unsigned char Pin
toxcct23-Dec-05 2:18
toxcct23-Dec-05 2:18 
GeneralRe: unsigned char Pin
Nemanja Trifunovic24-Dec-05 10:09
Nemanja Trifunovic24-Dec-05 10:09 
GeneralRe: unsigned char Pin
segment_fault3-Jan-06 18:02
segment_fault3-Jan-06 18:02 
QuestionTo Delete Objects created by IMPLEMENT_DYNACREATE Pin
birajendu22-Dec-05 23:38
birajendu22-Dec-05 23:38 
AnswerRe: To Delete Objects created by IMPLEMENT_DYNACREATE Pin
Sheng Jiang 蒋晟24-Dec-05 9:28
Sheng Jiang 蒋晟24-Dec-05 9:28 
QuestionRGBQUAD in Bitmap Class Pin
vikas amin22-Dec-05 23:29
vikas amin22-Dec-05 23:29 
AnswerRe: RGBQUAD in Bitmap Class Pin
toxcct22-Dec-05 23:46
toxcct22-Dec-05 23:46 
AnswerRe: RGBQUAD in Bitmap Class Pin
Russell'22-Dec-05 23:56
Russell'22-Dec-05 23:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.