How can I create a windows service in Delphi? - delphi

I have been assigned an assignment to create such a service in delphi which will track the logged in user activity on the computer. For this i have to
I want my service to be run in the background and should store the name of every ACTIVE window in particular time events.
Learn how to create windows service in delphi
How should I get started?

Create a Windows service in Delphi:
http://www.devarticles.com/c/a/Delphi-Kylix/Creating-a-Windows-Service-in-Delphi/

You will want to do some research in the CBT hooks provided by the Microsoft SDK. They include the ability to be notified each time a window is created, among other things.

The Service code from Aldyn is able to track logged in users. Not sure if it is what you want, but it must surely be a good start. The vendor goes through fits of activity and sleep, so be sure it does what you want as-is.
Aldyn SvCOM

Related

How to modify presence subscriptions workflow on ejabberd server?

I am developing something with ejabberd server. I came to the need of changing the subscription logic. I am using ejabberd-2.1.11
My need is on how the subscription works, I would like to change the logic so that users upload their roster contact with subscription both automatically and and save in in the rosterusers table-colum subscription immediately to be B. So that they should be able to see online and in their contacts at least when the first one has already registered to the server. ( hope this make sense for you and is valid)
I am a very beginner in erlang and ejabberd architecture but I have already developed some basic modules, my question to you is if you could help me on this regard, how difficult is to make this change and if you could give me some hints where the changes would be
I'd stay away from modifying the server, it conforms to standards and follows the specification. So if you ever need to move to another server or upgrade, you know it's just going to work.
What you would do to achieve this is implement this behavior on the client using the server's features.
If you are really sure you want to modify the server, mod_roster.erl is the file you want to be looking at.
If using an external DB, you can also modify the DB directly, but changes won't be reflected until the clients log back in.

How to prevent user changing system date/time (in Windows 7)?

Having googled, the general advice is to create a standard, non-administrator account.
I just tried that. I only had one account, my own, which is an administrator and then created a second (not the Guest account). I logged out of my own account and into the new one and tried to change the time. Windows 7 popped up a box asking if my main account would allow this (and prompting for its password).
I have been told "it shall not be possible to change system date/time". I intended to deliver a PC with only a standard account and my s/w, but can't (I think) prevent the user from creating an administrative account and changing date/time.
Can I prevent this programatially from Delphi, or do I just have to say that if the user wants to be destructive I can't prevent it?
Generally this kind of restrictions are set using the Windows Group Policy
From delphi you can use the Group Policy API or the RSoP WMI Classes.
In your application, you can actually detect user changing system time while your application is running.
You will receive WM_TIMECHANGE when system time change.
When startup, you can saved the gettickcount (As StartTickCount) and now (As StartTime). When checking, you can check if the different between tickcount and the different between time match (allow a small discrepancy) and know the different. However, if the user change system time away from your application, this trick do not work. Maybe you can have a service which is auto start checking for this.
If you need to change back to original time, here is some resources :
CHANGE the system TIME
btw, in OS level, a normal user cannot create an admin user.

How to take users session screen shot using C#

I want to capture all users screens which are connected to my Machine. So how can I do that?
I want to create a windows service which capture users screen.
Thanks
Laxmilal
You can do that using Windows Terminal Service (WTS) API. This is what you need to do:
1. Use Local system as your system service account. Other accounts will not work.
2. Call WTSOpenServer, then using WTSEnumerateSessions retrieve list of sessions
3. You will get list of WTS_SESSION_INFO structures. Each item there represents sessions. You are only interested in sessions where State is WTSActive.
4. In a loop call CreateProcessAsUser for each session you identified in previous step. Specify sessionId from the WTS_SESSION_INFO structure you have for the session. The name of the process to run would be your favorite screen capture utility. I did not use any of those, but quick search on internet turns up few options.

Website talking to client application?

I'm working on a desktop application in Delphi 2007 and on a website where content data for this application is maintained. To view this website, the user is basically restricted to Internet Explorer 7 or higher. (Not going to support the rest.)
What I am looking for is a way to add a link to the website which would tell my already-running application to select a certain record by an ID that's passed to it from the website.
That sounds easy but it's a bit more complex than this. In the application, the user selects a dossier for a customer of the user. In this list he can find a list of products. His customer -who sits next to the user- just searches on the website and selects a product to be added. (Or the user selects one for him.)
Second Life seems to be able to do this by supporting a new protocol for the web browser. Thus, the link secondlife://gingivere/240/72/ would kick you to some place in Second Life. (Unless you haven't installed Second Life, in which case it doesn't do much.) Basically, I want to implement something similar in my application!
(Must support Windows 2000, 2003, XP, Vista and newer versions of Windows.)
Oh, I'm using Borland/Codegear/Embarcadero Delphi 2007 and the application is a simple WIN32 application. (I also have Visual Studio 2008 available but would prefer to not use this.)
See Registering an Application to a URL Protocol.
I would poll a webservice from the client application rather that try to make a connection from the server to the browser.
RTC Real Thin Client and remote functions are perfect for this.
Me, I'd forget the browser compatibility issues (how do you think you will stop IE8 being used?) and use the PBear browser component direct. Using this you can intercept your links easily, and thus spot whatever reference you wish. In my app, I have things like "act://actHelp" and I spot the link type as 'act' and then search for an action with the name "actHelp". If available, I execute it. You can also pre-parse the HTML code to look for these links, and insert an image of the icon that the action uses, thus matching your UI and ensuring it is kept up to date.
Go integrated, and forget external browser issues.

MS Project Server 2007 : Programmatically toggle Task Alerts for Project Resources

I'm getting into SDK documentation, but this site has so many eyes and great answers I figure I'd throw this one out there to get some leads.
In project Server 2007, you can manage whether or not you get "task Alert" emails whenever a new task is assigned to you or existing tasks are modified. You can change this manually and individually via the web application under your personal settings.
As the project manager, say, I cannot toggle that for the entire team or manage it from my side. So if a resource or stakeholder who is assigned to a task(s) does not want email every time the plan is updated, I cannot handle that for them. I would have to walk them through the Project Web Access application to set it themselves manually.
So, has anyone crossed this bridge, and if so how did you toggle that flag for Task Alerts either through the SDK classes or via the PSI webservices? Before I slog through the docs, if I could get some "take a look ats..." that'd be great...Thanks!
You can change it in the SQL Tables. Here's a posting on it at the project server experts page.
www.projectserverexperts.com/ProjectServerFAQKnowledgeBase/SetDefaultEmailSubscriptions.aspx

Resources