Você está na página 1de 22

5/15/13

Delphi | The Road to Delphi - a Blog about programming

PROJECTS

MISC

CATEGORIES

ABOUT

CONTRIBUTIONS

THE ROAD TO DELPHI A BLOG ABOUT PROGRAMMING


Delphi Lazarus Delphi Prism

CATEGORY ARCHI VES: DELPHI

April 25, 2013 7 Comments

Added support for RAD Studio XE4 in the Delphi IDE Theme Editor.
This entry is just for announce which the Delphi IDE
Theme Editor now supports RAD Studio XE4.

theroadtodelphi.wordpress.com/category/delphi/

1/22

5/15/13

Delphi | The Road to Delphi - a Blog about programming

.Net ADO
Applications Bing API C# COM

Delphi-News Delphi 2010 Delphi Prism Delphi XE Delphi XE2 Delphi XE3 DWM FreePascal Geolocation Google Api Google labs JEDI
API json Lazarus Networking RTTI SMBios StackOverflow

Delphi

Installer of the Delphi IDE Theme Editor

VCL Styles WinApi

WMI

XML XPath

Categories: Delphi, Tools | Tags: Delphi, tools | Permalink.

TRANSLATE Translate this blog into different languages...


April 12, 2013 2 Comments

Added support to TSMBIOS for SMBIOS 2.8 spec.


A few weeks ago (3 Apr 2013) a new update to the System Management BIOS (SMBIOS) Reference Specification was introduced by the DMTF. So the TSMBIOS project was updated to support the SMBIOS 2.8. The following changes was added to the 2.8 version: Processor Information (Type 4):

Hrvatski esky Dansk Nederlands Suomi Franais Deutsch Italiano Norsk Polski Portugus Romn Espaol Svenska

1. SMBIOSCR00106: processor family name correction (48h) 2. SMBIOSCR00107: new processor family types 3. SMBIOSCR00108: new processor family type
theroadtodelphi.wordpress.com/category/delphi/

2/22

5/15/13

Delphi | The Road to Delphi - a Blog about programming

4. SMBIOSCR00110: correct typo in table 24 (processor upgrade) 5. SMBIOSCR00118: new processor family types 6. SMBIOSCR00121: new processor family type 7. SMBIOSCR00122: new processor upgrade type 8. SMBIOSCR00125: add new Intel socket type
Memory Device (Type 17):

1. SMBIOSCR00109: add minimum, maximum and configured voltages 2. SMBIOSCR00114: add LRDIMM to memory device list
Other:

1. SMBIOSCR00116: correct/clarify structure length fields 2. SMBIOSCR00120: add new supported processor architectures 3. SMBIOSCR00123: update referenced specifications 4. Wording updates for clarity and consistency
Categories: Delphi, FreePascal, SMBios | Tags: Delphi, FPC, SMBIOS | Permalink.

ARCHI VES April 2013 (2)


March 27, 2013 Leave a comment

March 2013 (4) February 2013 (3) December 2012 (1)

Getting Processor Info using Object Pascal (Delphi / FPC) and the TSMBIOS

November 2012 (1) September 2012 (11) August 2012 (3) July 2012 (1) June 2012 (2) May 2012 (2)

theroadtodelphi.wordpress.com/category/delphi/

3/22

5/15/13

Delphi | The Road to Delphi - a Blog about programming

The SMBIOS expose the info the table type 4. Check the next snippet that shows how obtain such data using the TSMBIOS (remember, if you are using FPC, you can use this library in Windows and Linux). { $ I F D E FF P C } { $ m o d eo b j f p c } { $ H + } { $ E L S E } { $ A P P T Y P EC O N S O L E } { $ E N D I F } u s e s C l a s s e s , T y p I n f o , S y s U t i l s , u S M B I O S ;

April 2012 (3)

about the installed processors in March 2012 (6)


February 2012 (3) January 2012 (4) December 2011 (2) November 2011 (7) October 2011 (11) September 2011 (3) August 2011 (1) July 2011 (5) June 2011 (5) May 2011 (3) April 2011 (3) March 2011 (5) February 2011 (6) January 2011 (1) December 2010 (6)

f u n c t i o nS e t T o S t r i n g ( I n f o :P T y p e I n f o ; November c o n s tV a l u e ) :S t r i n g ; 2010 (6) v a r October 2010 (9) L T y p e I n f o :P T y p e I n f o ; August 2010 (4) L I n t e g e r S e t :T I n t e g e r S e t ; I :I n t e g e r ; June 2010 (1) b e g i n R e s u l t: =' ' ;
April 2010 (1) March 2010 (2) February 2010 (4)

I n t e g e r ( L I n t e g e r S e t ): =0 ; January 2010 (1) c a s eG e t T y p e D a t a ( I n f o ) ^ . O r d T y p eo f December 2009 (5) o t S B y t e ,o t U B y t e :I n t e g e r ( L I n t e g e r S e t ) : =B y t e ( V a l u e ) ; November 2009 (3) o t S W o r d ,o t U W o r d :I n t e g e r ( L I n t e g e r S e t ) : =W o r d ( V a l u e ) ; October 2009 (16) o t S L o n g ,o t U L o n g :I n t e g e r ( L I n t e g e r S e t ) : =I n t e g e r ( V a l u e e n d ; September 2009 (17)

L T y p e I n f o : =G e t T y p e D a t a ( I n f o ) ^ . C o m p T y p e { $ I F N D E FF P C } ^ { $ E N D f o rI: =0t oS i z e O f ( I n t e g e r )*8-1d o i fIi nL I n t e g e r S e tt h e n BLOGROLL b e g i n Andys Blog Tools i fR e s u l t< >' 't h e nR e s u l t: =R e s u l t +and ' , ' ; R e s u l t: =R e s u l t+G e t E n u m N a m e ( L T y p e I f o ,I ) ; Delphi n Neftali e n d ; Delphi Haven Chris e n d ; Rolliston Blog p r o c e d u r eG e t P r o c e s s o r I n f o ; Delphifeeds.com V a r Felix J COLIBRI S M B i o s :T S M B i o s ; L P r o c e s s o r I n f o :T P r o c e s s o r I n f o r m a t i o n ;
theroadtodelphi.wordpress.com/category/delphi/

Delphi sorcery Stefan Glienke's Blog

4/22

5/15/13

Delphi | The Road to Delphi - a Blog about programming

Hallvard's Blog L S R A M T y p e s :T C a c h e S R A M T y p e s ; b e g i n Hey, Scripting Guy! Blog S M B i o s : = T S M B i o s . C r e a t e ; JEDI Windows API t r y Peter W r i t e L n ( ' P r o c e s s o rI n f o r m a t i o n ' ) ; Johnson's DelphiDabbler.com i fS M B i o s . H a s P r o c e s s o r I n f ot h e n Reinvent The Wheel f o rL P r o c e s s o r I n f oi nS M B i o s . P r o c e s s o r I n f od o b e g i n RemObject Blog W r i t e L n ( ' M a n u f a c t u r e r ' + L P r o c e s s o r I n f o . P r o c e s s o r Rudy's Delphi Corner W r i t e L n ( ' S o c k e tD e s i g n a t i o n' + L P r o c e s s o r I n f o . S o c k e t D e s Scott Hanselman Blog W r i t e L n ( ' T y p e ' + L P r o c e s s o r I n f o . P r o c e s s o r Sip from the Firehose W r i t e L n ( ' F a m i l i y ' + L P r o c e s s o r I n f o . P r o c e s s o r W r i t e L n ( ' V e r s i o n ' + L P r o c e s s o r I n f o . P r o c e s s o r The Art of Delphi W r i t e L n ( F o r m a t ( ' P r o c e s s o rI D Programming % x ' , [ L P r o c e s s o r I n f o W r i t e L n ( F o r m a t ( ' V o l t a j e % n ' , [ L P r o c e s s o r I n f o The Delphi Geek W r i t e L n ( F o r m a t ( ' E x t e r n a lC l o c k % d M h z ' , [ L P r o c e s s o The Old New Thing W r i t e L n ( F o r m a t ( ' M a x i m u mp r o c e s s o rs p e e d% d M h z ' , [ L P r o The Oracle at Delphi W r i t e L n ( F o r m a t ( ' C u r r e n tp r o c e s s o r s p e e d % d M h z ' , [ L P r o W r i t e L n ( ' P r o c e s s o rU p g r a d e ' + L P r c e s s o r I n f o . P r o c e s s o YAPB o Alex Ciobanu W r i t e L n ( F o r m a t ( ' E x t e r n a lC l o c k % d M h z ' , [ L P r o c e s s o Blog

i fS M B i o s . S m b i o s V e r s i o n > = ' 2 . 3 't h e n b e g i n W r i t e L n ( ' S e r i a lN u m b e r ' + L P r o c e s s o r I n f o . S e r i a l N RECENT POSTS W r i t e L n ( ' A s s e tT a g ' + L P r o c e s s o r I n f o . A s s e t T a Added support for W r i t e L n ( ' P a r tN u m b e r ' + L P r o c e s s o r I n f o . P a r t N u m RAD Studio XE4 in the i fS M B i o s . S m b i o s V e r s i o n > = ' 2 . 5 ' t h e n Delphi IDE b e g i n Theme Editor. W r i t e L n ( F o r m a t ( ' C o r eC o u n t % d ' , [ L P r o c e s s o r Added support to W r i t e L n ( F o r m a t ( ' C o r e sE n a b l e d % d ' , [ L P r o c e s s o r TSMBIOS for SMBIOS W r i t e L n ( F o r m a t ( ' T h r e a d sC o u n t % d ' , [ L P r o c e s s o r 2.8 spec. W r i t e L n ( F o r m a t ( ' P r o c e s s o rC h a r a c t e r i s t i c s% . 4 x ' , [ L Getting Processor e n d ; Info using Object e n d ; Pascal (Delphi / FPC) W r i t e l n ;
and the TSMBIOS

Vcl Styles Utils i f( L P r o c e s s o r I n f o . R A W P r o c e s s o r I n f o r m a t i o n ^ . L 1 C a c h e H a n updated to fix QC b e g i n #114040, #114032 W r i t e L n ( ' L 1C a c h eH a n d l eI n f o ' ) ; (XE2 and XE3) W r i t e L n ( ' ' ) ; Getting Memory W r i t e L n ( ' S o c k e tD e s i g n a t i o n ' + L P r o c e s s o r I n f o . L 1 Device Info using W r i t e L n ( F o r m a t ( ' C a c h eC o n f i g u r a t i o n % . 4 x ' , [ L P r o c Object Pascal (Delphi / W r i t e L n ( F o r m a t ( ' M a x i m u mC a c h e S i z e % d K b ' , [ L P r o FPC) and W r i t e L n ( F o r m a t ( ' I n s t a l l e dC a c h eS i z e % dK b ' , [ L P r o the TSMBIOS L S R A M T y p e s : = L P r o c e s s o r I n f o . L 1 C h a c h e . G e t S u p p o r t e d S R A M W r i t e L n ( F o r m a t ( ' S u p p o r t e dS R A MT y p e [ % s ] ' , [ S e t T o L S R A M T y p e s : = L P r o c e s s o r I n f o . L 1 C h a c h e . G e t C u r r e n t S R A M T y W r i t e L n ( F o r m a t ( ' C u r r e n tS R A M T y p e [ % s ] ' , [ S e t T o CATEGORI ES

.Net (14) W r i t e L n ( F o r m a t ( ' E r r o rC o r r e c t i o nT y p e% s ' , [ E r r o r C o W r i t e L n ( F o r m a t ( ' S y s t e mC a c h eT y p e % s ' , [ S y s t e m C ADO (2)


theroadtodelphi.wordpress.com/category/delphi/ 5/22

5/15/13

Delphi | The Road to Delphi - a Blog about programming

ADSI (1) W r i t e L n ( F o r m a t ( ' A s s o c i a t i v i t y % s ' , [ L P r o c e s e n d ; Applications (13) Bing API (3)

i f( L P r o c e s s o r I n f o . R A W P r o c e s s o r I n f o r m a t i o n ^ . L 2 C a c h e H a n C# (2) b e g i n W r i t e L n ( ' L 2C a c h eH a n d l eI n f C++ o ' ) Builder ; (1) W r i t e L n ( ' ' ) ; COM (8) W r i t e L n ( ' S o c k e tD e s i g n a t i o n ' + L P r o c e s s o r I n f o . L 2 Cpp (1) W r i t e L n ( F o r m a t ( ' C a c h eC o n f i g u r a t i o n % . 4 x ' , [ L P r o c Delphi (154) W r i t e L n ( F o r m a t ( ' M a x i m u mC a c h eS i z e % dK b ' , [ L P r o W r i t e L n ( F o r m a t ( ' I n s t a l l e d Delphi C a c h e S i z e % dK b ' , [ L P r o 2010 (7) L S R A M T y p e s : = L P r o c e s s o r I n f o . L 2 C h a c h e . G e t S u p p o r t e d S R A M Delphi Prism (13) W r i t e L n ( F o r m a t ( ' S u p p o r t e dS R A MT y p e [ % s ] ' , [ S e t T o Delphi XE (7) L S R A M T y p e s : = L P r o c e s s o r I n f o . L 2 C h a c h e . G e t C u r r e n t S R A M T y Delphi XE2 (24) W r i t e L n ( F o r m a t ( ' C u r r e n tS R A MT y p e [ % s ] ' , [ S e t T o
Delphi XE3 (12)

W r i t e L n ( F o r m a t ( ' E r r o rC o r r e c t i o nT y p e% s ' , [ E r r o r C o Delphi-News (12) W r i t e L n ( F o r m a t ( ' S y s t e mC a c h eT y p e % s ' , [ S y s t e m C DWM (3) W r i t e L n ( F o r m a t ( ' A s s o c i a t i v i t y % s ' , [ L P r o c e s Firebird (1) e n d ;
FireMonkey (1)

i f( L P r o c e s s o r I n f o . R A W P r o c e s s o r I n f o r m a t i o n ^ . L 3 C a c h e H a n FreePascal (8) b e g i n Geolocation (3) W r i t e L n ( ' L 3C a c h eH a n d l eI n f o ' ) ; Google W r i t e L n ( ' ' ) ; Api (8) W r i t e L n ( ' S o c k e tD e s i g n a t i o n ' + L P r o c e s s o r I n f o . L 3 Google labs (2) W r i t e L n ( F o r m a t ( ' C a c h eC o n f i g u r a t i o n % . 4 x ' , [ L P r o c InnoSetup (1) W r i t e L n ( F o r m a t ( ' M a x i m u mC a c h eS i z e % dK b ' , [ L P r o Javascript (1) W r i t e L n ( F o r m a t ( ' I n s t a l l e dC a c h eS i z e % dK b ' , [ L P r o L S R A M T y p e s : = L P r o c e s s o r I n f o . L JEDI 3 C h API a c h (2) e . G e t S u p p o r t e d S R A M W r i t e L n ( F o r m a t ( ' S u p p o r t e d json S R A MT y p e [ % s ] ' , [ S e t T o (2) L S R A M T y p e s : = L P r o c e s s o r I n f o . L 3 C h a c h e . G e t C u r r e n t S R A M T y Lazarus (6) W r i t e L n ( F o r m a t ( ' C u r r e n tS R A MT y p e [ % s ] ' , [ S e t T o
Networking (11)

W r i t e L n ( F o r m a t ( ' E r r o rC o r r e c t i o nT y p e s ' , [ E r r o r C o PreviewHandler (1)% W r i t e L n ( F o r m a t ( ' S y s t e mC a c h e (1) T y p e % s ' , [ S y s t e m C Rest W r i t e L n ( F o r m a t ( ' A s s o c i a t i v i t y % s ' , [ L P r o c e s RTTI (4) e n d ;
SMBios (6)

R e a d l n ; SQL CLR (1) e n d Sql Server (1) e l s e StackOverflow (2) W r i t e l n ( ' N oP r o c e s s o rI n f ow a sf o u n d ' ) ; Tools (2) f i n a l l y S M B i o s . F r e e ; TWebBrowser (2) e n d ; Uncategorized (1) e n d ;
VCL Styles (23) WinApi (16) WinInet (1) WMI (36)
theroadtodelphi.wordpress.com/category/delphi/ 6/22

5/15/13

Delphi | The Road to Delphi - a Blog about programming

WUA (1) XML (2) XPath (2)

TWI TTER UPDATES RT @MacinCloud: #RAD Studio #PAServer XE4 #Delphi Platform Assistant Server now available on all MacinCloud Servers. Develop... http://t. 1 day ago Pascal still an advantage for some iOS, Android developers zdnet.com/pascal-stilla 1 day ago RT @ttdummy: WebFMX 1.0 Released! cybelesoft.com/blog/we bfmx-1- 5 days ago The TSMBIOS project now supports older #Delphi versions 5,6 7. code.google.com/p/tsm bios/ 1 week ago WmiDelphCodeCreator Revision 158: Improved Vcl Styles support: Changed Paths: @Modify /trunk/Install er.... bit.ly/13exprz 1 week ago

Categories: Delphi, FreePascal, SMBios | Tags: Delphi, FPC, SMBIOS | Permalink.

March 21, 2013 2 Comments

Vcl Styles Utils updated to fix QC #114040, #114032 (XE2 and XE3)
I just commit in the Vcl Styles Project two new fixes to patch the QC 114040 and QC 114032 (these issues exist in Delphi XE2 and XE3), both reports are related to the Highlight colors used to draw the TColorBox and TComboBoxEx components when the Vcl Styles are active.

VI SI TORS TO THI S SI TE

DELPHI FEEDS
theroadtodelphi.wordpress.com/category/delphi/ 7/22

5/15/13

Delphi | The Road to Delphi - a Blog about programming

QC 114032
As you can see in the below image the TColorBox component doesnt use the proper highlight color, but the TColorListBox uses the highlight color of the current Vcl Style.

Delphi XE4 IDE videos by Jos Len May 14, 2013 Marco's Tech Blog (marcocantu) Be-Delphi Event 3.0 May 14, 2013 Behind the connection (Franois Piette) iOS app dev with Delphi XE4 and FireMonkey 3 is a quantum leap beyond XE2 May 14, 2013 Sip from the Firehose (David Intersimone) My Delphi STOMP Client is now compatibile with iOS May 14, 2013 Daniele Teti's programming blog (Daniele Teti) A few notes on Delphi, WSDL and SOAP: passing nil values, Document/Literal versus RPC Encoded May 14, 2013 The Wiert Corner (jpluimers) C++Builder XE4 use case: (I need to) Build a MultiDevice, Multi-Tier Master/Detail database application May 13, 2013 Sip from the Firehose (David Intersimone) How to get the latest FireDAC update 8.0.3.3291 May 13, 2013 Delphi Insider (Tim Del Chiaro) Immutable strings in Delphi? May 13, 2013 DelphiTools (Eric) Internet Explorer Automation Part 3 May 12, 2013 Behind the connection (Franois Piette) Work in progress: dwsLinq extension for DWS May 11, 2013 TURBU Tech (Mason Wheeler)

The TColorBox control doesnt use a Style Hook, so the fix was done using a interposer class. To apply the path just add the Vcl.Styles.Fixes unit to your uses list after of the Vcl.ExtCtrls unit. And the result will be

QC 114040
The TComboBoxEx control have a similar issue.
theroadtodelphi.wordpress.com/category/delphi/

8/22

5/15/13

Delphi | The Road to Delphi - a Blog about programming

STACKOVERFLOW DELPHI QUESTI ONS How to get a single Arabic letter in a string with its Unicode transformation value in DELPHI? May 15, 2013 Hasan How do I ignore the response of a POST request? May 15, 2013 Benjamin Weiss trapping drag-and-drop at design time in Delphi for a TCustomGroupBox descendant May 15, 2013 user2383818

In this case fixing the Style Hook related to the TComboBoxEx control was the key.

When do I need synchronize in TThread? May 15, 2013 Benjamin Weiss Delphi 'private' clause (directive) does not work May 15, 2013 Yevgeniy Afanasyev Rad Studio XE4 vs Delphi XE4 May 15, 2013 Cape Cod Gunny using windows key press to break out of loop (non keyPress event) May 14, 2013 Jake Snake How to pull a MDI child window out of the main form? May 14, 2013 EASI Convert JSON String to Image to send by SQL May 14, 2013 Ricardo Pascoal

To apply this fix, just register the


TComboBoxExStyleHookFix style hook located in

Delphi 6 cursor not changing May 14, 2013 GeoffM

the Vcl.Styles.Fixes unit.


THE NEW OLD THI NG Microspeak: booked The secret lair of Administrative Assistants How can I display a live
theroadtodelphi.wordpress.com/category/delphi/ 9/22

Categories: Delphi, Delphi XE2 , Delphi XE3 , VCL Styles | Tags: Delphi, Vcl Styles | Permalink.

5/15/13

Delphi | The Road to Delphi - a Blog about programming

March 18, 2013 6 Comments

screenshot of a piece of another application?

Getting Memory Device Info using Object Pascal (Delphi / FPC) and the TSMBIOS
RAM is installed in your system or how is the manufacturer of reading the SPD (Serial presence detect) info

If you want to use a name for your file mapping, don't just use the name of the file itself

Why am I getting LNK2019 unresolved external for my inline If you need to know what type of function? Mathematical formulas are designed to be your memory device, you can try pretty, not to be suitable for computation How to tell the poseurs from the actual Windows developers Extending process attribute inheritance beyond its current boundaries Reading mouse input from a console program, and programmatically turning off Quick Edit mode Creating a simple pidl: For the times you care enough to send the very fake

directly (but not all the memory devices exposes the SPD info and reading the SPD require Kernel Mode access) , use the Win32_PhysicalMemory WMI class (but depending of the manufacturer the WMI fails to get info about some memory properties like the memory type) or using the SMBIOS. Using the SMBIOS you can get most of the info related to the memory devices installed like manufacturer, type, speed, serial number and so on. The next snippet show how using the TSMBIOS and Delphi (or FPC) you can retrieve such data. { $ I F D E FF P C } { $ m o d eo b j f p c } { $ H + } { $ E L S E } { $ A P P T Y P EC O N S O L E } { $ E N D I F } u s e s C l a s s e s , S y s U t i l s , u S M B I O S ;

REI NVENT THE WHEEL An error has occurred; the feed is probably down. Try again later.

COMMUNI TY

p r o c e d u r eG e t M e m o r y D e v i c e I n f o ; V a r S M B i o s:T S M B i o s ; L M e m o r y D e v i c e :T M e m o r y D e v i c e I n f o r m a t i o n ; b e g i n S M B i o s : = T S M B i o s . C r e a t e ; t r y W r i t e L n ( ' M e m o r yD e v i c eI n f o r m a t i o n ' ) ; W r i t e L n ( ' ' ) ;


theroadtodelphi.wordpress.com/category/delphi/ 10/22

5/15/13

Delphi | The Road to Delphi - a Blog about programming

i fS M B i o s . H a s M e m o r y D e v i c e I n f ot h e n f o rL M e m o r y D e v i c ei nS M B i o s . M e m o r y D e v i c e I n f o r m a t i o nd o b e g i n W r i t e L n ( F o r m a t ( ' T o t a lW i d t h % db i t s ' , [ L M e m o r y D e v i c e W r i t e L n ( F o r m a t ( ' D a t aW i d t h % db i t s ' , [ L M e m o r y D e v i c e TOP POSTS & PAGES W r i t e L n ( F o r m a t ( ' S i z e % d M b y t e s ' , [ L M e m o r y D e v i W r i t e L n ( F o r m a t ( ' F o r mF a c t o r % s ' , [ L M e m o r y D e v i c e . G e t F WMI Delphi Code W r i t e L n ( F o r m a t ( ' D e v i c eL o c a t o r % s ' , [ L M e m o r y D e v i c e . G e t D Creator W r i t e L n ( F o r m a t ( ' B a n kL o c a t o r % s ' , [ L M e m o r y D e v i c e . G e t B Using the Google Maps W r i t e L n ( F o r m a t ( ' M e m o r yT y p e % s ' , [ L M e m o r y D e v i c e . G e t M API V3 from Delphi - Part W r i t e L n ( F o r m a t ( ' S p e e d % dM H z ' , [ L M e m o r y D e v i c e . I Basic functionality W r i t e L n ( F o r m a t ( ' M a n u f a c t u r e r % s ' , [ L M e m o r y D e v i c e . M a n u Exploring Delphi XE2 W r i t e L n ( F o r m a t ( ' S e r i a lN u m b e r % s ' , [ L M e m o r y D e v i c e . S e r i VCL Styles Part I W r i t e L n ( F o r m a t ( ' A s s e tT a g % s ' , [ L M e m o r y D e v i c e . A s s e Changing the color of W r i t e L n ( F o r m a t ( ' P a r tN u m b e r % s ' , [ L M e m o r y D e v i c e . P a r t W r i t e L n ;
Edit Controls with VCL Styles Enabled

Delphi IDE Theme Editor

i fL M e m o r y D e v i c e . R A W M e m o r y D e v i c e I n f o ^ . P h y s i c a l M e m o r y A r Compile, Debug and b e g i n Run your Pascal code online. W r i t e L n ( ' P h y s i c a lM e m o r yA r r a y ' ) ; W r i t e L n ( ' ' ) ; Using the Google Maps W r i t e L n ( ' L o c a t i o n ' + L M e m o r y D e v i e . P h y s i c a l API V3 from Delphi c Part W r i t e L n ( ' U s e III ' + Getting L M e m o the r y D latitude e v i c e . P h y s i c a l and longitude of a W r i t e L n ( ' E r r o rC o r r e c t i o n' + L M e m o r y D e v i c e . P h y s i c a l mouse click i fL M e m o r y D e v i c e . P h y s i c a l M e m o r y A r r a y . R A W P h y s i c a l M e m o W r i t e L n ( F o r m a t ( ' M a x i m u m Generating C a p a c i t y dK b ' , [ L M e m o r y Qr% Codes with delphi e l s e W r i t e L n ( F o r m a t ( ' M a x i m u m Generating C a p a c i t y % db y t e s ' , [ L M e m a "unique"
hardware ID using

W r i t e L n ( F o r m a t ( ' M e m o r yd e v delphi i c e s and % the d ' WMI , [ L M e m o r y D e v i c e n d ; Vcl Styles - Adding W r i t e L n ; background images and e n d colors to Delphi forms e l s e W r i t e l n ( ' N oM e m o r yD e v i c eI n f ow a sf o u n d ' ) ; f i n a l l y S M B i o s . F r e e ; Tweets by @RRUZ e n d ; !function(d,s,id){var e n d ; js,fjs=d.getElementsByTagName(s)
[0];if(!d.getElementById(id))

b e g i n {js=d.createElement(s);js.id=id;js.src= t r y (document,"script","twitterG e t M e m o r y D e v i c e I n f o ; wjs"); e x c e p t o nE : E x c e p t i o nd o W r i t e l n ( E . C l a s s n a m e ,' : ' ,E . M e s s a g e ) ; e n d ; W r i t e l n ( ' P r e s sE n t e rt oe x i t ' ) ; R e a d l n ;


theroadtodelphi.wordpress.com/category/delphi/ 11/22

5/15/13

Delphi | The Road to Delphi - a Blog about programming

e n d .

Note: Remember if you uses FPC, you can use this library in linux as well :)

Categories: Delphi, SMBios | Tags: Delphi, FPC, SMBIOS | Permalink.

March 12, 2013 2 Comments

Added new vcl style hook to the Vcl Styles Utils to fix QC #108678, #108875 (XE2 and XE3)
I just added a new vcl style hook (TListViewStyleHookFix) for the TListView component in the Vcl Styles Utils project to fix the QC #108678, #108875 (XE2 and XE3) The issue reported in both reports, is that the images are not displayed in the TListView header with the VCL Styles enabled. When you uses the Windows Theme in a TListView with images in the header will look like so

theroadtodelphi.wordpress.com/category/delphi/

12/22

5/15/13

Delphi | The Road to Delphi - a Blog about programming

But if you enable the Vcl Styles, the images in the header are lost.

The issue is located in the


TListViewStyleHook.DrawHeaderSection method,

this method must paint the image and text of each section of the header of the ListView. This is part of the code with the bug

. . . . . . I m a g e L i s t: =S e n d M e s s a g e ( H a n d l e ,H D M _ G E T I M A G E L I S T ,0 ,0 ) ; I t e m . M a s k: =H D I _ F O R M A To rH D I _ I M A G E ; I n f l a t e R e c t ( R ,2 ,2 ) ; i f( I m a g e L i s t< >0 )a n dH e a d e r _ G e t I t e m ( H a n d l e ,I n d e x ,I t e m ) b e g i n i fI t e m . f m ta n dH D F _ I M A G E=H D F _ I M A G Et h e n I m a g e L i s t _ D r a w ( I m a g e L i s t ,I t e m . i I m a g e ,C a n v a s . H a n d l e ,R . I m a g e L i s t _ G e t I c o n S i z e ( I m a g e L i s t ,I c o n W i d t h ,I c o n H e i g h t ) ; I n c ( R . L e f t ,I c o n W i d t h+5 ) ; e n d ; . . . . . . The problem with the above code is that the SendMessage function with the HDM_GETIMAGELIST message (which is used to get the current imagelist) is not using the proper Handle. The above code is passing the handle of
theroadtodelphi.wordpress.com/category/delphi/ 13/22

5/15/13

Delphi | The Road to Delphi - a Blog about programming

the ListView, but must pass the handle of the Header control, the same applies to the call to the Header_GetItem method. The TListViewStyleHookFix introduces a new
DrawHeaderSection method which passes the

handle of the header control and fix the issue. You can use this Stylehook adding Vcl.Styles.Fixes unit to you uses clause and then register the hook on this way.

i n i t i a l i z a t i o n T S t y l e M a n a g e r . E n g i n e . R e g i s t e r S t y l e H o o k ( T L i s t V i e w ,T L i s t V i e w

Categories: Delphi, Delphi XE2 , Delphi XE3 , VCL Styles | Tags: Delphi, Vcl Styles | Permalink.

February 19, 2013 Leave a comment

How distinguish when Windows was installed in Legacy BIOS or UEFI mode using Delphi?
As part of the TSMBIOS project, I needed a method to distinguish when Windows was installed in Legacy BIOS or UEFI mode. The solution was provided by the GetFirmwareEnvironmentVariable function. The msdn documentation states

theroadtodelphi.wordpress.com/category/delphi/

14/22

5/15/13

Delphi | The Road to Delphi - a Blog about programming

Firmware variables are not supported on a legacy BIOS-based system. The GetFirmwareEnvironmentVariable function will always fail on a legacy BIOS-based system, or if Windows was installed using legacy BIOS on a system that supports both legacy BIOS and UEFI. To identify these conditions, call the function with a dummy firmware environment name such as an empty string () for the lpName parameter and a dummy GUID such as {00000000-0000-0000-0000000000000000} for the lpGuid parameter. On a legacy BIOS-based system, or on a system that supports both legacy BIOS and UEFI where Windows was installed using legacy BIOS, the function will fail with ERROR_INVALID_FUNCTION. On a UEFI-based system, the function will fail with an error specific to the firmware, such as ERROR_NOACCESS, to indicate that the dummy GUID namespace does not exist. .
So the Delphi code to detect such condition will be something like so { $ A P P T Y P EC O N S O L E } u s e s W i n d o w s , S y s U t i l s ;

f u n c t i o nG e t F i r m w a r e E n v i r o n m e n t V a r i a b l e A ( l p N a m e ,l p G u i d :L P C S T n S i z e :D W O R D ) :D W O R D ;s t d c a l l ;e x t e r n a lk e r n e l 3 2n a m e' G e t F i
theroadtodelphi.wordpress.com/category/delphi/ 15/22

5/15/13

Delphi | The Road to Delphi - a Blog about programming

b e g i n t r y G e t F i r m w a r e E n v i r o n m e n t V a r i a b l e A ( ' ' , ' { 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 i f( G e t L a s t E r r o r=E R R O R _ I N V A L I D _ F U N C T I O N )t h e n W r i t e l n ( ' L e g a c yB I O S ' ) e l s e W r i t e l n ( ' U E F IB o o tM o d e ' ) ; e x c e p t o nE :E x c e p t i o nd o W r i t e l n ( E . C l a s s N a m e ,' :' ,E . M e s s a g e ) ; e n d ; R e a d l n ; e n d .

Categories: Delphi, WinApi | Tags: Delphi, UEFI, winapi | Permalink.

February 18, 2013 Leave a comment

Added Linux support to the TSMBIOS Project


Great news for the Free Pascal developers, I just added Linux support to the TSMBIOS project.

Note : The TSMBIOS read the SMBIOS info using the /dev/mem device file which provides access to system physical memory, so the code must be
theroadtodelphi.wordpress.com/category/delphi/ 16/22

5/15/13

Delphi | The Road to Delphi - a Blog about programming

executed using a user with the proper permissions.

Categories: Delphi, FreePascal, SMBios , Tools | Tags: Delphi, FPC, SMBIOS | Permalink.

February 12, 2013 5 Comments

Introducing TSMBIOS
A few weeks ago I started a new project called TSMBIOS, this is a library which allows access the SMBIOS using the Object Pascal language (Delphi or Free Pascal).

What is the SMBIOS?


SMBIOS stands for System Management BIOS , this standard is tightly related and developed by the DMTF (Desktop Management Task Force). The SMBIOS contains a description of the systems hardware components, the information stored in the SMBIOS typically includes system manufacturer, model name, serial numbers, BIOS version, asset tag, processors, ports, device memory installed and so on. Note : The amount and accuracy of the SMBIOS information depends on the computer manufacturer.

Which are the advantages of use the SMBIOS?


You can retrieve the information without
theroadtodelphi.wordpress.com/category/delphi/ 17/22

5/15/13

Delphi | The Road to Delphi - a Blog about programming

having to probe for the actual hardware. this is a good point in terms of speed and safeness. The SMBIOS information is very well documented. You can avoid the use of undocumented functions to get hardware info (for example the RAM type and manufacturer). Useful for create a Hardware ID (machine fingerprint).

How it works?
The BIOS typically populates the SMBIOS structures at system boot time, and is not in control when the OS is running. Therefore, dynamically changing data is rarely represented in SMBIOS tables. The SMBIOS Entry Point is located somewhere between the addresses 0xF0000 and 0xFFFFF, in early Windows systems (Win95, Win98) it was possible access this space address directly, but after with the introduction of the NT Systems and the new security changes the BIOS was accessible through section \Device\PhysicalMemory, but this last method was disabled as well in Windows Server 2003 Service Pack 1, and replaced with 2 new WinApi functions the EnumSystemFirmwareTables and GetSystemFirmwareTable, Additionally the WMI supports reading the entire contents of SMBIOS data i using the MSSMBios_RawSMBiosTables class inside of the root\wmi namespace. Note : you can find more information about the SMBIOS Support in Windows on this link. The TSMBIOS can be compiled using a WinApi mode (uses the GetSystemFirmwareTable function) or using the WMI Mode (uses the
MSSMBios_RawSMBiosTables class)
theroadtodelphi.wordpress.com/category/delphi/ 18/22

5/15/13

Delphi | The Road to Delphi - a Blog about programming

If you uses the WinApi Mode you dont need use COM and the final size of the Application will be smaller, but the WinAPI functions was introduced in Windows Vista and Windows XP x64 (So in Windows Xp x86 will fail). Otherwise using the WMI mode you will need use COM ( CoInitialize and CoUninitialize), but also you will get two additional advantages 1) The WMI will work even in Windows Xp x86 systems, 2) You can read then SMBIOS data of local and remote computers. In order to use the TSMBIOS in your application only you must add the uSMBIOS unit to your uses clause, then create a instance for the TSMBios class using the proper constructor

/ /D e f a u l tc o n s t r u c t o r ,u s e df o rp o p u l a t et h eT S M B I O Sc l a s s u c o n s t r u c t o rC r e a t e ;o v e r l o a d ; / /U s et h i sc o n s t r u c t o rt ol o a dt h eS M B I O Sd a t af r o map r e v i o u c o n s t r u c t o rC r e a t e ( c o n s tF i l e N a m e:s t r i n g ) ;o v e r l o a d ; { $ I F D E FU S E W M I } / /U s et h i sc o n s t r u c t o rt or e a dt h eS M B I O Sf r o mar e m o t em a c h i c o n s t r u c t o rC r e a t e ( c o n s tR e m o t e M a c h i n e ,U s e r N a m e ,P a s s w o r d:s { $ E N D I F } and finally use the property which expose the SMBIOS info which you need. In this case as is show in the sample code the BatteryInformation property is used to get all the info of the batteries installed on the system. { $ A P P T Y P EC O N S O L E } u s e s C l a s s e s , S y s U t i l s , u S M B I O Si n' . . \ . . \ C o m m o n \ u S M B I O S . p a s ' ; p r o c e d u r eG e t B a t t e r y I n f o ; V a r S M B i o s:T S M B i o s ; L B a t t e r y I n f o :T B a t t e r y I n f o r m a t i o n ; b e g i n S M B i o s : = T S M B i o s . C r e a t e ;
theroadtodelphi.wordpress.com/category/delphi/ 19/22

5/15/13

Delphi | The Road to Delphi - a Blog about programming

t r y

W r i t e L n ( ' B a t t e r yI n f o r m a t i o n ' ) ; W r i t e L n ( ' ' ) ; i fS M B i o s . H a s B a t t e r y I n f ot h e n f o rL B a t t e r y I n f oi nS M B i o s . B a t t e r y I n f o r m a t i o nd o b e g i n W r i t e L n ( ' L o c a t i o n ' + L B a t t e r y I n f o . G e t L o c a t i o n W r i t e L n ( ' M a n u f a c t u r e r ' + L B a t t e r y I n f o . G e t M a n u f a c t W r i t e L n ( ' M a n u f a c t u r e rD a t e ' + L B a t t e r y I n f o . G e t M a n u f a c t W r i t e L n ( ' S e r i a lN u m b e r ' + L B a t t e r y I n f o . G e t S e r i a l N u W r i t e L n ( ' D e v i c eN a m e ' + L B a t t e r y I n f o . G e t D e v i c e N a W r i t e L n ( ' D e v i c eC h e m i s t r y ' + L B a t t e r y I n f o . G e t D e v i c e C h W r i t e L n ( F o r m a t ( ' D e s i g nC a p a c i t y % dm W a t t / h o u r s ' , [ L B W r i t e L n ( F o r m a t ( ' D e s i g nV o l t a g e % dm V o l t s ' , [ L B a t t e r W r i t e L n ( ' S B D SV e r s i o nN u m b e r ' + L B a t t e r y I n f o . G e t S B D S V e W r i t e L n ( F o r m a t ( ' M a x i m u mE r r o ri nB a t t e r yD a t a% d % % ' , [ L W r i t e L n ( F o r m a t ( ' S B D SV e r s i o nN u m b e r % . 4 x ' , [ L W r i t e L n ( ' S B D SM a n u f a c t u r eD a t e ' + L B a t t e r y I n f o . G e t S B D S W r i t e L n ( ' S B D SD e v i c eC h e m i s t r y ' + L B a t t e r y I n f o . G e t S B D S W r i t e L n ( F o r m a t ( ' O E MS p e c i f i c % . 8 x ' , [ L W r i t e L n ; e n d e l s e W r i t e l n ( ' N oB a t t e r yI n f ow a sf o u n d ' ) ; f i n a l l y S M B i o s . F r e e ; e n d ; e n d ; b e g i n t r y G e t B a t t e r y I n f o ; e x c e p t o nE : E x c e p t i o nd o W r i t e l n ( E . C l a s s n a m e ,' : ' ,E . M e s s a g e ) ; e n d ; W r i t e l n ( ' P r e s sE n t e rt oe x i t ' ) ; R e a d l n ; e n d .

TSMBIOS Features
Source Full documented compatible with the help insight feature, available since Delphi 2005. Supports SMBIOS Version from 2.1 to 2.7.1 Supports Delphi 5, 6, 7, 2005, BDS/Turbo 2006 and RAD Studio 2007, 2009, 2010, XE, XE2, XE3, XE4.
theroadtodelphi.wordpress.com/category/delphi/ 20/22

5/15/13

Delphi | The Road to Delphi - a Blog about programming

Compatible with FPC 2.6.0 (Windows and Linux) SMBIOS Data can be obtained using WinApi, WMI or loading a saved SMBIOS dump SMBIOS Data can be saved and load to a file SMBIOS Data can be obtained from remote machines

SMBIOS Tables supported


BIOS Information (Type 0) System Information (Type 1) Baseboard (or Module) Information (Type 2) System Enclosure or Chassis (Type 3) Processor Information (Type 4) Cache Information (Type 7) Port Connector Information (Type 8) System Slots (Type 9) OEM Strings (Type 11) System Configuration Options (Type 12) BIOS Language Information (Type 13) Physical Memory Array (Type 16) Memory Device (Type 17) Memory Array Mapped Address (Type 19) Memory Device Mapped Address (Type 20) Built-in Pointing Device (Type 21) Portable Battery (Type 22) Voltage Probe (Type 26) Cooling Device (Type 27) Temperature Probe (Type 28) Electrical Current Probe (Type 29)

The TSMBIOS is a Open Source project is hosted in the code google site.
Categories: Delphi, FreePascal, SMBios | Tags: Delphi, FPC, SMBIOS | Permalink.

December 17, 2012


theroadtodelphi.wordpress.com/category/delphi/ 21/22

5/15/13

Delphi | The Road to Delphi - a Blog about programming

Leave a comment

Delphi XE3 Vcl Styles Additions


Alexey Sharagin from Embarcadero just wrote a blog article titled Tuning VCL Styles for Forms and
Controls , which shows some features related to the

VCL Styles introduced in Delphi XE3.

Categories: Delphi, Delphi XE3 , VCL Styles | Tags: Delphi, Vcl Styles | Permalink.

Older posts

Blog at WordPress.com. | Theme: Yoko by Elmastudio Top

theroadtodelphi.wordpress.com/category/delphi/

22/22

Você também pode gostar