Daybreakin Things

Posted
Filed under 컴퓨터
이 ActiveX 라이브러리는 VB Accelerator에서 배포하는 것으로 VB에서 가장 문제가 되는 Window Message 가로채기 기법을 적용할 때의 디버깅 문제를 해결해 줍니다.

(제 개인적으로 이 라이브러리를 많이 사용해봤는데 여러 폼들에서 동시에 다중 서브클래싱을 하고 있는 경우는 불안정한 경우도 있더군요)

사용법 :

일단 아래의 파일을 다운로드하여 시스템 폴더에 복사하고 regsvr32로 구성요소 등록을 해 줍니다.

프로젝트에서 참조로 추가한 다음 원하는 클래스 모듈(폼 모듈을 보통 쓰죠)에서 다음과 같이 합니다.
[CODE] Implements ISubclass Private Sub Form_Load() ' 또는 Class_Initialize 등 AttachMessage Me, hwndoftargetwindow, WM_PAINT End Sub Private Sub Form_Unload(Cancel As Integer) ' 또는 Class_Terminate 등 DetachMessage Me, hwndoftargetwindow, WM_PAINT End Sub Private Property Let ISubclass_MsgResponse(ByVal RHS As SSubTimer6.EMsgResponse) '.. End Property Private Property Get ISubclass_MsgResponse() As SSubTimer6.EMsgResponse <font color=#FF7635>ISubclass_MsgResponse = emrPostProcess</font> End Property Private Function ISubclass_WindowProc(ByVal hwnd As Long, ByVal iMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long Select Case iMsg Case WM_PAINT End Select End Function [/CODE]
위와 같이 사용하는 것입니다.
중간에     부분에서 PostProcess의 경우는 원래의 윈도우 프로시저가 처리한 다음 ISubClass_WindowProc이 실행되는 것이고, PreProcess는 그 반대, 그리고 Consume은 원래 프로시저 없이 이것만으로 처리합니다. (Consume을 사용할 때 가장 조심해야겠죠)