我知道只要注册为服务器的进程,是不能通过Ctrl+Del+Alt,(2K/98 下都一样)来删除的。但怎么把自己的进程注册为服务器进程呢?我不知道(废话!),希望大家能告诉我,该怎么来,或者有例子的话,请给个地址我下载,或发例子到我的信箱。谁能帮我解决这个问题,我定给500分,决不食言!
解决方案 »
- 在xp下,odbc显示无法加载oracle odbc驱动程序的安装例程
- 用ado读取sql server中的文本数据
- CListCtrl的checkbox,如何调整它的位置在高度上居中???
- 求教C#跟托管C++混合编程的问题
- 如果要把网页的内容都在EditBox或者view视窗中表现出来,难不难?
- int a =10,b=20;得到内存0012FF78 14 00 00 00 0A 00 00 00,
- 关于DAO的弱问题!求救!
- 请大家来看看,这个项目值多少钱?
- 最大化和最小化问题
- DoDragDrop文件拖拽大文件程序失去响应
- 为什么我编写的群发短信老是有问题?
- 前些天进了 http://oec315.126.com网站之后,注册被狂改。所有应用程序都完蛋了。难道只有重装系统吗?望高手指教!!!!!
DWORD StartSampleService()
{
SERVICE_STATUS ssStatus;
DWORD dwOldCheckPoint;
DWORD dwStartTickCount;
DWORD dwWaitTime;
DWORD dwStatus;
schService = OpenService(
schSCManager, // SCM database
"Sample_Srv", // service name
SERVICE_ALL_ACCESS);
if (schService == NULL)
{
MyErrorExit("OpenService");
}
if (!StartService(
schService, // handle to service
0, // number of arguments
NULL) ) // no arguments
{
MyErrorExit("StartService");
}
else
{
printf("Service start pending.\n");
}
// Check the status until the service is no longer start pending.
if (!QueryServiceStatus(
schService, // handle to service
&ssStatus) ) // address of status information structure
{
MyErrorExit("QueryServiceStatus");
}
// Save the tick count and initial checkpoint. dwStartTickCount = GetTickCount();
dwOldCheckPoint = ssStatus.dwCheckPoint; while (ssStatus.dwCurrentState == SERVICE_START_PENDING)
{
// Do not wait longer than the wait hint. A good interval is
// one tenth the wait hint, but no less than 1 second and no
// more than 10 seconds.
dwWaitTime = ssStatus.dwWaitHint / 10; if( dwWaitTime < 1000 )
dwWaitTime = 1000;
else if ( dwWaitTime > 10000 )
dwWaitTime = 10000; Sleep( dwWaitTime ); // Check the status again.
if (!QueryServiceStatus(
schService, // handle to service
&ssStatus) ) // address of structure
break;
if ( ssStatus.dwCheckPoint > dwOldCheckPoint )
{
// The service is making progress. dwStartTickCount = GetTickCount():
dwOldCheckPoint = ssStatus.dwCheckPoint;
}
else
{
if(GetTickCount()-dwStartTickCount > ssStatus.dwWaitHint)
{
// No progress made within the wait hint
break;
}
}
} if (ssStatus.dwCurrentState == SERVICE_RUNNING)
{
printf("StartService SUCCESS.\n");
dwStatus = NO_ERROR;
}
else
{
printf("\nService not started. \n");
printf(" Current State: %d\n", ssStatus.dwCurrentState);
printf(" Exit Code: %d\n", ssStatus.dwWin32ExitCode);
printf(" Service Specific Exit Code: %d\n",
ssStatus.dwServiceSpecificExitCode);
printf(" Check Point: %d\n", ssStatus.dwCheckPoint);
printf(" Wait Hint: %d\n", ssStatus.dwWaitHint);
dwStatus = GetLastError();
}
CloseServiceHandle(schService);
return dwStatus;
}