procedure DisableCtrlAltDel(BDisable:Boolean); const VAL_DisableTaskMgr='DisableTaskMgr'; var MyW: Word; begin if Win32Platform = VER_PLATFORM_WIN32_NT then Begin with Tregistry.Create do try RootKey:=HKEY_CURRENT_USER; OpenKey(RegSystemKey,TRUE); IF Bdisable=true then WriteInteger(VAL_DisableTaskMgr,1) else DeleteValue(VAL_DisableTaskMgr); CloseKey; finally Free; end; end else begin // hanya untuk windows 95 / NT 4.0 if BDisable then begin {Disable ALT-TAB} SystemParametersInfo( SPI_SETFASTTASKSWITCH, 1, @Myw, 0); {Disable CTRL-ALT-DEL} SystemParametersInfo( SPI_SCREENSAVERRUNNING, 1, @Myw, 0); end else begin {Enable ALT-TAB} SystemParametersInfo( SPI_SETFASTTASKSWITCH, 0, @Myw, 0); {Enable CTRL-ALT-DEL} SystemParametersInfo( SPI_SCREENSAVERRUNNING, 0, @Myw, 0); end; end; end;
KSpoold Disinfector is a software that writen to restore Microsoft Office files (Word, Excel, PPT etc.) from damaged file because of KSpoold virus.
KSpoold infect the docs files by mergeing these docs to the virus file, original docs files will be delete & new file with the same name will be added to cheating the users with new file extention: .EXE So anytime you double click this infected file from explorer / open it using shell api your computer will be infected too.
The software is provided "as-is," without any express or implied warranty. In no event shall the Author be held liable for any damages arising from the use of the Software
The software is writen in Borland Delphi 7. Full source-code also provided, any comments are noted of the following: "The const SAMPLE_SIZE = 524; is taken from the following figure: Microsoft Word & Excel using the same file header at the first 512, so we get unique header at the first 12 byte after 512 offset 512 + 12 = 524"
Windows Scripting Host Control enables Delphi application to support active scripting languages installed in Windows Scripting Host (such as VB Script, Java Script, Perl, Python, Lua, Tcl etc).TekWSHControl allows to use Delphi objects in script, including use of published properties, running public and published methods, setting script procedures as event handlers, call unit procedures and functions from script, use unit variables etc.Version 2.5 basic features and improvements: (See previous history at http://www.ekassw.com/wshctrl/index.html) - Public methods of Delphi objects calls from script supported - Delphi unit routines (procedures and functions) from script supported - Access to Delphi unit variables from script supported - Minor bugs in wrapper expert fixed
If you have considered using your Macromedia Flash files to help add some flavor to your Delphi applications, but never knew how, this article is for you.
"SWFLASH.OCX" usually in the C:\Windows\System\Macromed\Flash directory.
You can then in Delphi click on the menu Component --> Import ActiveX Control. Choose the SWFlash.OCX file and import it. Once you install it, you will then have the TShockWaveFlash component to drag onto your form.
PROBLEM: The important thing to remember is that if deploy your application then they must have this OCX file or it will not run.
SOLUTION: To keep your program simple and only have 1 file to distribute, I would suggest to create a resource file of the OCX and include in your .EXE. Extract the file if needed and register it. I have included some sample code on how to do this.
CREATING RESOURCE FILE: (Skip this section if you already understand it). Create a new Text File in Notepad. Type the following line:
Flash RCDATA "SWFLASH.OCX"
Make sure the text file is saved as Filename.rc, I saved mine as FlashOCX.rc. You must also have the .rc file in the same directory as the SWFLASH.OCX file in order for this to work.
Open your command prompt (DOS window) and find the brcc32.exe file in your bin directory wherever you installed Delphi. Type this and execute it in DOS:
It should now have created a file titled "FLASHOCX.RES". You can now include this into your application.
{$R *.RES} {$R FLASHOCX.RES}
The R Directive tells your program to include that Resource File.
HOW TO EXTRACT AND REGISTER:
First off we need to check to see if we can play the Flash File or not. Click on Project --> View Source (in Delphi 5) and pull up the project source code. We want to check for the EOleSysError Message when creating the first form. If we encounter the error, then we know we must register the OCX on that particular machine.
uses comobj
begin Application.Initialize; try Application.CreateForm(TForm1, Form1); except On EOleSysError Do begin //Register OCX File because not found. end; end; Application.Run; end.
This next bit of source code that I will display will give you what is needed to extract the resource file and place into the Windows System Directory.
uses windows, classes, sysutils
var aSystemDirZ : array[0..2047] of Char; fSystemDir : String;
if ( not CreateProcess( nil, zAppName, { pointer to command line string } nil, { pointer to process security attributes } nil, { pointer to thread security attributes } false, { handle inheritance flag } CREATE_NEW_CONSOLE or { creation flags } NORMAL_PRIORITY_CLASS, nil, { pointer to new environment block } zCurDir, { pointer to current directory name } StartupInfo, { pointer to STARTUPINFO } ProcessInfo ) ) then begin Result := $FFFFFFFF; { pointer to PROCESS_INF } MessageBox( Application.Handle, PChar( SysErrorMessage( GetLastError ) ), 'Yipes!', 0 ); end else begin WaitforSingleObject( ProcessInfo.hProcess, INFINITE ); GetExitCodeProcess ( ProcessInfo.hProcess, Result ); CloseHandle ( ProcessInfo.hProcess ); CloseHandle ( ProcessInfo.hThread ); end; end;
var aSystemDirZ : array[0..2047] of Char; aShortPath : array[0..2047] of Char; fSystemDir : String; aCommand : String; aHandle : Cardinal; aFunc : TRegFunc; ResStream : TResourceStream; FileStream : TFileStream; begin
TotalFrames (get only) - Returns the total number of frames in the movie. This is not available until the movie has loaded. Wait for ReadyState = 4.
FrameNum (get or set) - The currently displayed frame of the movie. Setting this will advance or rewind the movie.
Playing (get or set) - True if the movie is currently playing, false if it is paused.
Quality (get or set) - The current rendering quality (0=Low, 1=High, 2=AutoLow, 3=AutoHigh). This is the same as the QUALITY parameter.
ScaleMode (get or set) - Scale mode (0=ShowAll, 1= NoBorder, 2 = ExactFit). This is the same as the SCALE parameter.
AlignMode (get or set) - The align mode consists of bit flags. (Left=+1, Right=+2, Top=+4, Bottom=+8). This is the same as the SALIGN parameter.
BackgroundColor (get or set) - Override the background color of a movie. An integer of the form red*65536+green*256+blue use -1 for the default movie color.
Loop (get or set) - True if the animation loops, false to play once. Same as the MOVIE parameter.
Movie (get or set) - The URL source for the Flash Player movie file. Setting this will load a new movie into the control. Same as the MOVIE parameter.
Methods
Play() - Start playing the animation.
Stop() - Stop playing the animation.
Back() - Go to the previous frame.
Forward() - Go to the next frame.
Rewind() - Go to the first frame.
SetZoomRect(int left, int top, int right, int bottom) - Zoom in on a rectangular area of the movie. Note that the units of the coordinates are in twips (1440 units per inch). To calculate a rectangle in Flash, set the ruler units to Points and multiply the coordinates by 20 to get TWIPS.
Zoom(int percent) - Zoom the view by a relative scale factor. Zoom(50) will double the size of the objects in the view. Zoom(200) will reduce the size of objects in the view by one half.
Pan(int x, int y, int mode) - Pan a zoomed in movie. The mode can be: 0 = pixels, 1 = % of window.
Events
OnProgress(int percent) - Generated as the Flash Player movie is downloading.
OnReadyStateChange(int state) - Generated when the ready state of the control changes. The possible states are 0=Loading, 1=Uninitialized, 2=Loaded, 3=Interactive, 4=Complete.
FSCommand(string command, string args) - This event is generated when a GetURL action is performed in the movie with a URL and the URL starts with "FSCommand:". The portion of the URL after the : is provided in command and the target is provided in args. This can be used to create a response to a frame or button action in the Shockwave Flash movie.
For further information see the Macromedia Flash Website
In order to include your Flash files into your Delphi Application, just type in the directory of the .SWF file, then make "Embed Movie" = True, and it will be included in your file and not look at the Movie parameter any longer.
Reference : Douglas Tietjen - http://www.imaginpro.com
To encrypt / decrypt strings without including "bad" characters (spaces, car return, line feed, tabs, etc)
Code :
function TCrypt.Desencripta(const S: String): String; var I: byte; Key: Word; ls : string; begin Key := 1674; SetLength(ls,Length(S) div 2); SetLength(Result,Length(ls)); for I := 1 to Length(ls) do begin ls[I] := char(StrToInt('$'+ Copy(S, (I*2)-1 , 2))); end;
for I := 1 to Length(ls) do begin Result[I] := char(byte(ls[I]) xor (Key shr 8)); Key := (byte(ls[I]) + Key) * C1 + C2; end; end;
function TCrypt.Encripta(const S: String): String; var I: byte; Key: Word; ls : string; begin Key := 1674; SetLength(ls,Length(S)); Result := ''; for I := 1 to Length(S) do begin ls[I] := char(byte(S[I]) xor (Key shr 8)); Result := Result + IntToHex(byte(ls[I]),2); Key := (byte(ls[I]) + Key) * C1 + C2; end;