首页 Soft PlugIn RAN乱 Dev开发 Info资料 English WAP 留言 登陆 注册
-
Posted by Yippee | 评论(0) | 引用(0) | 阅读2539次
一个应用软件的项目小结-B2OFFLINE

需求分析:

      以前家里没有宽带,公司用的PROXY,我也一直习惯了文本模式浏览,所以用BECKY!也一直没有什么问题,但是现在家里有了宽带,公司也是直连出去了,而现在HTML格式的EMAIL也越来越多,文本模式浏览有的HTML看上去怪怪的,尤其一些NOKIA和MICROSOFT的邮件列表,而使用HTML模式浏览,虽然里面有一个附加选项 离线模式,但是好像不会生效。经常一些垃圾邮件或者病毒邮件就连接上了INTERNET,然后下载一些广告图片或者干脆直接打开广告网站或者垃圾网站。以前还用过一段防火墙,可是无论是ZoneAlarm Pro  、symantec的安全特警 BlackICE PC Protection  mcafee个人防火墙 Kerio WinRoute Firewall v6.1.0 RC1 Outpost Firewall Free v2.7 Agnitum Outpost Firewall Pro v2.7 McAfee Firewall Plus v6.1.6144  McAfee Internet Security v7.15 天网 感觉使用都很麻烦,而且占用系统资源,WINXP的防火墙基本还可以,但是又不能屏蔽某个程序访问某个端口。什么时候有空倒是可以写个防火墙软件比较。

前期预研:

     B2 PLUGIN SDK,这个基本已经熟悉,开发工具 VC6,具体如何实现:1、屏蔽网卡;2、BECKY也是调用IE控件浏览HTML文件,因此采用浏览器IE设置离线模式可能更为简单。基本测试:IE设置离线模式,BECKY!浏览一份垃圾邮件就不会下载广告图片,图片部分变成一个红X而已。设置联机模式,图片就显示出来了。

技术实现:

    首先作个PLUGIN SDK的VC6工程,然后设置一些插件的基本信息,具体实现了脱机、联机模式的设置。现在就是考虑用户使用模式了。最简单的,作个菜单,让用户选择开启还是关闭 脱机还是联机;这个使用比较麻烦,在工具栏上加上按钮,让用户点击,我还是觉得这样比较别扭,最后决定插件自动化,当BECKY活动的时候就脱机,不活动的时候就联机。后来又加上一个最小化的时候联机,最大化的时候脱机。

具体技术细节:

窗体是否活动:The WM_ACTIVATE message is sent to both the window being activated and the window being deactivated. If the windows use the same input queue, the message is sent synchronously, first to the window procedure of the top-level window being deactivated, then to the window procedure of the top-level window being activated. If the windows use different input queues, the message is sent asynchronously, so the window is activated immediately
The WM_ACTIVATEAPP message is sent when a window belonging to a different application than the active window is about to be activated. The message is sent to the application whose window is being activated and to the application whose window is being deactivated. The WM_SIZE message is sent to a window after its size has changed. SIZE_MAXHIDE Message is sent to all pop-up windows when some other window is maximized.
SIZE_MAXIMIZED The window has been maximized.
SIZE_MAXSHOW Message is sent to all pop-up windows when some other window has been restored to its former size.
SIZE_MINIMIZED The window has been minimized.
SIZE_RESTORED The window has been resized, but neither the SIZE_MINIMIZED nor SIZE_MAXIMIZED value applies.

修改:The RegCreateKeyEx function creates the specified key. If the key already exists in the registry, the function opens it.
The RegSetValueEx function sets the data and type of a specified value under a registry key.
The RegCloseKey function releases a handle to the specified key.

修改生效:SendMessageTimeout(HWND_BROADCAST,WM_SETTINGCHANGE,NULL,(LPARAM)(LPTSTR)lpData,SMTO_NORMAL,1000,&dwResult);  ::SendMessageTimeoutW( HWND_BROADCAST, WM_SETTINGCHANGE, 0, (LPARAM) szRegKey,
  //   SMTO_ABORTIFHUNG &line; SMTO_BLOCK, 3 * 1000, &dwResult ); // wait 3 seconds on each window #include <Wininet.h> InternetSetOption(NULL, INTERNET_OPTION_SETTINGS_CHANGED, NULL, 0);
 InternetSetOption(NULL, INTERNET_OPTION_REFRESH , NULL, 0); 注册表修改后生效需要发送消息 INTERNET修改要生效要调用函数 修改注册表后如何立即刷新系统 lParam
When the system sends this message as a result of a SystemParametersInfo call, lParam is a pointer to a string that indicates the area containing the system parameter that was changed. For example, this string can be the name of a registry key or the name of a section in the Win.ini file. This parameter is not particularly useful in determining which system parameter changed. For example, when the string is a registry name, it typically indicates only the leaf node in the registry, not the whole path. In addition, some applications send this message with lParam set to NULL. In general, when you receive this message, you should check and reload any system parameter settings that are used by your application.
When the system sends this message as a result of a change in policy settings, this parameter points to the string "Policy". When the system sends this message as a result of a change in locale settings, this parameter points to the string "intl".


字体:

Permanant URI永久地址 http://www.shengfang.org/blog/p/b2offlinedev.php
Trackback URI引用地址 http://www.shengfang.org/blog/tb.php?tb_id=1118328122

2005年6月9日22:42星期四  [Dev开发] 追踪此文的RSS
提示:
此文还没有评论。

称呼:    登陆   注册
   不注册,但记住我的信息
邮件:
(非必须)
评论: [UBB代码帮助]
粗体 斜体 下划线 链接 水平线 引用



验证码: 请输入你看见的数字
关闭UBB      提交时自动将内容复制到剪贴板

公告
Fire and Motion!

统计信息
[Yippee]||[统计]||日志:1790
在线: 8||用户: 2562 [列表]
今日:1887||到访:2671386
Rss:838360||评论:1584

最新日志

最新评论

友情链接

日历

最新引用

搜索

归档

杂项
Get RSS Feed (Version 2.0)
Get Atom Feed (Version 0.3)
编码:  UTF-8