Marco Web Center

[an error occurred while processing this directive]

Home: Code Repository: Delphi 2009 Handbook

Project: UnicodeWinApi.dproj

Project Structure

UnicodeWinApi.dpr
program UnicodeWinApi;

uses
  Forms,
  UnicodeWinApiForm in 'UnicodeWinApiForm.pas' {Form30};

{$R *.res}

begin
  Application.Initialize;
  Application.MainFormOnTaskbar := True;
  Application.CreateForm(TForm30, Form30);
  Application.Run;
end.
UnicodeWinApiForm.pas
   unit UnicodeWinApiForm;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm30 = class(TForm)
    btnMessageA: TButton;
    btnMessageW: TButton;
    btnTextOut: TButton;
    procedure btnMessageAClick(Sender: TObject);
    procedure btnMessageWClick(Sender: TObject);
    procedure btnTextOutClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form30: TForm30;

implementation

{$R *.dfm}

procedure TForm30.btnMessageAClick(Sender: TObject);
begin
  MessageBoxA (Handle, 'ইউনিকোড কী'                  ,'Caption ',   MB_OK);
end;

procedure TForm30.btnMessageWClick(Sender: TObject);
var
  ইউন      : WideString;
begin
  ইউন       := 'ইউনিক ক'            ;
  MessageBoxW (Handle, PWChar (ইউন      ), 'Caption',    MB_OK);
end;

procedure TForm30.btnTextOutClick(Sender: TObject);
var
  ws: WideString;
begin
  ws := 'ইউনিক ক'            ;
  Canvas.Font.Size := 20;
  TextOutW(Canvas.Handle, 104, 224, PWChar(ws), Length (ws));
end;

end.
UnicodeWinApiForm.pas.dfm
object Form30: TForm30
  Left = 0
  Top = 0
  Caption = 'UnicodeWinApi'
  ClientHeight = 363
  ClientWidth = 328
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'Tahoma'
  Font.Style = []
  OldCreateOrder = False
  PixelsPerInch = 96
  TextHeight = 13
  object btnMessageA: TButton
    Left = 104
    Top = 64
    Width = 105
    Height = 25
    Caption = 'MessageBox'
    TabOrder = 0
    OnClick = btnMessageAClick
  end
  object btnMessageW: TButton
    Left = 104
    Top = 120
    Width = 105
    Height = 25
    Caption = 'MessageBoxW'
    TabOrder = 1
    OnClick = btnMessageWClick
  end
  object btnTextOut: TButton
    Left = 104
    Top = 184
    Width = 105
    Height = 25
    Caption = 'TextOut'
    TabOrder = 2
    OnClick = btnTextOutClick
  end
end
HTML file generated by PasToWeb, a tool by Marco Cantù
Copyright 2008 Marco Cantù