Posts

Showing posts with the label Development

Android: Get current date and time

This is a very common task in app development - get the current date and time value. In Android you can use 2 simple methods to achieve this: Method 1 Calendar c = Calendar.getInstance(); Date d = c.getTime(); Method 2 Time now = new Time(); now.setToNow();

Introducing Swelio - new library for Belgian eID cards

The freeware Belgian eID cards access library called Swelio is available for download:  https://github.com/perevoznyk/swelio-sdk Features No external dependencies x32 and x64 versions All functions have Unicode and Ansi version Simple to use, easy to embed in any programming language C++ and Delphi SDK with samples and documenation are included Works in Windows XP - Windows 8 Provides 256 different functions QR codes generation Export card data to XML Multiple readers support Exports photo in different graphical formats No eID Middleware required Hash functions and encryption supported Check of the pin code Can create and verify digital signatures Many other useful things... The new version of this blog is available on  https://perevoznyk.wordpress.com

EIDNative library version 3.0 is released

EIDNative - the Belgian eID card access library version 3.0 is available for download. Now it supports x64 and x32 Windows and can be used from Windows XP to Windows 8. This is the last release of the EIDNative library and it will be not updated in the future, because I made the new more advanced and powerful library for reading electronic id cards and the new library will replace EIDNative. The new version of this blog is available on  https://perevoznyk.wordpress.com

Quricol 2.0 - QR Code generator

The version 2.0 of Quricol - the open source freeware QR code generator library is available for download.  Download :  https://github.com/perevoznyk/quricol Based on qrencode library version 3.4.2 Added Visual Studio project file and external libraries for easy rebuild of quricol.dll. This was asked by  Carlos Gutierrez Added possibility to specify the background and foreground colors of the image Removed reference to qrencode.h from quricol.h header file. Now you have to include only one header file to your C++ project Updated Delphi library, included new demo project Compatible with Ansi and Unicode Delphi versions Can be used with 32 and 64 bit Delphi projects Updated Delphi documentation

Krento becomes Open Source

The time has come for KRENTO to be released as open source .You can find the source code on Google Code site: https://code.google.com/p/krento After 4 years of hard work I understood that I can't continue the development of such a big project alone. I hope that other developers will show the interest of giving the boost to this project. More information about Krento project is available on http://users.telenet.be/serhiy.perevoznyk/krento.html

Quricol update - custom error level correction

The new release of Quricol - the open source freeware QR code generator library is available for download. In this release I added the possibility for developers to choose the error correction level by themselves. Download : http://users.telenet.be/ws36637/download/quricol.zip 

New release of Quricol

The new version of Quricol library is available for download. Download :  https://github.com/perevoznyk/quricol Update from 07.05.2012 The error correction level is changed to high.

ANSI version of the Quricol Delphi library

Last year I published the Quricol library for Delphi 2010 or better, but some users still need the support for older Delphi versions. As a result I made an update to Quricol library with support not only the Unicode, but also ANSI Delphi code. //=============================================================================== // Copyright (c) Serhiy Perevoznyk. All rights reserved. // THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY // OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT // LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND // FITNESS FOR A PARTICULAR PURPOSE. //=============================================================================== unit QuricolCodeAnsi; interface uses Windows, SysUtils, Classes, Graphics; type TQRCode = class public class procedure GenerateBitmap(const FileName : string; const Text : string; Margin : integer = 4; PixelSize : integer = 3); class procedure GeneratePng(c...

Quricol Delphi sample

Update 11.09.2013: Quricol 2.0 is available for download. More information about this version on http://delphi32.blogspot.com/2013/09/quricol-20-qr-code-generator.html program QuricolDemo; {$APPTYPE CONSOLE} uses SysUtils, Graphics, Classes, QuricolCodeAnsi in 'QuricolCodeAnsi.pas'; var bmp : TBitmap; MS : TMemoryStream; begin try //Generate Windows bitmap and save to file TQRCode.GenerateBitmap('delphi1.bmp', 'http://delphi32.blogspot.com'); //Generate PNG image and save to file TQRCode.GeneratePng('delphi1.png', 'http://delphi32.blogspot.com'); //Generate TBitmap bmp := TQRCode.GetBitmap('http://www.krento.net'); bmp.SaveToFile('delphi2.bmp'); //Generate PNG to the memory stream MS := TMemoryStream.Create; TQRCode.GetPng(MS, 'http://www.krento.net'); MS.Position := 0; MS.SaveToFile('delphi2.png'); MS.Free; ...

Quricol - QR code generator library

Image
Quricol is an open source freeware QR code generator library for C++, Microsoft .NET and Delphi based on qrencode - QR Code encoder by Kentaro Fukuchi.The library contains methods to save the generated image to Bitmap or PNG file or generate images on-fly and save it to the stream. Both 32 and 64 bits compiled versions available along with source code. Download :  https://github.com/perevoznyk/quricol A QR code (abbreviated from Quick Response code) is a type of matrix barcode (or two-dimensional code).

C++ library for working with streams

For one of my internal projects I made a small C++ library for working with different types of streams. The main library classes are CMemoryStream, CFileStream and CResourceStream. The source code is available for download from my website: http://users.telenet.be/serhiy.perevoznyk/download/GevixLib.zip

How to check Windows version in C++

BOOL WINAPI IsWindows7() { OSVERSIONINFOEX osvi; DWORDLONG dwlConditionMask = 0; int op=VER_GREATER_EQUAL; // Initialize the OSVERSIONINFOEX structure. ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX)); osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); osvi.dwMajorVersion = 6; osvi.dwMinorVersion = 1; // Windows 7 // Initialize the condition mask. VER_SET_CONDITION( dwlConditionMask, VER_MAJORVERSION, op ); VER_SET_CONDITION( dwlConditionMask, VER_MINORVERSION, op ); // Perform the test. return VerifyVersionInfo(&osvi,VER_MAJORVERSION | VER_MINORVERSION,dwlConditionMask); } BOOL WINAPI IsWindowsVista() { OSVERSIONINFOEX osvi; DWORDLONG dwlConditionMask = 0; int op=VER_GREATER_EQUAL; // Initialize the OSVERSIONINFOEX structure. ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX)); osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); osvi.dwMajorVersion = 6; // Initialize the condition mask. VER_SET_CONDITION( dwlConditionMask, VER_...

Generate Excel files without using Microsoft Excel (Part 2)

After publishing my article on CodeProject I received a lot of questions how to change the font, alignment or color of the cells in the resulting Excel file. I improved the code of the ExcelWriter library and added the possibility to format cells. You can download the new release of the ExcelWriter library here: http://users.telenet.be/serhiy.perevoznyk/download/XLSExportDemo.zip Update from 31 Jan. 2012: This code is provided to show the possibility of easy export of the information to Excel files, not to manipulate existing Excel files or performing the complex formatting operations. The aim of this demo is to make the export easy and simple. In case if you do more complex tasks I can recommend to use another library, for example http://www.smartxls.com/index.htm. I do not have any plans to extend the provided code in the future. namespace XLSExportDemo { class Program { static void Main(string[] args) { ExcelDocument document = ...

Adding Windows 7 Jump List to a Delphi 2010 application

Image
Recently I decided to update one of my Delphi applications and make it more shiny when running on Windows 7. I looked up in the list of the new Windows 7 features and selected the Windows 7 taskbar Jump List as a nice feature for my application. As of Windows 7, the taskbar has been extended with a possibility to create a list of destinations and common tasks associated with an application.This is the application's Jump List. The Jump List is available whether the taskbar button is in a launcher state (the application isn't running) or whether it represents one or more windows. As a result of this work I made a Delphi 2010 library for easy manipulating of Windows 7 Jump List. You can download the full source code here: http://1drv.ms/1iWeIDJ The Jump List class is similar to Microsoft .NET 4.0 JumpList class TJumpList = class sealed ... public constructor Create; destructor Destroy; override; procedure Clear; procedure AddToRecentCategory(ItemPath...

Delphi class for managing file associations

File associations provide a straightforward and useful way for users and developers to customize the Shell's treatment of defined file types. Application developers can use file associations to link an application to one or more desired file types, and customize the Shell's treatment of that application's file type. For example, when the application installs, it can check for the existence of the appropriate file associations, and either create or override them as appropriate. The file association can then cause the Shell to display custom icons for files of the given types. The file association can also control how the Shell interprets user input for a file of a given type. For example, when a user double-clicks a file, the Shell launches the application and uses it to open the file. The following Delphi class can be used to associate the application with the given file extension and compatible with Windows XP, Vista and Windows 7. // --------------------------------...

building libpng in visual studio 2008 « Bobobobo’s Weblog

building libpng in visual studio 2008 « Bobobobo’s Weblog

Detecting file changes using file watching thread

An application can monitor the contents of a file by using change notifications. unit FileWatch; interface uses Windows, SysUtils, Classes; type TFileWatch = class(TThread) private FFileName : string; FOnFileChanged: TNotifyEvent; FHandle : THandle; FLastTime : TFileTime; FActive : boolean; procedure ReleaseHandle; procedure AllocateHandle; procedure SetFileName(const Value: String); protected procedure Execute; override; procedure Notify; public constructor Create; destructor Destroy; override; procedure Suspend; procedure Resume; procedure Reset; published property OnNotify: TNotifyEvent read FOnFileChanged write FOnFileChanged; property FileName: String read FFileName write SetFileName; property LastTime: TFileTime read FLastTime write FLastTime; property Active: boolean read FActive write FActive; end; implementation resourcestring SErrAllocHandle = 'Could no...

Free idDebugger Download

Free idDebugger 1 Download | idDebugger 1 Direct Download Review by FileBEAST's Nameless_1: idDebugger is an excellent little freeware application designed to simplify the debugging process by allowing for the testing of CGI and ISAPI applications without the need for an internet server. What this essentially means is the usually laborious, time consuming task of debugging applications during the development process is simplified and streamlined significantly. idDebugger is small and simple in design, and instead of offering a wide range of features it chooses rather to focus specifically on improving one very tedious aspect of the development process, and succeeds tremendously. Of course, this has the added advantage of making the application fast and easy to use, and developers are definitely going to appreciate the new ease with which ISAPI and CGI applications can now be debugged. Being both a solid performer and a great time saver, idDebugger is a very attractive freeware ...

Run an application under a specific user account

program RunButAs; {$APPTYPE CONSOLE} {$R *.res} uses Windows, SysUtils; var User, Password, Params : WideString; sUser, sPassword : string; function CreateProcessWithLogonW( lpUsername : LPCWSTR; lpDomain : LPCWSTR; lpPassword : LPCWSTR; dwLogonFlags : DWORD; lpApplicationName : LPCWSTR; lpCommandLine : LPWSTR; dwCreationFlags : DWORD; lpEnvironment : pointer; lpCurrentDirectory : LPCWSTR; var lpStartupInfo : TStartupInfoW; var lpProcessInfo : TProcessInformation ) : boolean; stdcall; external 'Advapi32.dll'; procedure ShowHelp; begin writeln('Run an application under a specific user account'); writeln('Copyright (c) 2009, Serhiy Perevoznyk'); writeln; writeln('Usage : ' + ExtractFileName(ParamStr(0)) + ' <user name=""> [<password>] <command line="">'); halt(1); end; const LOGON_WITH_PROFILE = 1; var si : TStartupInfoW; pi : TProcessInformation; hUserToken:...

Read SIS card from Delphi

Image
Here is a simple smaple of reading SIS card data using EIDNative library from Delphi application. program SisCardRead; {$APPTYPE CONSOLE} uses Windows, SysUtils, Classes, SISCard in '..\SISCard.pas', EIDNative in '..\EIDNative.pas', EIDCard in '..\EIDCard.pas'; type TManagerProc = procedure; stdcall; TManagerErrorProc = procedure(ErrorCode : cardinal); stdcall; PManagerData = ^TManagerData; TManagerData = record CardInserted : TManagerProc; CardActive : TManagerProc; CardRemoved : TManagerProc; CardInvalid : TManagerProc; ReaderWaiting : TManagerProc; Error : TManagerErrorProc; end; //callback functions procedure DoCardInserted; stdcall; begin writeln('Card inserted'); end; procedure DoCardActive; stdcall; begin writeln('Card active'); end; procedure DoCardRemoved; stdcall; begin writeln('Card removed'); end; procedure DoCardInvalid; stdcall; begin writeln(...