Menu
comp.lang
Embarcadero
Microsoft
Related Sites

Newsgroup: microsoft.public.java.afc


TonyG - My program not visible using Remote Desktop. -   05 Sep, 22:39 [ Get full thread ]  
My program not visible using Remote Desktop.
My program is running on Server 2003 and is written in Visual C++ version 6

I have a service that does a CreateProcess to start an .exe program. The .exe program displays a few 
dialogs and also has a system tray icon. This program and others like if have been running fine for 
years. The dialogs are visible, the system tray icon is visible and the computer operator can work 
with the program with no problems.

There is an issue. If you view the computer remotely using remote desktop you can not see the 
windows or the system tray icon. This is true even you start the service from within the remote 
desktop session.

I have tried just starting remote desktop normally and also starting it from the run box using the 
command: mstsc /console


How can I make my program visible and compatible with Remote Desktop?


I don't know if this has anything to do with it, but below is the code I use to CreateProcess: I 
tried with and without the DETACHED_PROCESS flag. No difference that I could see.



STARTUPINFO StartupInfo;  // process information

    // initialize the structure
    StartupInfo.cb = sizeof(STARTUPINFO);
    StartupInfo.lpReserved = NULL;
    StartupInfo.lpDesktop = NULL;
    StartupInfo.lpTitle = NULL;
    StartupInfo.dwX = 0;
    StartupInfo.dwY = 0;
    StartupInfo.dwXSize = 0;
    StartupInfo.dwYSize = 0;
    StartupInfo.dwXCountChars = 0;
    StartupInfo.dwYCountChars = 0;
    StartupInfo.dwFillAttribute = 0;
    StartupInfo.dwFlags = 0;
    StartupInfo.wShowWindow = 0;
    StartupInfo.cbReserved2 = 0;
    StartupInfo.lpReserved2 = NULL;
    StartupInfo.hStdInput = NULL;
    StartupInfo.hStdOutput =  NULL;
    StartupInfo.hStdError = NULL;

    // create the process
    if (0 == CreateProcess(
       m_csFileName,
       NULL,
       NULL,
       NULL,
       TRUE,
       DETACHED_PROCESS | NORMAL_PRIORITY_CLASS,
       NULL,
       NULL,
       &StartupInfo,
       &m_ProcessInformation
      ))
    {
       // an error has occurred

...

    }
    else
    {
...

    }
TonyG - Re: My program not visible using Remote Desktop. -   07 Sep, 04:59 [ Get full thread ]  
David Ching - Re: My program not visible using Remote Desktop. -   08 Sep, 10:13 [ Get full thread ]  
TonyG - Re: My program not visible using Remote Desktop. -   08 Sep, 15:54 [ Get full thread ]  
Ismo Salonen - Re: My program not visible using Remote Desktop. -   12 Sep, 13:43 [ Get full thread ]  

Click on title to retrieve message.