|
Hi,
How do i check whether terminal server is enabled or not programmatically(VC++ or winSDK)
I am using GetSystemMetrics( SM_REMOTESESSION ) API to know whether terminal server is running or not. But on compiling i am getting 'SM_REMOTESESSION' : undeclared identifier compiler error. My environment is windows 2003 server VS6.0 with sp6.0
Thanks,
modified on Friday, June 20, 2008 2:59 AM
|
|
|
|
|
subramanyeswari wrote: But on compiling i am getting 'SM_REMOTESESSION' : undeclared identifier compiler error. My environment is windows 2003 server VS6.0 with sp6.0
You need to install the latest platform SDK to get the update header file. The value of SM_REMOTESESSION is defined as 0x1000. So if you dont want to download, just define SM_REMOTESESSION in your code.
#define SM_REMOTESESSION 0x1000
|
|
|
|
|
|
I am reading the registry to check whether terminal server is enabled or not in the following path
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server
\TSEnabled.
How to disable Terminal Server. Is there any other way.
My working environment is windows 2003 server. I am using Manage your server>Add or remove role.
But still the value of TSEnabled is 1. Why it is not updating the registry
modified on Friday, June 20, 2008 7:01 AM
|
|
|
|
|
You better look in the SDK where SM_REMOTESESSION is defined. There you see for what systems you got to compile. I guess NT >= 5, and SP4. Change in the stdafx.h.
Check error conditions carefully. The strangest is most to cut the connection by pluging out the network cable. (This belongs to our Release Tests)
If you should consider to use a never Visual Studio.
Greetings from Germany
|
|
|
|
|
thanks for your reply.
I tried this in 2005 to test. this is my code
if(::GetSystemMetrics(SM_REMOTESESSION ) == 0)
{
::AfxMessageBox(_T("no"),NULL,NULL);
}
else
{
::AfxMessageBox(_T("yes"),NULL,NULL);
}
this displayed no as per the msdn
If the calling process is associated with a Terminal Services client session, the return value is nonzero. If the calling process is associated with the Terminal Services console session, the return value is 0.
I will tell why i want to check whether terminal server is enabled or not. I want to load two dll's if terminal server is enabled other wise i don't want. for that i am reading the registry for TSEnabled value. It is one as i configured Terminal Server. Even after disabling the value is 1 only. Mine is freshly formatted system with windows 2003 server installed. Why the registry is not getting updated.
Is there any other solution.
Regards
|
|
|
|
|
Hi All,
I want to develop project for Windows mobile in which I want to add functionality for Video Conferencing by using SIP(Session initiation Protocol. So Is there any free class library in C++, C# which support video support video conferencing on Windows mobile6.0
Thanks
Atul
|
|
|
|
|
The following projects might assist you to get started:
OPAL[^] in Voxgratia. It supports fax, voice and video over SIP and H323 as well.
Open Video Conference[^]
Openmeeting[^]
All of these works on 32 bit windows, but when you say Windows mobile, I do not know how much of help these projects may provide you.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Hai,
how to convert a word document\PDF file to Enhanced metafile. Is any API is available.Please help me if any of u know any tips please.
Thanks
|
|
|
|
|
for word document, i think you can use COM interfaces provided by microsoft.
But for PDF file, i have no idea, maybe you can use its virtual print service.
You can look up them on the internet for more exactly details.
|
|
|
|
|
A while ago, I asked a question about,
error C2061: syntax error : identifier 'CEvent'
in a .dll project. My dev env is vs 2005 sp1, but I get this error in 6.0 too. So last time you told me to make sure I include afxmt.h, where CEvent is defined. I dropped this into stdafx.h
Now, it tells me,
1>e:\program files\microsoft visual studio 8\vc\atlmfc\include\afxv_w32.h(16) : fatal error C1189: #error : WINDOWS.H already included. MFC apps must not #include <windows.h>
</windows.h>
afxmt.h is an MFC header, right? How do I get around this..?
|
|
|
|
|
bulg wrote: How do I get around this..?
Googling for [^]?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
You need to change your project in a MFC-Project (Headers and project settings) or look in your actual class library if there is an event class.
Or use writing a small Event class to do the CEvent stuff. It is not much.
Greetings from Germany
|
|
|
|
|
Can anybody enlighten me please,
|
|
|
|
|
Check what DLLs it depends on. Have you registered it in the other machine?
Steve
|
|
|
|
|
|
Hello,
Is it possible to re-associate a socket with a different io completion
port? I have an open socket associated with one completion port, I
post a read, handle the read, then want to send some data back on the
socket but have the write complete event be queued to a different io
completion port.
[Big picture is that I have multiple thread pools in a server and want
to move some IO to another thread pool]
Best
Mike
|
|
|
|
|
Mike Curry - Canada wrote: Is it possible to re-associate a socket with a different io completion
port?
I don't believe so. The only way to disassociate a handle from an IO completion port is to close it.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I have a non interactive service running under a local account. This service starts a process in each desktop by locating instances of explorer.exe then creating a primary token and calling CreateProcessAsUser using that token. Is there a way to get the desktop i.e. winsta0\default for the process I am goint to impersonate?
modified on Thursday, June 19, 2008 7:06 PM
|
|
|
|
|
rcardare wrote: by locating instances of explorer.exe then creating a primary token
That sounds interesting but I don't know what it means, could you be more specific?
led mike
|
|
|
|
|
I have a program running as a system service using the local system account (non interactive). This service then starts and monitors processes running interactively in the users desktop. I detect when a new user has logged in by monitoring instances of the explorer.exe and session id’s. When I have a new explorer.exe, I then impersonate the logged in user by getting the process token for explorer.exe process (OpenProcessToken) and creating a primary impersonation token (DuplicateTokenEx). Once I have the token I start the process that interacts with the user using CreateProcessAsUser and supply the token. The problem I would like to solve is setting the lpDesktop field to a proper value in the STARTUPINFO structure. I would like to get the windows station that is used for the explorer.exe process that I am impersonating. The satellite processes then communicate with the service through pipes which relays messages. I know starting the client process this way is not the best and will break post vista but I need a reliable way to keep the client processes running without having multiple processes monitoring for each desktop session. Any other ideas would be great... This has worked fine on windows server 2000 and XP which is in our production environment but when I moved this to windows 2003 I kept getting a parameter incorrect exception. I am reviewing the code and trying to set the values for what is knows to try and eliminate the error.
|
|
|
|
|
Thanks, that answers my question.
Now to dig in more to your question:
rcardare wrote: This service starts a process in each desktop
"in each desktop"? Does this mean you are working with multiple desktop sessions on the server using Terminal Services. If so you probably want to use the Terminal Services API[^]
led mike
|
|
|
|
|
The interactive window station, Winsta0, is the only window station that can display a user interface or receive user input. It is assigned to the logon session of the interactive user, and contains the keyboard, mouse, and display device. All other window stations are noninteractive, which means they cannot display a user interface or receive user input.
|
|
|
|
|
rcardare wrote: Is there a way to get the desktop i.e. winsta0\default for the process I am goint to impersonate?
Some window station functions are given here ->
http://msdn.microsoft.com/en-us/library/ms687107(VS.85).aspx[^]
Does these help... GetProcessWindowStation , EnumWindowStations .
Nibu babu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
|
|
|
|
|
Has anyone used this control?
I'm working on a MDI application that has toolbars in both the MainFrame and the ChildFrame. I want to use large images ( 32x32 ) in the ChildFrame while using normal ( 16x16) in the MainFrame. When I try to do this the MainFrame ToolBar gets mangled, graowing larger and showing some of its images as well as some un-wanted ChildFrame images.
=======================================================
//MainFrame.cpp
const DWORD dwTBStyle = TBSTYLE_FLAT ;
const DWORD dwWndStyle = WS_CHILD | WS_VISIBLE | CBRS_TOP /*| CBRS_GRIPPER*/ | CBRS_TOOLTIPS | CBRS_FLYBY /*| CBRS_SIZE_DYNAMIC*/ ;
if ( !m_wndToolBar.CreateEx(this, dwTBStyle, dwWndStyle) || ! m_wndToolBar.LoadToolBar(IDR_MAINFRAME) )
{
TRACE0( __LOC__ "Failed to create toolbar" ) ;
return( -1 ) ;
}
const CString strMainToolbarTitle( (LPCTSTR)IDS_MAIN_TOOLBAR ) ;
m_wndToolBar.SetWindowText( strMainToolbarTitle ) ;
m_wndToolBar.EnableDocking( CBRS_ALIGN_ANY ) ;
//ChildFrame.cpp
const DWORD dwTBStyle = TBSTYLE_FLAT ;
const DWORD dwWndStyle = WS_CHILD | WS_VISIBLE | CBRS_TOP /*| CBRS_GRIPPER*/ | CBRS_TOOLTIPS | CBRS_FLYBY /*| CBRS_SIZE_DYNAMIC*/ ;
if ( !m_wndSectionBar.CreateEx(this, dwTBStyle, dwWndStyle) ||
!m_wndSectionBar.LoadToolBar( IDR_JOB2) ||
!m_wndSectionBar.SetButtons( HJobButtons, sizeof(HJobButtons) / sizeof(UINT) )
)
|
|
|
|