2008. 1. 24. 18:33

GetActiveCtrl() 함수



GetActiveCtrl()함수는 특정 Panel위에 있는 활성화된 컨트롤의 ID를 받아오는 함수이다.

음.. 대충 사용하려는 컨트롤의 ID를 알고싶을 때 사용하면 좋을듯..

예를 들어(CVI 정보사랑을 검색하다 발견..)..
버튼이라든지 다른 컨트롤을 동적으로  생성할 경우가 있을 수 있다.
이렇게 동적으로 생성한 컨트롤을 다룰 때 이녀석의 ID는 어떻게 될지.. 혹은 ID를 사용해야 할 경우가 있다면, 그때 GetActiveCtrl()을 사용할 수 있을 것이다.

반대로 SetActiveCtrl()은 특정 Panel의 활성화 된 컨트롤에 ID를 세팅하는 정도(?)의 함수일 것이다.

GetActiveCtrl

int GetActiveCtrl (int panelHandle);

Purpose

Obtains the ID of the active control on the specified panel.
The active control is the control that receives keyboard events when the panel is the active panel.

Parameters

Input
Name Type Description
panelHandle integer Specifier for a particular panel that is currently in memory. You obtain this handle from LoadPanel, NewPanel, or DuplicatePanel.

Return Value

Name Type Description
controlID integer Returns the control ID of the active control. If the panel has no controls, GetActiveCtrl returns zero.

GetActiveCtrl can return the following error code:

4—Panel, pop-up, menu bar, or plot ID is invalid.

참고 : CVI 정보나눔, NI LabWindows/CVI Help