- CVI 정보나눔(www.cvi.kr)
- 스터디
- 질문답변
질문,답변
글 수 1,629
안녕하세요..
다름이 아니라... 프로그램을 실행하고 작게 만들때 시스템 트레이에 넣어 놓았다가 이벤트가 발생하면 화면을 표시하는 플그램을 만들고 싶습니다.
트레이 아이콘에 넣는 방법과 이벤트 발생시 화면 표시되는 방법좀 갈켜 주세여 ^^
고수님들의 답변 부탁 드립니당 ^^
그럼 즐거운 하루 되세요..
다름이 아니라... 프로그램을 실행하고 작게 만들때 시스템 트레이에 넣어 놓았다가 이벤트가 발생하면 화면을 표시하는 플그램을 만들고 싶습니다.
트레이 아이콘에 넣는 방법과 이벤트 발생시 화면 표시되는 방법좀 갈켜 주세여 ^^
고수님들의 답변 부탁 드립니당 ^^
그럼 즐거운 하루 되세요..
초짜
허창원
작업표시줄(시작라인?)에서 해당 프로그램의 실행상태를 나타내는 버튼을 없애려면요,
SetSystemAttribute (ATTR_TASKBAR_BUTTON_VISIBLE, 0);
를 호출해보세요.
반대로 표시하려면,
SetSystemAttribute (ATTR_TASKBAR_BUTTON_VISIBLE, 1);
이구요.
SetSystemAttribute (ATTR_TASKBAR_BUTTON_VISIBLE, 0);
를 호출해보세요.
반대로 표시하려면,
SetSystemAttribute (ATTR_TASKBAR_BUTTON_VISIBLE, 1);
이구요.
초짜
답변 정말 감사함다^^
우준혁
초짜님 시스템 트레이 등록하는방법좀 알려주세요~
시작 라인에도 남아 있네요..
시스템 트레이에만 남게 하는 방법은 없나여??
#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;
}