Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Number of application copy. how to know ?

DiskDiskDiskDisk Member Posts: 3
Guys, Have a problem..
How can i check how many copies of the application was started ?
I've tried in such way but it show me only the second copy, and the third copy is shown as the second anyway.. how to check the number of opened app copies and write it in the tooltip in tray ?
thanks

here is the code:
[code]
LRESULT CALLBACK
WindowProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{

NOTIFYICONDATA nid;

switch (message) /* handle the messages */
{
case WM_CREATE:
{

ZeroMemory(&nid,sizeof(nid));
nid.cbSize = sizeof(NOTIFYICONDATA);
nid.hWnd = hwnd;
nid.uID = 0;
nid.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP | NIF_INFO;
nid.uCallbackMessage = WM_USER;
nid.hIcon = LoadIcon(_hInstance,MAKEINTRESOURCE(IDI_MYICON));

if (g_hwnd)
{
_CopyOfapp++;
sprintf(nid.szTip, "%s%d", "app (copy ", _CopyOfapp,);
}
else
{
lstrcpy(nid.szTip,"app");
}
Shell_NotifyIcon(NIM_ADD,&nid);
}
break;
case WM_DESTROY:
PostQuitMessage (0); /* send a WM_QUIT to the message queue */
break;
default: /* for messages that we don't deal with */
return DefWindowProc (hwnd, message, wParam, lParam);
}

return 0;
}
[/code]
Sign In or Register to comment.