uses
TypInfo;
type
Language = (Delphi,Delphi_Prism,CBuilder);
var
StrLanguage : String;
begin
StrLanguage := GetEnumName(TypeInfo(Language),integer(Delphi)) ;
end;
uses
TypInfo;
type
Language = (Delphi,Delphi_Prism,CBuilder);
var
aLanguage : Language;
begin
aLanguage := Language(GetEnumValue(TypeInfo(Language),'CBuilder')) ;
end;
uses Windows;
type
WinIsWow64 = function( Handle: THandle; var Iret: BOOL ): Windows.BOOL; stdcall;
function IAmIn64Bits: Boolean;
var
HandleTo64BitsProcess: WinIsWow64;
Iret : Windows.BOOL;
begin
Result := False;
HandleTo64BitsProcess := GetProcAddress(GetModuleHandle('kernel32.dll'), 'IsWow64Process');
if Assigned(HandleTo64BitsProcess) then
begin
if not HandleTo64BitsProcess(GetCurrentProcess, Iret) then
Raise Exception.Create('Invalid handle');
Result := Iret;
end;
end;
uses
ActiveX, ShlObj;
procedure TForm1.Button1Click(Sender: TObject);
// Replace CSIDL_HISTORY with the constants below
var
Allocator: IMalloc;
SpecialDir: PItemIdList;
FBuf: array[0..MAX_PATH] of Char;
PerDir: string;
begin
if SHGetMalloc(Allocator) = NOERROR then
begin
SHGetSpecialFolderLocation(Form1.Handle, CSIDL_HISTORY, SpecialDir);
SHGetPathFromIDList(SpecialDir, @FBuf[0]);
Allocator.Free(SpecialDir);
ShowMessage(string(FBuf));
end;
end;
// With Windows Me/2000, the SHGetSpecialFolderLocation function
When using the Qt WidgetSet, you can use the Qt WebKit to embed a browser into a LCL form.
Lazarus LCL/Qt WebKit Demo available on FPC Qt4 Binding Web Page
Every platform has a mechanism for its default platform. The LCL unit lazhelphtml contains a class THTMLBrowserHelpViewer to start a web browser for the LCL help system. You can use its method FindDefaultBrowser to find the default browser and the parameter to start. For example:
{
VistaOpenSaveDialog:
A new Open/Save dialog that uses Windows API to display Vista
compatiable Open or Save Dialog.
Tested in Windows 2000/XP/Vista/Vista x64.
Compiled with Lazarus 0.9.29 beta (21448) / FreePascal 2.2.4
It should compile successfully with all newer and maybe some the versions.
Created by Iskren Slavov (http://www.dotfusion.net/).
No right reserved. Feel free to use for any of your applications
regardless of the license.
##########################################
Example usage:
SetScreenResolution
To change the screen resolution you can use the following function which is a wrapper for the Windows API ChangeDisplaySettings. Below is the source code of a function that takes the desired width and height as parameters and returns the return value of ChangeDisplaySettings (see the documentation for more details).
uses Registry, ShellAPI; function BrowseURL(const URL: string) : boolean; var Browser: string; begin Result := True; Browser := ''; with TRegistry.Create do try RootKey := HKEY_CLASSES_ROOT; Access := KEY_QUERY_VALUE; if OpenKey('\htmlfile\shell\open\command', False) then Browser := ReadString('') ; CloseKey; finally Free; end; if Browser = '' then begin Result := False; Exit; end; Browser := Copy(Browser, Pos('"', Browser) + 1, Length(Browser)) ; Browser := Copy(Browser, 1, Pos('"', Browser)
In most situations you use the TWebBrowser to display HTML documents to the user - thus creating your own version of the (Internet Explorer) Web browser.
Recent comments
22 hours 8 min ago
1 day 9 hours ago
1 day 9 hours ago
1 day 13 hours ago
2 days 1 hour ago
2 days 21 hours ago
3 days 21 hours ago
5 days 1 hour ago
6 days 2 hours ago
1 week 1 day ago