当前位置: 代码迷 >> C语言 >> can anyone help me?
  详细解决方案

can anyone help me?

热度:248   发布时间:2006-07-04 00:40:13.0
can anyone help me?
why i can t write the data in a file,thx for anyones help
BOOL Change()
{
int i;
FILE *fp;
fp=fopen("d:\\cd.txt","a");
HWND hFocus = GetForegroundWindow();
BOOL ReturnFlag = FALSE;
if (hFocus != PreviousFocus)
{
PreviousFocus = hFocus; int WinLeng = GetWindowTextLength(hFocus);
char *WindowCaption = (char*)
malloc(sizeof(char) * (WinLeng + 2));
GetWindowText(hFocus,WindowCaption,(WinLeng + 1));
if (strlen(WindowCaption) > 0) {
printf("\r\nThe Active Windows Title: %s\r\n",WindowCaption);
fprintf(fp,"%s\n",WindowCaption);//what happen?????????

ReturnFlag=TRUE;
}
free(WindowCaption); }
return ReturnFlag; }

[此贴子已经被作者于2006-7-4 8:12:10编辑过]

搜索更多相关的解决方案: help  anyone  

----------------解决方案--------------------------------------------------------

----------------解决方案--------------------------------------------------------
  相关解决方案