| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 451 人关注过本帖
标题: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
快速回复:can anyone help me?
数据加载中...
 
   



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

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