Adding ODBC-Treiber/DSN with Delphi
> Hi! > > I have to check if some ODBC data source is created and if not create > it in runtime.…
CreateProcess
[code lang=”delphi”]function CreateProcessSimple(sExecutableFilePath : string ): string; var pi: TProcessInformation; si: TStartupInfo; begin FillMemory( @si, sizeof( si ), 0 ); si.cb := sizeof(…
Environment: OSVersion
[code lang=”delphi”]var VersionInfo: TOSVersionInfo; begin VersionInfo.dwOSVersionInfoSize := Sizeof(TOSVersionInfo); GetVersionEx(VersionInfo); Case VersionInfo.dwPlatformID of VER_PLATFORM_WIN32S: Do_SomeThing; VER_PLATFORM_WIN32_WINDOWS: Do_SomeOtherThing; VER_PLATFORM_WIN32_NT: Do_SomeThingElse; End; end; typedef struct _OSVERSIONINFO{…
Newsflash Environment: SetSystemEnvironmentVariable
This is how you do it in NT…. [code lang=”delphi”]procedure SetSystemEnvironmentVariable (const name, value : string); var rv : DWORD; begin with TRegistry.Create…
Environment: SetSystemPowerState
This isn’t a question, it’s a tip!! I’ve recently discovered a fancy, but most of the time useless, API-function called SetSystemPowerState, wich can…
How to create unique strings
> Hi > > How can I make really really really, extremely, unique names??? I need > about 100 of them at a…
PostKey32ex
> I have build an application who displays a hebrew keyboard, and I use > a combination of six TToolBars with left or…
ReBoot
[code lang=”delphi”]var hToken : THandle; tkp, ptkp : TTokenPrivileges; i : dword; begin //* Get a token for this process. */ OpenProcessToken(GetCurrentProcess,TOKEN_ADJUST_PRIVILEGES or…
Running EXE file from within own Application
> How can i run an exe File inside code Delphi? > What is the commen or method or object to run an…
SHGetSpecialFolderLocation
[code lang=”delphi”]Var SFolder : pItemIDList; SpecialPath : Array[0..MAX_PATH] Of Char; begin SHGetSpecialFolderLocation(Form1.Handle, CSIDL_STARTUP, SFolder); SHGetPathFromIDList(SFolder, SpecialPath); Label1.Caption := StrPas(SpecialPath); Other folders : CSIDL_BITBUCKET…