Skip to content

Instantly share code, notes, and snippets.

@melice
melice / IsWin64.pas
Created May 14, 2012 09:27
check if is windows 64bit
function IsWin64: Boolean;
var
Kernel32Handle : THandle;
IsWow64Process : function(Handle: Windows.THandle; var Res: Windows.BOOL): Windows.BOOL; stdcall;
GetNativeSystemInfo : procedure(var lpSystemInfo: TSystemInfo); stdcall;
isWoW64 : Bool;
SystemInfo : TSystemInfo;
const
PROCESSOR_ARCHITECTURE_AMD64 = 9;
PROCESSOR_ARCHITECTURE_IA64 = 6;
@melice
melice / fileexist64.pas
Created May 14, 2012 09:26
fileexist for win 64bit
function FileExists64(const FileName: string):Boolean;
type TWow64DisableWow64FsRedirection = function(var Wow64FsEnableRedirection: LongBool): LongBool; stdcall;
TWow64EnableWow64FsRedirection = function(Wow64FsEnableRedirection: LongBool): LongBool; stdcall;
var hHandle: THandle;
Wow64DisableWow64FsRedirection : TWow64DisableWow64FsRedirection;
Wow64EnableWow64FsRedirection : TWow64EnableWow64FsRedirection;
Wow64FsEnableRedirection : LongBool;
begin
hHandle := GetModuleHandle('kernel32.dll');
@sherrier
sherrier / 设置XP网络连接
Created April 8, 2012 12:48
使用命令行设置网络连接的IP,网关,DNS
@echo Setting IP for Office
netsh interface ip set address name="无线网络连接" source=static addr=192.168.23.19 mask=255.255.240.0 gateway=192.168.16.1 gwmetric=1
netsh interface ip set dns "无线网络连接" static 172.16.50.240
@margusmartsepp
margusmartsepp / Gamedisplayer.pas
Created May 26, 2011 11:43
Delphi stick game
unit Gamedisplayer;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, Math;
type
TGamedisplay = class(TForm)
@DasLampe
DasLampe / gist:106893
Created May 5, 2009 08:29
Bubblesort, Delphi, Example (from teacher)
unit bubblesort;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TForm1 = class(TForm)