Konuyu Oyla:
  • Derecelendirme: 5/5 - 2 oy
  • 1
  • 2
  • 3
  • 4
  • 5
Windows Mesajlaşma Sistemi Hk. Soru (+10 Puan)
#9
Birinci Form

unit Unit1;

interface

uses
 Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
 Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;

 //Declare the message body name
const
Mymsg= 'delphican';

type
 TForm1 = class(TForm)
   Button1: TButton;
   procedure Button1Click(Sender: TObject);
   procedure FormCreate(Sender: TObject);
 private
   { Private declarations }
 public
   { Public declarations }
 end;

var
 Form1: TForm1;
WProc: Pointer;
DelphicanMmsg: cardinal;
implementation

{$R *.dfm}
function NewWndProc(Handle: hWnd; Msg, wParam, lParam: Cardinal): LongInt; stdcall;
begin
if Msg= DelphicanMmsg then
begin
MessageBox(handle, 'Uygulama Mesajı', '', MB_OK);
Result:= 1;
end else
Result := CallWindowProc(WProc, Handle, Msg, wParam, lParam);
end;


procedure TForm1.Button1Click(Sender: TObject);
begin
Sleep(30000);
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
DelphicanMmsg:= RegisterWindowMessage(Mymsg);

end;

initialization
WProc := Pointer(SetWindowLong(Application.Handle, gwl_WndProc,
Integer(@NewWndProc)));
end.


İkinci Form

unit Unit2;

interface

uses
 Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
 Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;
const
Mymsg= 'delphican';
type
 TForm1 = class(TForm)
   Button1: TButton;
   procedure Button1Click(Sender: TObject);
   procedure FormCreate(Sender: TObject);
 private
   { Private declarations }
 public
   { Public declarations }
 end;

var
 Form1: TForm1;
DelphicanMmsg: cardinal; //This is the actual handle of the message
implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
PostMessage(HWND_BROADCAST, DelphicanMmsg, 0, 0);
end;

procedure TForm1.FormCreate(Sender: TObject);
begin
DelphicanMmsg:= RegisterWindowMessage(Mymsg);

end;

end.
Cevapla


Bu Konudaki Yorumlar
Cvp: Windows Mesajlaşma Sistemi Hk. Soru (+10 Puan) - Yazar: SecondLife - 06-09-2017, Saat: 23:07

Konu ile Alakalı Benzer Konular
Konular Yazar Yorumlar Okunma Son Yorum
  Soru : Interface mi, Abstract Class mı? uparlayan 5 5.948 04-08-2026, Saat: 04:31
Son Yorum: emailx45
  [+10 Puan] String Manipülasyon İşlemleri Abdullah ILGAZ 16 17.314 20-04-2019, Saat: 00:48
Son Yorum: onurcan1977
  Dosya Bulma (Algoritmik Soru Serisi) yhackup 28 30.009 14-11-2018, Saat: 10:07
Son Yorum: engerex
  Tek dizi içinde öncelik sırası belirleme (+10 puan) Abdullah ILGAZ 4 6.671 29-11-2017, Saat: 12:07
Son Yorum: SimaWB
  Bir Record'un içini doldurma (+20 puan) Tuğrul HELVACI 21 25.578 05-10-2017, Saat: 16:33
Son Yorum: ismailkocacan



Konuyu Okuyanlar: 1 Ziyaretçi