Home > Software engineering >  WeChat icon flash, but after it opens at no new messages
WeChat icon flash, but after it opens at no new messages

Time:11-07

Everybody, everybody!

I just started to learn programming, there is a problem I met in real life

Sometimes when using WeChat PC client, can appear the WeChat icon on the taskbar in the flash, click the icon, however, found no news, so I think a problem, the Windows for a flash events in the history of the software in the task bar will appear in which the event log?

thank you

CodePudding user response:

Program your own log in, if have no have no,

CodePudding user response:

Before doing a code, WeChat is WIN32 application to
 # pragma warning (disable: 4996);//close "may not be safe code" warning, if not close, program cannot run; 
The ATOM MyRegisterClass (PWNDCLASSEX, HINSTANCE);
HWND InitInstance (HINSTANCE, int);
BOOL ScreenShot (HDC, POINT, POINT);
BOOL GetFileName (PTCHAR);

NOTIFYICONDATA g_nid;
HINSTANCE g_hInstance;
The HWND g_hWnd;
BOOL g_State=FALSE;

Int APIENTRY WinMain (HINSTANCE HINSTANCE,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
Int nCmdShow)
{
The HWND hWndPre;
If (hWndPre=FindWindow (" MYSCREENSHOT ", 0))
//SendMessage (hWndPre, WM_DESTROY, 0, 0);
ExitProcess (0);

G_hInstance=hInstance;
The HWND HWND;
MSG MSG.
Modifed WNDCLASSEX WndClass;
MyRegisterClass (& amp; WndClass, hInstance);

if (! (hWnd=InitInstance (hInstance, nCmdShow)))
return FALSE;
G_hWnd=hWnd;

G_nid. CbSize=sizeof (NOTIFYICONDATA);
G_nid. HWnd=hWnd;
G_nid. The uID=0;
G_nid. UFlags=NIF_ICON | NIF_MESSAGE | NIF_TIP;
G_nid. UCallbackMessage=MY_ICON_MESSAGE;
G_nid. HIcon=LoadIcon (hInstance, LPCTSTR IDI_OFF);
Strcpy (g_nid szTip, "TSKBAR");
Shell_NotifyIcon (NIM_ADD, & amp; G_nid);

While (GetMessage (& amp; MSG, NULL, 0, 0))
{
TranslateMessage (& amp; MSG);
DispatchMessage (& amp; MSG);
}

Return MSG. WParam;
}

Registered wcex will appear after the taskbar ICONS
The flashing news is to use transparent hIcon (should be, because we can't open WeChat kernel view)

CodePudding user response:

This is the kernel code, if the code were not fp output if there is no log
  • Related