질문,답변

글 수 1,629

트레이 아이콘에 넣기...

조회 수 2076 추천 수 0 2006.02.20 17:40:40
초짜.. *.47.190.135
안녕하세요..
다름이 아니라... 프로그램을 실행하고 작게 만들때 시스템 트레이에 넣어 놓았다가 이벤트가 발생하면 화면을 표시하는 플그램을 만들고 싶습니다.
트레이 아이콘에 넣는 방법과 이벤트 발생시 화면 표시되는 방법좀 갈켜 주세여 ^^
고수님들의 답변 부탁 드립니당 ^^
그럼 즐거운 하루 되세요..

초짜

2006.02.20 18:41:16
*.47.190.135

아래와 같이 해서 트레이에는 넣었는뎅...
시작 라인에도 남아 있네요..
시스템 트레이에만 남게 하는 방법은 없나여??

#include "toolbox.h"
#include <cvirte.h>
#include <userint.h>
#include "tray.h"

static int menuItemIndex;
static int trayIconHandle;
static int panelHelp;
static int panelHandle;

/* Prototype of the callback function for the icon events */
int CVICALLBACK TaskbarIconCB (int iconHandle, int event, int eventData);

int main (int argc, char *argv[])
{
if (InitCVIRTE (0, argv, 0) == 0)
return -1; /* out of memory */
if ((panelHandle = LoadPanel (0, "tray.uir", PANEL)) < 0)
return -1;

/* This function creates the icon and the callback associated with events on this icons */
InstallSysTrayIcon ("Analog.ICO", "CVI Tray Icon: Right-click for popup",
TaskbarIconCB, &trayIconHandle);

/* Create a right-click menu for the icon and add some items to it */
AttachTrayIconMenu (trayIconHandle);
InsertTrayIconMenuItem (trayIconHandle, "Show", &menuItemIndex);
// InsertTrayIconMenuItem (trayIconHandle, 0, &menuItemIndex);
// InsertTrayIconMenuItem (trayIconHandle, "Plot 1", &menuItemIndex);
// InsertTrayIconMenuItem (trayIconHandle, "Plot 2", &menuItemIndex);
// InsertTrayIconMenuItem (trayIconHandle, 0, &menuItemIndex);
// InsertTrayIconMenuItem (trayIconHandle, "Reset and Clear", &menuItemIndex);

/* Set some attributes of the menu */
SetTrayIconMenuItemAttr (trayIconHandle, 4, ATTR_DIMMED, 1);
SetTrayIconMenuAttr (trayIconHandle, ATTR_POPUP_DEFAULT_ITEM, 1);


DisplayPanel (panelHandle);
RunUserInterface ();
DiscardPanel (panelHandle);
return 0;
}



int CVICALLBACK test (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{
switch (event)
{
case EVENT_COMMIT:
HidePanel (panelHandle);
break;
}
return 0;
}

int CVICALLBACK QuitCallback (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{
switch (event)
{
case EVENT_COMMIT:
QuitUserInterface (0);
break;
}
return 0;
}


int CVICALLBACK TaskbarIconCB (int iconHandle, int event, int eventData)
{
/* eventData is the value associated with the item in the pop-up menu */
switch (eventData)
{
case 1:
//SetCtrlVal (panelHandle, PANEL_NUMERICDIAL, eventData);
DisplayPanel (panelHandle);
break ;
}
return 0;
}

허창원

2006.02.20 20:22:40
*.19.45.224

작업표시줄(시작라인?)에서 해당 프로그램의 실행상태를 나타내는 버튼을 없애려면요,
SetSystemAttribute (ATTR_TASKBAR_BUTTON_VISIBLE, 0);
를 호출해보세요.

반대로 표시하려면,
SetSystemAttribute (ATTR_TASKBAR_BUTTON_VISIBLE, 1);
이구요.

초짜

2006.02.23 15:28:42
*.47.190.135

답변 정말 감사함다^^

우준혁

2009.11.10 11:18:22
*.247.149.126

초짜님 시스템 트레이 등록하는방법좀 알려주세요~
List of Articles
번호 제목 글쓴이 날짜 조회 수
공지 이제부터 질문은 LabWindows/CVI 카페를 이용하면 더 좋겠습니다 운영자 2020-11-11 1236
공지 파일(특히 그림파일)을 올리실 때의 유의사항 운영자 2004-07-16 100157
849 CVI로 영상처리하기 고수님들 부탁드립니다. [2] 차광훈 2006-03-10 1548
848 간만에 에러가 났는데요..^^;Undefined size for field'__cdecl ...... 야리싸내 2006-03-07 7191
847 cvi로 영상처리 제어해보신분 있으신가여 [1] 박효운 2006-03-05 1572
846 [질문] VC++ 에서 CVI콤포넌트를 사용했는데요 [1] 기분좋은 2006-03-04 1575
845 프로그램 분석중 생긴 질문 입니다. [3] 임범두 2006-03-03 1549
844 정말 초보적 질문일테지만... 하루종일 고민끝에 올립니다...도와주세요~ [3] 전진아 2006-02-22 1568
» 트레이 아이콘에 넣기... [4] 초짜.. 2006-02-20 2076
842 혹시 HP-GL 에 관한 자료 가지신분은 없으신가요? [3] 천세정 2006-02-17 1598
841 타이틀 바에 아이콘 넣기 file [2] 김학영 2006-02-17 1691
840 CVI를 공부하는 순서랄까요.... [1] 김학영 2006-02-16 1599
839 판넬 위치 이동에 관해... [1] oO스누피Oo 2006-02-16 2050
838 [re] 타이틀바 없는 Panel을 마우스로 찍어 옮기기 file [1] 허창원 2006-02-16 1722
837 프로그램 분석하다가 생긴 질문입니다~ fscanf에 대해서.. [1] 임범두 2006-02-15 1666
836 [re] 프로그램 분석하다가 생긴 질문입니다~ fscanf에 대해서.. [1] 임범두 2006-02-16 1618
835 캡쳐를 하기 위한 함수? [4] 천세정 2006-02-15 1579
834 확인창 띄우는 방법은.... [2] 김학영 2006-02-15 2248
833 날짜와 시간 입력 받는 컨트롤... [2] 초짜 2006-01-30 2477
832 같은 모양의 패널을 여러개 띄울때... file 알티 2006-01-27 1550
831 [re] 같은 모양의 패널을 여러개 띄울때... file [2] 허창원 2006-01-28 1572
830 안녕하십니까? 그래프 관련 프로그램에 관한 질문입니다. [3] 임범두 2006-01-26 1594