博文

获取鼠标点的颜色(2007-04-17 20:14:00)

摘要:VC++的关键代码实现如下:   1、获取屏幕DC  
  HDC   hDC   =   ::GetDC(NULL);   //获取屏幕DC  
  2、获取当前鼠标位置像素值  
  CPoint   pt;  
  GetCursorPos(&pt);          //得到当前鼠标所在位置  
  COLORREF   clr   =   ::GetPixel(hDC,   pt.x,   pt.y);   //获取当前鼠标点像素值  
  3、分解出像素点中的红、绿、蓝颜色值  
  CString   ClrText;  
  ClrText.Format("%d",GetRValue(clr)); //分解出红色值  
  ClrText.Format("%d",GetGValue(clr));   //分解出绿色值  
  ClrText.Format("%d",GetBValue(clr));   //分解出蓝色值  
  ::ReleaseDC(NULL,   hDC);   //释放屏幕DC  
......

阅读全文(2442) | 评论:0

多进程调度模拟程序(2007-04-16 18:18:00)

摘要:#include <windows.h>
#include <dos.h>
#include<stdlib.h>
#include<conio.h>
#include<iostream.h> #define P_NUM 5  //进程数
#define P_TIME 50//时间片长度
#define MIN -9999 //最小优先级 enum state{
    ready,   //就绪
    execute, //执行
    block,   //阻塞
    finish   //完成
}; struct pcb{  //进程控制块结构
    char name[4]; //进程名
    int priority; //优先级
    int cputime;  //占用CPU时间
    int needtime; //还需要执行的时间
    int count;
    int round;
    state process; //进程状态
    pcb * next;
}; pcb * get_process()//获取进程信息
{
    pcb *q;
    pcb *t;
    pcb *p;//进程链表头指针
    int i=0;
    cout<<"input "<<P_NUM&l......

阅读全文(3450) | 评论:0

屏蔽QQ广告(2007-04-16 18:16:00)

摘要:第一步:腾讯QQ一般安装在“C:\ProgramFiles\Tencent\QQ”文件目录中,在资源管理器中打开此目录,
首先双击进入“AD”文件夹,按下“Ctrl+A”全选所有文件,再按下“Shift+Delete”彻底删除所有广告。在空白处右击,选择执行“属性”

第二步:单击“安全”标签,在“组或用户名称”中选择用户并点击下文的“删除”按钮,将所有用户删除。
或者,将所有用户的权限都设置成“拒绝”,并且单击“高级”按钮。 清除勾选 "从父项继承那些可以应用到子对象的权限项目,包括那些在此明确定义的项目"。 随后会出现“安全”对话框,选择“删除”按钮便可,并确定退出。

最后,删除腾讯QQ安装目录C:\ProgramFiles\Tencent\QQ 下的“Dat”文件夹中的两个名为“ad”的文件就可以了。

这样,QQ程序就无法将下载的广告存放到我们的硬盘,而彻底消失了。

提示:如果在你的操作系统文件夹属性中没有找到“安全”标签,执行“控制面板→管理工具→本地安全策略”,打开“本地策略→安全选项”,在右侧窗口中找到“网络访问,本地账户的共享和安全模式”项,双击将其更改为:“经典-本地用户以自己的身份验证”。 提示:请打开“我的电脑”,点上方的“工具栏”,选择“文件夹选项”,点“查看 ”,取消勾选“使用简单的文件共享” 就可以调出“安全”标签......

阅读全文(1995) | 评论:0

显示隐藏文件项不可用(2007-04-13 10:55:00)

摘要:开始--运行输入regedit 找到
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\explorer\Advanced\Folder\Hidden\SHOWALL分支,在右边的窗口中双击CheckedValue键值项,该键值应为1.如果值不为1,改为1即可。

如果你设置仍起不了作用,那么接下来看。
有些木马把自己的属性设置成隐藏、系统属性,并且把注册表中“文件夹选项中的隐藏受保护的操作系统文件”项和“显示所有文件和文件夹”选项删除,致使通过procexp可以在进程中看到,但去文件所在目录又找不到源文件,无法进行删除。(正常如图,被修复后看不见图中标注的项)

针对这种情况可以把下面内容存储成ShowALl.reg文件,双击该文件导入注册表即可

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\Hidden\NOHIDDEN]
"RegPath"="Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced"
"Text"="@shell32.dll,-30501"
"Type"="radio"
"CheckedValue"=dword:00000002
"ValueName"="Hidden"
"DefaultValue"=dword:00000002
"HKeyRoot"=dword:80000001
"HelpID"="shell.hlp#51104"

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\Hidden\SHOWALL]
"RegPath"="Software\\Microsoft\\Windows\\CurrentVersio......

阅读全文(2128) | 评论:0

2007 SJTU 计算机复试上机试题(转载)(2007-04-12 18:18:00)

摘要:2007 SJTU 计算机复试上机试题(转载)

Problem A. Old Bill
Input file: standard input
Output file: standard output

Among grandfather's papers a bill was found.
72 turkeys $_679_

The first and the last digits of the number that obviously represented the
total price of those turkeys are replaced here by blanks (denoted _), for
they are faded and are illegible. What are the two faded digits and what
was the price of one turkey?
We want to write a program that solves a general version of the above
problem.
N turkeys $_XYZ_

The total number of turkeys, N, is between 1 and 99, including both. The
total price originally consisted of five digits, but we can see only the
three digits in the middle. We assume that the first digit is nonzero, that
the price of one turkeys is an integer number of dollars, and that all the
turkeys cost the same price.
Given N, X, Y, and Z, write a program that guesses the two faded digits and
the ......

阅读全文(3038) | 评论:0

删除启动项里残留痕迹(2007-04-12 18:14:00)

摘要:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\MSConfig\startupreg\
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Shared Tools\MSConfig\startupFolder......

阅读全文(1996) | 评论:0

PPLive网页例程(2007-04-09 03:28:00)

摘要:<table border="0" cellpadding="0" cellspacing="0"><tr><td><object id="PPLiveP" style="width:480px;height:377px;"   classid="CLSID:18226BF8-DC0B-4D81-80E9-A41AE37BB73A"   codeBase="http://download.pplive.com/webinstall/install.CAB#version=1,5,34">
<param name="ControlVisible" value="0" />
<param name="ShowP2P" value="1" />
<param name="ShowBufferAD" value="1" />
<param name="DBClickFullScreen" value="1" />
<param name="ShowGall" value="1" />
<param name="ShowPlayCtrl" value="1" />
<param name="URL" value="" />
<param name="ShowMenu" value="1" />
</object>
</td><td><object style="width:220px ; height:377px" classid="CLSID:70CACCCA-8B83-4BCB-B2D1-188E9A495527"></object></td></tr></table><script type="text/javascript">var PPlivePlayer=document.getElementById("PPLiveP");window.onunload=function(){try{PPlivePlayer.Dest......

阅读全文(2256) | 评论:0

毕业设计要求(2007-03-13 21:30:00)

摘要:我们的目标是编写一个类似于Photoshop的图像处理软件。
主要包括:
(1)图像输入输出模块
至少能读取jpg、bmp位图,也能够将处理结果保存为jpg、bmp格式。
(2)图层处理
图层处理可以合成不同的图像,涉及图像的合成,要用到不透明度
(即Alpha通道)概念,采用RGBA模式。
(3)历史功能
Undo功能,最多允许退回到前面第64次操作。
(4)图像滤波增强
完成高斯滤波、快速傅立叶变换FFT及其反变换等。
图像模糊处理:高斯模糊、运动模糊
图像加噪声处理:高斯噪声
图像去噪处理:中值滤波等
图像锐化、平滑处理。
(5)图像的几何变换
平移、旋转和缩放,涉及矩阵计算、重采样(采用双线性插值)
(6)文字处理
在图像中加入所需的文字。
文字可以采用不同的字体、大小和艺术效果(此部分可选)。
(7)选择区域处理
采用多边形等方式选择图像中制定的区域进行处理。  ......

阅读全文(4608) | 评论:0

rundll32.exe的用途(2006-10-11 00:07:00)

摘要:rundll32.exe的用途
命令列:rundll32.exe user.exe,restartwindows 功能: 系统重启 命令列:rundll32.exe user.exe,exitwindows 功能: 关闭系统 命令列: rundll32.exe ..
命令列:rundll32.exe user.exe,restartwindows
功能: 系统重启
命令列:rundll32.exe user.exe,exitwindows
功能: 关闭系统
命令列: rundll32.exe shell32.dll,Control_RunDLL
功能: 显示控制面板
命令列: rundll32.exe shell32.dll,Control_RunDLL access.cpl,,1
功能: 显示“控制面板-辅助选项-键盘”选项视窗
命令列: rundll32.exe shell32.dll,Control_RunDLL access.cpl,,2
功能: 显示“控制面板-辅助选项-声音”选项视窗
命令列: rundll32.exe shell32.dll,Control_RunDLL access.cpl,,3
功能: 显示“控制面板-辅助选项-显示”选项视窗
命令列: rundll32.exe shell32.dll,Control_RunDLL access.cpl,,4
功能: 显示“控制面板-辅助选项-滑鼠”选项视窗
命令列: rundll32.exe shell32.dll,Control_RunDLL access.cpl,,5
功能: 显示“控制面板-辅助选项-传统”选项视窗
命令列: rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl @1
功能: 执行“控制面板-添加新硬体”向导。
命令列: rundll32.exe shell32.dll,SHHelpShortcuts_RunDLL AddPrinter
功能: 执行“控制面板-添加新印表机”向导。
命令列: rundll32.exe shell32.dll,Control_R......

阅读全文(2160) | 评论:0

getchar&getch&getche(2006-10-11 00:05:00)

摘要:getchar
This is a standard function that gets a character from the stdin. getch
This is a nonstandard function that gets a character from keyboard, does not echo to screen. getche
This is a nonstandard function that gets a character from the keyboard, echoes to screen. Use getchar if you want it to work on all compilers. Use getch or getche on a system that supports it when you want keyboard input without pressing [Enter]. And note that the return value of all three is int! You need this to properly check for EOF. ......

阅读全文(2688) | 评论:0