::: µ¨ÆÄÀÌ Tip&Trick :::

µ¨ÆÄÀÌ Tip&Trick ¼º°Ý¿¡ ¸ÂÁö ¾Ê´Â ±¤°í,ºñ¹æ,Áú¹®ÀÇ ±ÛÀº Áï½Ã »èÁ¦Çϸç
³»¿ëÀ» º¹»çÇÏ¿© »ç¿ëÇÒ °æ¿ì ¹Ýµå½Ã ÀÌ°÷(http://www.howto.pe.kr)À» Ãâó·Î ¸í½ÃÇÏ¿© ÁÖ¼¼¿ä


Category

  ±è¿µ´ë(2003-03-07 20:10:57, Hit : 7074, Vote : 1704
 WM_COPYDATA ¸Þ½ÃÁö¸¦ »ç¿ëÇÑ IPC

---------------------------------------------------------------------------------------
// Sender:
---------------------------------------------------------------------------------------

unit usndr;

interface

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

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

type
  tData = Record
     s: String[250];
  end;

var
  Form1: TForm1;
  lWMsgHandle : longint;

implementation

{$R *.DFM}

procedure TForm1.FormCreate(Sender: TObject);
begin
  lWMsgHandle := RegisterWindowMessage('SyncString');
end;

procedure TForm1.Button1Click(Sender: TObject);
var
  DataStruct: TCopyDataStruct; {see Help under "CopyDataStruct"}
  Data: TData;
begin
  Data.s := 'TestMsg!';
  DataStruct.dwData := lWMsgHandle;
  DataStruct.cbData := SizeOf(TData);
  DataStruct.lpData := @Data;
  SendMessage(hwnd_BroadCast, WM_CopyData, wParam(Application.Handle), lParam(@DataStruct));
end;

end.


---------------------------------------------------------------------------------------
// Receiver:
---------------------------------------------------------------------------------------

unit urcv;

interface

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

type
  TFReceiver = class(TForm)
    Memo1: TMemo;
    procedure FormCreate(Sender: TObject);
  private
    f_my_Messagehandle: longint;
    procedure WndProc(var wpMessage: TMessage); override;
  public
  end;

type
  tData = Record
     s: String[250];
  end;

var
  FReceiver: TFReceiver;

implementation

{$R *.DFM}

procedure TFReceiver.FormCreate(Sender: TObject);
begin
  f_my_Messagehandle := RegisterWindowMessage('SyncString');
end;

procedure TFReceiver.WndProc(var wpMessage: TMessage);
var
  Data: TData;
begin
  If (wpMessage.Msg = WM_CopyData) And
     (PCopyDataStruct(wpMessage.lParam)^.dwData = f_my_Messagehandle) Then
  begin
    CopyMemory(@data, PCopyDataStruct(wpMessage.lParam)^.lpData, SizeOf(TData));
    wpMessage.Result := 1;
    memo1.lines.add(Data.s); {sample: output to memo-box}
  end
  else
    inherited WndProc(wpMessage);
end;

end.





451   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] ÆÄÀÏÀÇ º¯°æ/»ý¼º/»ç¿ëÇÑ ³¯Â¥ ¹Ù²Ù±â  ±è¿µ´ë 2003/03/07 5250 1298
450   [½Ã½ºÅÛ] ¼³Ä¡µÈ modem ¸®½ºÆ® ±¸ÇÏ±â  ±è¿µ´ë 2003/03/07 5239 1477
449   [À©µµ¿ìÁî API] Windows 3.1x/32s/95/98/NT ±¸ºÐÇÏ±â  ±è¿µ´ë 2003/03/07 3344 931
  [½Ã½ºÅÛ] WM_COPYDATA ¸Þ½ÃÁö¸¦ »ç¿ëÇÑ IPC  ±è¿µ´ë 2003/03/07 7074 1704
447   [½Ã½ºÅÛ] ¸¶¿ì½ºÀÇ ÁÂ,¿ì ¹öÆ°ÀÇ µ¿ÀÛ ¹Ù²Ù±â  ±è¿µ´ë 2003/03/07 4618 1243
446   [À©µµ¿ìÁî API] windowÀÇ maximize, minimize ¾Ë¾Æ³»±â  ±è¿µ´ë 2003/03/07 5082 1311
445   [½Ã½ºÅÛ] WM_COPYDATA ¸Þ½ÃÁö¸¦ »ç¿ëÇÑ IPC 2  ±è¿µ´ë 2003/03/07 6317 1759
444   [À©µµ¿ìÁî API] µ¥½ºÅ©Å¾ ¾ÆÀÌÄÜ ÀüºÎ °¨Ãß±â/º¸ÀÌ±â  ±è¿µ´ë 2003/03/07 4274 1226
443   [À©µµ¿ìÁî API] ¹ÙÅÁÈ­¸é, ½ÃÀÛ¸Þ´º icon ¼û±â±â  ±è¿µ´ë 2003/03/07 5578 1301
442   [½Ã½ºÅÛ] ¸¶¿ì½º°¡ ¼³Ä¡µÇ¾î ÀÖ´ÂÁö °Ë»çÇÏ±â  ±è¿µ´ë 2003/03/07 7264 1908
441   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] MemoÀÇ ÀÔ·Â Çà¼ö/¿­¼ö Á¦ÇÑÇÏ±â  ±è¿µ´ë 2003/03/07 4046 1301
440   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] À©µµ¿ìÁî ÆÄÀϸíÀÇ ¹«È¿ÇÑ ±¸¼º¹®ÀÚ  ±è¿µ´ë 2003/03/07 4999 1522
439   [½Ã½ºÅÛ] ÆÄÀÏÀÌ ´Ù¸¥ ÇÁ·Î±×·¥¿¡ ÀÇÇØ »ç¿ëÁßÀÎÁö °Ë»ç  ±è¿µ´ë 2003/03/07 6713 1547
438   [½Ã½ºÅÛ] ÀÏÁ¤½Ã°£ °æ°úÈÄ ¾ø¾îÁö´Â MessageBox  ±è¿µ´ë 2003/03/07 7737 1475
437   [½Ã½ºÅÛ] CPU speed ±¸Çϱâ 2  ±è¿µ´ë 2003/03/07 4556 1233
436   [³×Æ®¿÷/ÀÎÅͳÝ] LAN ¿¡ Á¢¼ÓÇß´ÂÁö °Ë»çÇÏ±â  ±è¿µ´ë 2003/03/07 4846 1268
435   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] TIFF Images and manipulation  ±è¿µ´ë 2003/03/07 5482 1359
434   [½Ã½ºÅÛ] reboot 95/98/NT  ±è¿µ´ë 2003/03/07 4886 1368
433   [³×Æ®¿÷/ÀÎÅͳÝ] Ethernet ·£Ä«µåÀÇ MAC adress ±¸ÇÏ±â  ±è¿µ´ë 2003/03/07 7775 2225
432   [³×Æ®¿÷/ÀÎÅͳÝ] Serial Port »ç¿ëÇÏ±â  ±è¿µ´ë 2003/03/07 7312 1842
431   [À©µµ¿ìÁî API] IEÀÇ ÇöÀç url °¡Á®¿À±â  ±è¿µ´ë 2003/03/07 5064 1239
430   [½Ã½ºÅÛ] DOS-matrix ÇÁ¸°ÅÍ¿¡ ÀμâÇÏ±â  ±è¿µ´ë 2003/03/07 4986 1257
429   [À©µµ¿ìÁî API] À©µµ¿ìÁî "½ÃÀÛ" ¸Þ´º¸¦ ³» ÇÁ·Î±×·¥ ¾ÈÀ¸·Î...  ±è¿µ´ë 2003/03/07 4964 1343
428   [À©µµ¿ìÁî API] ¸ðµç âÀ» ¾ÆÀÌÄÜ Ç¥½Ã/Ãë¼Ò  ±è¿µ´ë 2003/03/07 4681 1291
427   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] RichEdit È­¸é¿¡ º¸¿©Áö´Â ù¹ø°/¸¶Áö¸· Çà¹øÈ£  ±è¿µ´ë 2003/03/07 5892 1512
426   [³×Æ®¿÷/ÀÎÅͳÝ] ³×Æ®¿öÅ© ÄÄÇ»ÅÍ°¡ Á¸ÀçÇÏ´ÂÁö °Ë»çÇÏ±â  ±è¿µ´ë 2003/03/07 5261 1324
425   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] ÅؽºÆ® ÆÄÀÏ ÇÕÄ¡±â(Merging)  ±è¿µ´ë 2003/03/07 5567 1243
424   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] TRichEdit¸¦ »ç¿ëÇÑ syntax highlighting ¿¹Á¦  ±è¿µ´ë 2003/03/07 6926 1816
423   [³×Æ®¿÷/ÀÎÅͳÝ] NetMask ¾Ë¾Æ³»±â  ±è¿µ´ë 2003/03/07 7565 1907
422   [À©µµ¿ìÁî API] ApplicationÀÇ ÃÖ¼ÒÈ­½Ã Zooming È¿°ú ÁÖ±â2  ±è¿µ´ë 2003/03/07 13657 1546
421   [½Ã½ºÅÛ] driveÀÇ ÀϷùøÈ£ ¹Ù²Ù±â  ±è¿µ´ë 2003/03/07 6901 1597
420   [½Ã½ºÅÛ] CPUÀÇ »ç¿ë·ü ±¸ÇÏ±â  ±è¿µ´ë 2003/03/07 5364 3338
419   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] ¼ýÀÚÀÇ ±Ù»çÄ¡ ±¸ÇÏ±â  ±è¿µ´ë 2003/03/07 4506 1185
418   [À©µµ¿ìÁî API] How to flush key buffer  ±è¿µ´ë 2003/03/07 4876 1267
417   [COM/OLE] À©µµ¿ìÁî ½ÃÀÛÀÇ "½ÇÇà" È­¸é ¶ç¿ì±â  ±è¿µ´ë 2003/03/07 4300 1189
416   [À©µµ¿ìÁî API] ÀÛ¾÷°ü¸®ÀÚÀÇ task switching ±ÝÁö½ÃÅ°±â  ±è¿µ´ë 2003/03/07 5059 1294
415   [³×Æ®¿÷/ÀÎÅͳÝ] ÀÎÅͳݿ¡ LAN ¶Ç´Â ModemÀ¸·Î Á¢¼ÓÁßÀÎÁö °Ë»ç  ±è¿µ´ë 2003/03/07 5390 1437
414   [À©µµ¿ìÁî API] Window Handle ·Î ½ÇÇàÆÄÀÏ¸í ±¸ÇÏ±â  ±è¿µ´ë 2003/03/07 5220 1287
413   [³×Æ®¿÷/ÀÎÅͳÝ] Getting Novell Netware Login NAME  ±è¿µ´ë 2003/03/07 3971 1052
412   [ÀϹÝ/ÄÄÆ÷³ÍÆ®] ListBoxÀÇ È­¸é¿¡ º¸¿©Áö´Â ÃÖ»óÀ§ Item ¹øÈ£  ±è¿µ´ë 2003/03/07 4661 1224

[ÀÌÀü 10°³] [1]..[11][12][13] 14 [15][16][17][18][19][20]..[25] [´ÙÀ½ 10°³]
 

Copyright 1999-2024 Zeroboard / skin by zero