标题:can anyone help me?
只看楼主
thgoat
Rank: 1
等 级:新手上路
帖 子:21
专家分:0
注 册:2005-9-15
 问题点数:0 回复次数:1 
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 
2006-07-04 00:40
thgoat
Rank: 1
等 级:新手上路
帖 子:21
专家分:0
注 册:2005-9-15
得分:0 

2006-07-04 21:34



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-76387-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.020417 second(s), 7 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved