做了一个截屏程序是服务启动,代码是服务启动后用CreateProcessAsUser以现阶段用户运行,但是程序会无限制的启动自身.
做了一个截屏程序是服务启动,代码是服务启动后用CreateProcessAsUser以当前用户运行,但是程序会无限制的启动自身....
程序是一个截图程序 在win7普通用户方式运行没有问题 但是在win7下服务启动截取到的屏幕是黑屏 查资料可以用CreateProcessAsUser以当前用户运行 之后就在程序中判断服务是否开启 了 如果开启了就用CreateProcessAsUser运行自身 ,可问题来了 程序会无限运行自身 有什么办法判断下程序是服务启动的而不是自身启动的?因为程序有提取到system的代码 所以不能靠这个判断!!
------解决方案--------------------
Return Values
If the function succeeds, the return value is a handle to the mutex object. If the named mutex object existed before the function call, the function returns a handle to the existing object and GetLastError returns ERROR_ALREADY_EXISTS. Otherwise, the caller created the mutex.
If the function fails, the return value is NULL. To get extended error information, call GetLastError.
程序是一个截图程序 在win7普通用户方式运行没有问题 但是在win7下服务启动截取到的屏幕是黑屏 查资料可以用CreateProcessAsUser以当前用户运行 之后就在程序中判断服务是否开启 了 如果开启了就用CreateProcessAsUser运行自身 ,可问题来了 程序会无限运行自身 有什么办法判断下程序是服务启动的而不是自身启动的?因为程序有提取到system的代码 所以不能靠这个判断!!
------解决方案--------------------
Return Values
If the function succeeds, the return value is a handle to the mutex object. If the named mutex object existed before the function call, the function returns a handle to the existing object and GetLastError returns ERROR_ALREADY_EXISTS. Otherwise, the caller created the mutex.
If the function fails, the return value is NULL. To get extended error information, call GetLastError.