Did you know that handles are 64 bit wide in native 64 bit applications? While this doesn’t affect any Delphi developer just yet, things will change next year with the release of Delphi “Commodore” as outlined on CodeGear’s Delphi and C++Builder Roadmap page. This means, among other things, that type-casting a THandle or HANDLE from [...]
Did you ever wonder why the UAC prompt in Windows Vista takes a really long time to start your big installation package? The reason is simple. The UAC application copies the whole file into a temorary folder to elevate it from there. This process needs a lot of time. Why? I suspect the following security [...]
SVN is a great tool for developers. And Tortoise is the dot on the i.
In order to get a fast view on the changes made to a repository, we suggest to write brief concise comments starting each line with one of these chars:
+ if you added a feature/function/…
- if you removed a feature/function/bug/…
# if you [...]
The WinSta0_DesktopSwitch Event allows an application to check for a desktop switch. The following examples demonstrates how we can wait for such an Event. To test it, simply lock and unlock the workstation. Both wait function will return on the two desktop switching.
uses
SysUtils
JwaWindows;
var H : THandle;
begin
H := OpenEvent(SYNCHRONIZE, false, ‘WinSta0_DesktopSwitch’);
if H [...]
Creating a binary file that consists of a service and a normal application can be done very simple without using the service manager. Just check for SYSTEM account. It is very unlikely that your app is run as SYSTEM (only RunAsSys does ).
uses …, JwsclToken;
begin
if JwIsSystem then
begin
try
Application.Initialize;
Application.CreateForm(TMyService, [...]
If you include Forms and SvcMgr (Service classes) in the same project (in any sub unit) you may get a memory leak. It happens only if you call the Free method directly.
Forms.Application.Free;
To make it work, you have to check for a side effect that I describe here.
The memory leak results from the SvcMgr.TServiceApplication.Destroy destructor which [...]
With Delphi “Tiburon” CodeGear wants to introduce Unicode-support for the Win32 personality. Unlike C++ Builder which has a preprocessor and thus can at least switch between ANSI and Unicode via a simple preprocessor define, Delphi didn’t have such a (globally available) mechanism in previous versions. And even in C++ Builder you wouldn’t get far with [...]
If you cannot compile JWSCL because the compiler tells you the following, then you should read on.
Incompatible Types: JwaWindows.<type X> and JwaWinNT.<type X>
In this case you did not follow the instructions How to setup JWA. However there is remedy.
The problem resides in JwaVista.pas which is part of JEDI API. It can be compiled using the [...]
A call to CreateProcessAsUser will fail with ERROR_INVALID_PARAMETER if your new process belongs to another session and you allowed inheritance of handles. In this case you have to set parameter bInheritHandles to FALSE.
Send post as PDF to convert this post to pdf.
This is the preview Version of RunAsSys for Windows XP and Vista made with the help of JWSCL.
RunAsSys runs applications as SYSTEM user in the current user’s session. If you start it without any parameters it creates a command prompt with SYSTEM privileges by default. Otherwise you can add an application with [...]