분류 전체보기590 키 다운 체크 하기 if GetKeyState( VK_CONTROL ) and $8000 ) 0 then showmessage('Ctrl 키 눌러졌다') 2008. 8. 13. 포커스 컴포넌트 찾기 Form1.ActiveControl 이런식으로 .. if Form1.ActiveControl is TEdit then TEdit(Form1.ActiveControl).Text:='텍스트'; GetFocus 는 이런식으로 .. var Handle:THandle; ClassName:Array[0..255] of Char; TextBuf: array[0..32767] of Char; begin Handle:=GetFocus; TextBuf:='텍스트'; if Handle 0 then begin GetClassName(Handle,ClassName,SizeOf(ClassName)); if ClassName = 'TEdit' then SendMessage(Handle,WM_SETTEXT,SizeOf(TextBuf.. 2008. 8. 13. 모든 폼에 메세지 보내는 방법 1번째 방법 --------------------------------------------------- const WM_USER_SHOWMSG = WM_USER + 1234; for i := 0 to Application.ComponentCount - 1 do begin if Application.Components[i] is TForm then begin if Application.Components[i].Name = 'Form2' then SendMessage(TForm(Application.Components[i]).Handle, WM_USER_SHOWMSG, 1000, 0 ); end; end; 2번재 방법 -------------------------------------------------.. 2008. 8. 13. PostMessage 와 SendMessage의 차이점 질문1) 두 함수의 기능 => 메시지는 주로 사용자에 의해 발생되지만 프로그램 내부에서 윈도우간의 통신을 위해 의도적으로 다른 윈도우에게 메시지를 보낼 수도 있다. 이때는 다음 두 함수를 사용한다. BOOL PostMessage( HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam ); LRESULT SendMessage( HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam ); 두 함수의 인수가 완전히 동일하다. 여기서 Post 라는 말은 우리말로 "붙인다"라고 번역하며 Send 라는 말은 "보낸다"라고 번역한다. ★ PostMessage 함수 PostMessage 함수는 Msg 인수로 지정된 메시지를 hWnd 윈도우의 메시지 .. 2008. 8. 13. 이전 1 ··· 125 126 127 128 129 130 131 ··· 148 다음