Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Login name to caption bar

Status
Not open for further replies.

woodcarver

Technical User
Oct 11, 2001
20
US
Hi all: How does one pass the logged user name to the caption bar on a child window.This is the code that I want to modify:
{
DWORD dwSize = 0;
GetUserName(NULL,&dwSize);
char*szBuf=new char[dwSize];
szBuf[0]='\0';
GetUserName(szBuf,&dwSize);
LabelX->Caption=szBuf; //puts name into a label on to
delete[]szBuf; the same form
}
 
Your code should work, if you replace
LabelX->Caption=szBuf; with
Child->Caption = szBuf;

where Child is a pointer to the active child-window.
To get the child-window, use the ActiveMDIChild
property in the main class.

/Fredrik Eriksson
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top