Click here to Skip to main content
15,921,905 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: int limits Pin
Jerome Conus18-Dec-03 0:34
Jerome Conus18-Dec-03 0:34 
GeneralRe: int limits Pin
markkuk18-Dec-03 1:05
markkuk18-Dec-03 1:05 
GeneralRe: int limits Pin
Robert A. T. Káldy18-Dec-03 2:37
Robert A. T. Káldy18-Dec-03 2:37 
GeneralRe: int limits Pin
berndg18-Dec-03 2:44
berndg18-Dec-03 2:44 
GeneralRe: int limits Pin
Ravi Bhavnani18-Dec-03 7:16
professionalRavi Bhavnani18-Dec-03 7:16 
GeneralHide console window of Win32 console application Pin
rohit.dhamija17-Dec-03 23:12
rohit.dhamija17-Dec-03 23:12 
GeneralRe: Hide console window of Win32 console application [modified] Pin
Marek Grzenkowicz17-Dec-03 23:36
Marek Grzenkowicz17-Dec-03 23:36 
GeneralRe: Hide console window of Win32 console application Pin
Jonathan [Darka]17-Dec-03 23:57
professionalJonathan [Darka]17-Dec-03 23:57 
See the Console class on my website www.xfcpro.com, under the freestuff section for the full code, but here is a sample of what you need to do.

	// Obtain the Handle to this applications Console Window
	// As we don't have the lovely GetConsoleWindow() function under Win9X
	// We make a copy of the Console Windows title, then change it to something unique, ( a GUID value )
	// We then use this GUID to perform a FindWindow() ensuring we only locate the console for 'this' application
HWND Console::GetConsoleWindow9X()
{
	HWND hWndConsole = NULL; // The console window handle

	TCHAR szTempTitle[_MAX_PATH];
	TCHAR szTempOldTitle[_MAX_PATH]; // This is used to store the Console Window's title temporarily

		// Get the title of the console window - this may not be unique
	if(GetConsoleTitle(szTempOldTitle, _MAX_PATH) > 0)
	{
			// Lets make the title 'unique', so that we can perform FindWindow()...
			// Created as a UNICODE string
		WCHAR szBuff[_MAX_PATH];
		memset(&szBuff, 0, _MAX_PATH);

		GUID obGuid;
		CoCreateGuid(&obGuid);

		StringFromGUID2(obGuid, szBuff, _MAX_PATH);
		wsprintf(szTempTitle, "%ws", szBuff);

		SetConsoleTitle(szTempTitle);

		Sleep(50); // This gives enough time to ensure the console title is updated, else the FindWindow may fail

			// Ok, try to Find the window using a variety of class names as we don't really know what OS we are running on
		if((hWndConsole = FindWindow(_T("tty"), szTempTitle)) == NULL)
			if((hWndConsole = FindWindow(_T("ConsoleWindowClass"), szTempTitle)) == NULL) // Windows 2000 
				hWndConsole = FindWindow(NULL, szTempTitle); // Catch all

		SetConsoleTitle(szTempOldTitle); // Set the title back to it's original value
	}

	return hWndConsole;
} 

	// Show/Hide the console applications console window
void Console::ShowConsoleWindow(bool bHide /* = false */)
{
	HWND hWndConsole = NULL;

#if(_WIN32_WINNT >= 0x0500) // Windows 2000 and later only
	hWndConsole = GetConsoleWindow();
#else
	hWndConsole = GetConsoleWindow9X();
#endif

	ShowWindow(hWndConsole, (bHide) ? SW_SHOW : SW_HIDE);
	
	iLastErrorCode_ = XFC_SUCCESS;
}


regards,
Dark Angel
GeneralRe: Hide console window of Win32 console application Pin
rohit.dhamija18-Dec-03 16:39
rohit.dhamija18-Dec-03 16:39 
GeneralRe: Hide console window of Win32 console application Pin
Jonathan [Darka]18-Dec-03 22:35
professionalJonathan [Darka]18-Dec-03 22:35 
Generalmsflxgrd.ocx Pin
avelasco17-Dec-03 23:05
sussavelasco17-Dec-03 23:05 
GeneralI need to load a driver Pin
abhiram17-Dec-03 22:17
abhiram17-Dec-03 22:17 
Generali need the gurushelp-image processing Pin
satadru17-Dec-03 21:32
satadru17-Dec-03 21:32 
GeneralRe: i need the gurushelp-image processing Pin
Monty217-Dec-03 21:39
Monty217-Dec-03 21:39 
GeneralRe: i need the gurushelp-image processing Pin
satadru17-Dec-03 23:37
satadru17-Dec-03 23:37 
GeneralRe: i need the gurushelp-image processing Pin
Monty218-Dec-03 0:25
Monty218-Dec-03 0:25 
GeneralSetFocus, "Enter" key and child dialogs Pin
J.B.17-Dec-03 21:18
J.B.17-Dec-03 21:18 
GeneralRe: SetFocus, "Enter" key and child dialogs Pin
tiaozi18-Dec-03 2:27
tiaozi18-Dec-03 2:27 
GeneralRe: SetFocus, "Enter" key and child dialogs Pin
J.B.18-Dec-03 5:20
J.B.18-Dec-03 5:20 
GeneralRe: SetFocus, "Enter" key and child dialogs Pin
J.B.18-Dec-03 6:02
J.B.18-Dec-03 6:02 
GeneralRe: SetFocus, "Enter" key and child dialogs Pin
J.B.18-Dec-03 6:25
J.B.18-Dec-03 6:25 
GeneralVC++ Method Pin
Ming Yan17-Dec-03 21:04
Ming Yan17-Dec-03 21:04 
GeneralRe: VC++ Method Pin
Abebe17-Dec-03 21:37
Abebe17-Dec-03 21:37 
GeneralRe: VC++ Method Pin
Ming Yan17-Dec-03 21:40
Ming Yan17-Dec-03 21:40 
GeneralRe: VC++ Method Pin
Balkrishna Talele18-Dec-03 0:03
Balkrishna Talele18-Dec-03 0:03 

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.