2013년 7월 16일 화요일

한영변환(펌)

public에 밑에 함수 추가
const   English = 0; Korean = 1;
uses InputUnit, ViewUnit, Imm;
{$R *.DFM}
//////////// 한/영상태 검사 루틴///////////////
function TMainForm.IsHanState(paForm: TForm): boolean;
var
   fFlag, imeMode: DWORD;
   hIMC: THandle;
begin
   hIMC:= ImmGetContext(paForm.Handle);
   ImmGetConversionStatus(hIMC, fFlag, imeMode);
   ImmReleaseContext(paForm.Handle, hIMC);
   Result:= (fFlag = 1);
end;
//////////// 한/영상태 변화 루틴///////////////
procedure TMainForm.SetIMEMode(const Language: Integer);
var
   dwConversion, dwSentence: DWORD;
   hIMC: THandle;
begin
   hIMC:= ImmGetContext(Application.Handle);
   ImmGetConversionStatus(hIMC, dwConversion, dwSentence);
   Case Language Of
      English: ImmSetConversionStatus(hIMC, IME_CMODE_ALPHANUMERIC, dwSentence);
      Korean : ImmSetConversionStatus(hIMC, IME_CMODE_NATIVE, dwSentence);
   end; {Case Value Of}
   ImmReleaseContext(Application.Handle, hIMC);
end;

procedure TMainForm.AppMessage(var Msg: TMsg; var Handled: Boolean);
begin
   If IsHanState(Self) Then StatusBar1.Panels[1].Text:= ' 한글 '
   Else StatusBar1.Panels[1].Text:= ' 영문 ';
end;
procedure TMainForm.FormCreate(Sender: TObject);
begin
   InputFormActive:= False;
   ViewFormActive:= False;
   InputClose:= True;
   Application.OnHint:= ShowHint;
   Application.OnMessage:= AppMessage;
   SetIMEMode(Korean);
   Left:= 1;
   Top:= 1;
end;
* 자료출처 : http://blog.daum.net/ryang000/118

델파이 12.1이냐 11.3이냐?

 델파이가 12.1이 나왔습니다. 혹시 11.3버전의 커뮤니티버전이 필요하시는분이 있을 수 있을 것 같아 https://altd.embarcadero.com/.../RADStudio_11_3_esd_28... 와 이것 찾느랴 엄청고생함.