[VB ou C/C++] tache de fond - sans systray icone

Bonjours, je voudrais savoir comment mettre un programme en tache de fond (au démarage), comme eMule, MSN ou fraps, mais sans systray icone (a coté de l’heure), en VB ou en C.
Merci

Qu’appelles-tu un programme en tache de fond ? Un qui tourne sans que l’utilisateur ne le voit (verbe voir à prendre au sens littéral).

Dans ce cas, n’importe quelle programme C sans interface graphique peut être nommé programme en tache de fond.

A coté de l’heure, sans icone et comme Emule, comprend pas car Emule affiche une icone.
Perso, je fait comme ça :


#define WM_TRAY_MESSAGE (WM_USER + 1)
#define MY_TRAY_ICON_ID	1
static NOTIFYICONDATA	g_niData;
static HMENU  	g_nihMenu;

// init et ajoute la zone de notification
BOOL Notify_Init()
{
	ZeroMemory(&g_niData,sizeof(NOTIFYICONDATA));
    g_niData.cbSize = sizeof(NOTIFYICONDATA);
	strncpy(g_niData.szTip, "Unlock Me !", 11);
	g_niData.uID = MY_TRAY_ICON_ID;
	g_niData.uFlags = NIF_ICON|NIF_MESSAGE|NIF_TIP;
    g_niData.hIcon = (HICON)LoadImage(g_hInst,
    	MAKEINTRESOURCE(IDR_ICO_MAIN),
    	IMAGE_ICON,
    	GetSystemMetrics(SM_CXSMICON),
    	GetSystemMetrics(SM_CYSMICON),
    	LR_DEFAULTCOLOR);
	g_niData.hWnd = g_hWnd;
	g_niData.uCallbackMessage = WM_TRAY_MESSAGE;

	g_nihMenu = LoadMenu(g_hInst,MAKEINTRESOURCE(IDR_NOTIFY_MENU));
	if (!g_nihMenu)
  return FALSE;
 
	return Shell_NotifyIcon(NIM_ADD,&g_niData);	
}

void Notify_ShowContextMenu(HWND hWnd)
{
POINT pt;

	GetCursorPos(&pt);
    SetForegroundWindow(hWnd);
    TrackPopupMenu(GetSubMenu(g_nihMenu,0),TPM_BOTTOMALIGN|TPM_LEFTBUTTON|TPM_RIGHTBUTTON,pt.x,pt.y, 0, hWnd, NULL);
}

static LRESULT CALLBACK guiproc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
                case WM_INITDIALOG:
                {
                     Notify_Init();
                     return TRUE;
                }

  case WM_TRAY_MESSAGE:
  	switch (lParam)
  	{
    case WM_LBUTTONDBLCLK:
    	ShowWindow(hwnd, SW_RESTORE);
    break;
    case WM_RBUTTONDOWN:
    case WM_CONTEXTMENU:
    	Notify_ShowContextMenu(hwnd);
  	}
  	break;

  default:
  	return FALSE;

  case WM_DESTROY:	
                   Shell_NotifyIcon(NIM_DELETE,&g_niData);
        break;
  	
  case WM_CLOSE:
  {
  	
                   Shell_NotifyIcon(NIM_DELETE,&g_niData);
     EndDialog(hwnd,0);
                   PostQuitMessage(0);
     return TRUE;
  }
	return FALSE;
}

Ou quelque chose comme ça.

et en VB, t’as pas grand chose à faire: tu peux trés bien avoir un programme que ne demarre pas par une fenetre (tu peux supprimer toutes les fenetres de ton projet) mais par une fonction “main” dans un module (point d’entrée defini dans les options).