Chinaunix首页 | 论坛 | 博客
  • 博客访问: 367613
  • 博文数量: 715
  • 博客积分: 40000
  • 博客等级: 大将
  • 技术积分: 5005
  • 用 户 组: 普通用户
  • 注册时间: 2008-10-13 14:46
文章分类

全部博文(715)

文章存档

2011年(1)

2008年(714)

我的朋友

分类:

2008-10-13 16:40:55

liangxj:这个NT服务,我曾经试用过,但是发现系统启动后服务自然可以启动应用程序,但是登陆后发现原本应该在任务栏填加的程序系统图标没有正常填加,希望了解如何实现基于文挡视图结构的NT服务。
(发表于2005-4-5 9:50:00)

sxzmail:这是因为在没有交互用户登陆前调用TrayNotifyIcon会失败。
要在系统启动以后在托盘中加入图标,要响应系统消息
TaskbarCreate,这是个未注册的系统消息,要在代码中手动注册,详细说明可查MSDN
(发表于2005-6-6 9:41:00)

wz32vc:非常好
(发表于2005-6-6 9:50:00)

sxzmail:又去查了一下,好象写错了,调用的函数应该是Shell_NotifyIcon,响应的系统消息是TaskbarCreated
MSDN里的说明如下:
A problem occurs if the taskbar has not been created, for example when there is no user logged on interactively. In this case, Shell_NotifyIcon fails to create a notification icon. The service would then need to be notified when the taskbar is created so it can successfully call Shell_NotifyIcon. A notification is sent in the form of a registered window message, "TaskbarCreated", that is broadcast to all top-level windows when the taskbar is created. The service can then create the notification icon when handling this message.

(发表于2005-6-6 10:58:00)

sxzmail:现在有个问题向高手请教:我用MSDN上的那个NTService类作了一个服务,在没有登录操作系统时,在服务中通过CreateProcessAsUser启动了一个MFC MDI Application(App A),在登录系统后,由于某些操作,我要在这个App A中启动另一个Application(App B),不论是ShellExecute或者CreateProcess均会报错;但是如果在登录操作系统后再运行服务,进行以上操作就正常,有没有哪位愿意指点一二?
(发表于2005-6-6 11:07:00)

rumor:从服务中可以启动程序,不知道能不能从程序中启动或停止服务,请哪位高手指点一下。。。
(发表于2006-1-16 12:58:00)

..........................................................................
--------------------next---------------------

阅读(165) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~