Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Service related problem

Service related problem

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Radu Sorin
    wrote on last edited by
    #1

    I have a program (.exe):confused: that has GUI . Upon start this program places an icon in tray. I've made a service that starts the program befor login . It woks . It starts the program but i have some problems. If I login to a windows acount somtimes it doesen't place the icon in the tray. The TaskManger shows my program as beeing started by the SYSTEM account. If i logout an then login again it gets worst : i cannot logout or reset or shotdown windows . My guess is that this problem comes from the fact that when the service start the program it starts it using the "Winlogon" desktop and after login the desktop is changed to the "default" and then my program remains suspended in the "winlogon" desktop . I've try to change the tread desktop but it didn't work . Here is the code i've used HWINSTA oldWinSta = GetProcessWindowStation(); if (oldWinSta) { HWINSTA hWinsta = ::OpenWindowStation("WinSta0\\default", FALSE, MAXIMUM_ALLOWED); if (hWinsta) ::SetProcessWindowStation(hWinsta); } HDESK hDesk = ::OpenInputDesktop(0, FALSE, DESKTOP_SWITCHDESKTOP); SetThreadDesktop(hDesk); SetDesktop -- returns false; Can anyone help me? Does anyone knows why the windows doesen't respond at logoff, restart, shutdown if my program is started?

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups