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…
Show Or Hide TaskBar
[code lang=”delphi”]procedure TForm1.btnHideTaskBarClick(Sender: TObject); Var TaskBarHandle : Integer; Begin TaskBarHandle := FindWindow(‘Shell_TrayWnd’,Nil); ShowWindow(TaskBarHandle, SW_HIDE); End; procedure TForm1.btnShowTaskBarClick(Sender: TObject); Var TaskBarHandle : Integer; Begin…
System Images
[code lang=”delphi”]Procedure CreateImages; var SysIL: HImageList; SFI: TSHFileInfo; begin // Create an image list component MyTreeView.Images := TImageList.Create(Self); // This gets the small…
System Image Usage
[code lang=”delphi”]function GetIconIndex(const AFile: string; Attrs: DWORD): integer; var SFI: TSHFileInfo; begin SHGetFileInfo(PChar(AFile), Attrs, SFI, SizeOf(TSHFileInfo), SHGFI_SYSICONINDEX or SHGFI_USEFILEATTRIBUTES); Result := SFI.iIcon; end;[/code]…