Murugan.com
Murugan Andezuthu Dharmaratnam

  |  HOME   |  BLOG   |  TWITTER   |  ARTICLES   |  8086  |  C++   |  VC++   |  ASP .NET   |  VB .NET   |  JAVA SCRIPT   |  MS SQL   |  MY   |  VIDEOS   |  DOWNLOADS   |  CONTACT ME   |  



GetWindowName() VC++ Win32 Get a Window Name Given Handle

Home   VC++   GetWindowName() VC++ Win32 Get a Window Name Given Handle          


VC++ 6.0 Win32 GetWindowName() function does now exist but you 
could write one for your own

char* GetWindowName(HWND hWnd)
{
	char *retval = new char(1000);
	GetWindowText(hWnd,retval,100);
	return retval;
}

// Here is how you call it 
MsgBox(GetWindowName(hTemp));

void MsgBox(char* msg)
{
	MessageBox(hWid,msg,msg,0); // hWid is the handle to the main window
}


Now how the code works. 

GetWindowText Function

The GetWindowText function copies the text of the specified window's title bar 
(if it has one) into a buffer. If the specified window is a control, the text of the 
control is copied. However, GetWindowText cannot retrieve the text of a 
control in another application.




  |  HOME   |  BLOG   |  TWITTER   |  ARTICLES   |  8086  |  C++   |  VC++   |  ASP .NET   |  VB .NET   |  JAVA SCRIPT   |  MS SQL   |  MY   |  VIDEOS   |  DOWNLOADS   |  CONTACT ME   |  

Copyright 2009 @ Murugan Andezuthu Dharmaratnam