Click here to Skip to main content
16,008,010 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralWhen press Enter Key Pin
22-Oct-01 22:29
suss22-Oct-01 22:29 
GeneralRe: When press Enter Key Pin
Jonas Larsson22-Oct-01 22:33
Jonas Larsson22-Oct-01 22:33 
GeneralRe: When press Enter Key Pin
Cris23-Oct-01 2:34
Cris23-Oct-01 2:34 
GeneralRe: When press Enter Key Pin
Michael Dunn22-Oct-01 22:35
sitebuilderMichael Dunn22-Oct-01 22:35 
GeneralDestroying COleSafeArray ... Pin
Hadi Rezaee22-Oct-01 18:41
Hadi Rezaee22-Oct-01 18:41 
GeneralRe: Destroying COleSafeArray ... Pin
Christian Graus22-Oct-01 18:47
protectorChristian Graus22-Oct-01 18:47 
Questiona Console Question ? Pin
The_Server22-Oct-01 17:39
The_Server22-Oct-01 17:39 
AnswerRe: a Console Question ? Pin
Ben Burnett22-Oct-01 20:14
Ben Burnett22-Oct-01 20:14 
If you need to support many Windows flavours then give this a try;

TCHAR szTitle [ 1024 ];
::GetConsoleTitle ( szTitle, 1024 );	
HWND hWnd = ::FindWindow ( NULL, szTitle );

if ( NULL != hWnd ) {

	HICON hIcon = ::LoadIcon ( ::GetModuleHandle ( NULL ), 
		MAKEINTRESOURCE ( IDI_MY_ICON ) );

	if ( NULL != hIcon ) {

		::SendMessage ( hWnd, WM_SETICON, FALSE, 
			reinterpret_cast<LPARAM>( hIcon ) );

	} // if ( NULL != hIcon )

} // if ( NULL != hWnd )

Ofcourse you'll want to play nice and free the icon resource when your done, but you get the idea.

If your using Win2K you should take a look at GetConsoleWindow function and use it to replace the FindWindow code listed above (because depending on the console's title the above code might no always work as expected).

cheers,
Ben Burnett

"It's all absolutely devastatingly true -- except the bits that are lies"
- Douglas Adams
GeneralRe: a Console Question ? Pin
The_Server22-Oct-01 20:43
The_Server22-Oct-01 20:43 
GeneralAnother Console Question ? Pin
The_Server22-Oct-01 20:52
The_Server22-Oct-01 20:52 
GeneralRe: Another Console Question ? Pin
Christian Graus22-Oct-01 21:04
protectorChristian Graus22-Oct-01 21:04 
GeneralRe: Another Console Question ? Pin
The_Server22-Oct-01 21:12
The_Server22-Oct-01 21:12 
GeneralCListBox::ItemFromPoint() Pin
PJ Arends22-Oct-01 16:26
professionalPJ Arends22-Oct-01 16:26 
GeneralRe: CListBox::ItemFromPoint() Pin
Christian Graus22-Oct-01 18:57
protectorChristian Graus22-Oct-01 18:57 
GeneralGetCurrentDirectory in Embedded Visual C++ 3.0 Pin
22-Oct-01 15:39
suss22-Oct-01 15:39 
GeneralRe: GetCurrentDirectory in Embedded Visual C++ 3.0 Pin
Jonas Larsson22-Oct-01 22:46
Jonas Larsson22-Oct-01 22:46 
GeneralRe: GetCurrentDirectory in Embedded Visual C++ 3.0 Pin
Jonas Larsson22-Oct-01 22:49
Jonas Larsson22-Oct-01 22:49 
GeneralNeed your help Pin
22-Oct-01 15:28
suss22-Oct-01 15:28 
GeneralRe: Need your help Pin
Christian Graus22-Oct-01 15:35
protectorChristian Graus22-Oct-01 15:35 
GeneralRe: Need your help Pin
Alvaro Mendez23-Oct-01 9:02
Alvaro Mendez23-Oct-01 9:02 
GeneralView calling a child frame Pin
jangel22-Oct-01 14:22
jangel22-Oct-01 14:22 
GeneralRe: View calling a child frame Pin
Christian Graus22-Oct-01 21:07
protectorChristian Graus22-Oct-01 21:07 
GeneralRe: View calling a child frame Pin
jangel23-Oct-01 5:34
jangel23-Oct-01 5:34 
GeneralRe: View calling a child frame Pin
Christian Graus23-Oct-01 10:36
protectorChristian Graus23-Oct-01 10:36 
GeneralRe: View calling a child frame Pin
jangel24-Oct-01 12:21
jangel24-Oct-01 12:21 

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.