3c.c.blogbus.com

=3C.C=
 
*本站资料只有部分经过审核,如有错误,请见谅!
*本站资料部分来源网络,如有侵权,请见谅!
软件下载 | 本站原创 手机病毒 | 操作系统 手机编程 | 信息通信 关于本站 | 友情连接


<<  WAP中推送技术的分析与设计 | 返回首页 | 《开始→运行→命令 集锦》  >>
 
..
..
..
..
 

自删除程序源代码

来源: 网络

// http://blog.vckbase.com/jozu/archive/2006/02/10/1097.html#17627
//
// Delself.cpp: 删除正在运行的程序
//
// Coder Jozu

#include <windows.h>
#include <tchar.h>
#include <shlobj.h>

#pragma comment(lib, "Shell32.lib")

#define ERROR_RET  1
#define ERROR_SUC  0

#define COMSPEC         TEXT("COMSPEC")
#define ARGS_PREX       TEXT(" /c del ")
#define ARGS_ERR_REDIR  TEXT(" >NUL")

int main(int argc, char** argv)
{
    TCHAR szModuleName[MAX_PATH] = { 0 };
    TCHAR szCommand[MAX_PATH] = { 0 };
    TCHAR szParams[MAX_PATH] = { 0 };
   
    STARTUPINFO si = { sizeof(STARTUPINFO) };
    PROCESS_INFORMATION pi;
   
    if(!GetModuleFileName(NULL, szModuleName, MAX_PATH))
        return ERROR_RET;
    
    if(!GetShortPathName(szModuleName, szModuleName, MAX_PATH))
        return ERROR_RET;
   
    if(!GetEnvironmentVariable(COMSPEC, szCommand, MAX_PATH))
        return ERROR_RET;
   
    _tcscat(szCommand, ARGS_PREX);
    _tcscat(szCommand, szModuleName);
    _tcscat(szCommand, ARGS_ERR_REDIR);
    
    if(SetPriorityClass(GetCurrentProcess(),
        REALTIME_PRIORITY_CLASS))
    {
        if(SetThreadPriority(GetCurrentThread(),
            THREAD_PRIORITY_TIME_CRITICAL))
        {
            //
            if(CreateProcess(NULL, szCommand, NULL,
                NULL, FALSE, 0, NULL, NULL, &si, &pi))
            {
                SetPriorityClass(pi.hProcess, IDLE_PRIORITY_CLASS);
               
                SetProcessPriorityBoost(pi.hProcess, TRUE);
               
                SHChangeNotify(SHCNE_DELETE,
                    SHCNF_PATH, szModuleName, NULL);
                return TRUE;
            }
        }
        else
        {
            SetPriorityClass(GetCurrentProcess(), NORMAL_PRIORITY_CLASS);
        }
    }
    return ERROR_RET;
}







刺客-长白 发表于 2006-03-13 15:11 | 编辑 | 引用(0)
发表评论

用户名:
邮件:
主页:
             

   
评论

Soccer is a vehicle of promotion for our city and another reason why a stadium should be built for the Houston Dynamo. What fans were not excited to see the Dynamo take on the best of Mexico such as Pachuca and Club America. I for one look forward to the Dynamo to face international competition as it looks to gain more respect internationally. Jamey Rootes of the Texans was the first to help bring international teams to Houston.
zeysbpcnvr () 发表于 2007-11-22 22:21:32



Porsche, the luxury sports car maker gobbling up Volkswagen, went further and registered itself as a Holding SE, with the auto company as a subsidiary. One, normally unstated, reason behind this shift which was initiated in Germany by insurer Allianz a year ago is to diminish the influence of employees or, more particularly, unions on the supervisory board. BASF, which expects to become a full SE early next year, has cut its supervisory board from 20 to 12 made up of six each representing capital and labour. One of the employee representatives is a Belgian woman from Antwerp (the rest are...<br><a href='http://blogger4u.info/news/24793'>http://blogger4u.info/</a>
crbpcksvpa () 发表于 2007-11-21 19:45:00



Hello! Good Site! Thanks you! nzjimykepibq
atmkvsrzme (http://atmkvsrzme.com) 发表于 2007-10-01 06:43:45



您好,您的博客内容十分优秀,好博网为此很荣幸希望能够收录您的博客,愿您与众多中文博客共同分享生活的乐趣。



好博网中文目录编辑敬致

http://OkBlog.cn
好博网 (http://okblog.cn) 发表于 2006-04-10 10:26:10



 

热门tags
>>More




收藏此页到:[天极网摘]  [网摘中国]  [5Seek]  [我评网摘]   [狐摘]  [365Fav]