Bug coexisting in many domestic software!

zhaozj2021-02-17  64

Bug coexisting in many domestic software!

In order to illustrate this problem, I tested the following software, my machine is P3-450, 192MB, Win2000: Tianwang firewall 2.4.8, Tencent QQ Simplified standard version 2000c build 0305b Simplified test version QQ2000C Build 0510 Jinshan Company's Kingsoft 2002 , Foxmail 4.1 When the above program runs, they add a small icon in the tray of the screen, when we open the process manager, end the system's cost.exe, then the taskbar and start menu under Windows I disappeared, this is what we can run again with the process manager (I am d: /winnt/explorer.exe), then the taskbar and the start menu under Windows appear again, but we pay attention to the original Some programs add a small icon in the tray of the screen's right foot, but the process of the program is still visible in the process manager, this is the problem, and our procedure cannot run under the user's control. . Testing the above software in addition to FoxMail 4.1, there is no other way to avoid. At the same time, I also tested a foreign software, such as Norton, WinMap, etc., do the same test, and their program icon can still appear in the taskbar after IE recovery. Moreover, there is a bug program far away from these programs, as long as it is increasing a small icon in the pallet of the screen, there is this problem. The purpose of I wrote this article is to tell you that this bug is easy to repair, take a dialog-based VC 6.0 program as an example, the first line should add the following variables in the dialog box. Notifyicondata m_tnid; define a global variable #define mywm_notifyicon (WM_USER 100)

We know, you can add a tray program to add the following code in OnNitDialog (), you can M_Tnid.cbsize = sizeof (notifyicondata); m_tnid.hwnd = AFXGETMAINWND () -> m_hwnd; m_tnid.uflags = nif_message | NIF_ICON | NIF_TIP; m_tnid.uCallbackMessage = MYWM_NOTIFYICON; strcpy (m_tnid.szTip, "Only 1.99 $"); m_tnid.uID = IDR_MAINFRAME; HICON hIcon; hIcon = AfxGetApp () -> LoadIcon (IDR_MAINFRAME); m_tnid.hIcon = hIcon; :: Shell_NotifyIcon ( NIM_ADD, & M_TNID; if (hic) :: destroyicon (HICON); At this time, the program will join an icon in the system tray, but when we exit the program, the upper right foot icon will not disappear, only The icon will disappear when the mouse moves to the icon. We can turn off the program's closing window function, add Notifyicondata Tnid; tnid.cbsize = sizeof (notifyicondata); tnid.hwndata); tnid.hwnd = AFXGETMAINWND () -> m_hwnd; tnid.uid = idR_mainframe; // guarantee deletion Our icon shell_notifyicon (Nim_Delete, & TnID); when we exited the program, adding a small icon in the upper right foot of the screen will disappear. Perhaps many people include me, they will feel that my sample is very perfect, but when I can perform illegal operations are closed, we recover IE, the cursor of the program you have previously written in the taskbar. Maybe you will say that our program has a minimized window in the taskbar. It is indeed that the program is like this, but the program we test is in the task bar after minimizing the task bar. If this is the case, when they Small icon After disappearing in the upper right foot of the screen, in general, you can't let them come out. Of course, you can write a program yourself, find the handle of the program that disappears, let it come out with a showWindow, but usually you have to retest the process of this program again with the process manager. This is the common problem of the above domestic software. Perhaps this will not cause any loss, but once I used STERM 1.0 Bet to hang up 2 days, the result was not added to my experience because IE died so that 2 days of 48 hours. But now STERM has no this bug. So how should we solve this problem? it's actually really easy. In the discussion of 9CBS, after the help of Jiangsheng (Jiang Wei's sleep), I conclude that we are in the global const uint wm_taskbarcreated = :: registerWindowMessage (_t ("taskbarcreated")); // This message is the system start menu, The taskbar is created and the message mapping table is on_registered_message (wm_taskbarcreated, the ontaskbarcreated) the ONTASKBARCREATED () function is as follows: AFX_MSG void officekbarcreated ();

void CTianWangDlg :: OnTaskBarCreated () {m_tnid.cbSize = sizeof (NOTIFYICONDATA); m_tnid.hWnd = AfxGetMainWnd () -> m_hWnd; m_tnid.uFlags = NIF_MESSAGE | NIF_ICON | NIF_TIP; m_tnid.uCallbackMessage = MYWM_NOTIFYICON; strcpy (m_tnid.szTip, "ONLY 1.99 $"); m_tnid.uid = idR_mainframe; hicon hicon; hicon = AFXGetApp () -> loading (idR_mainframe); m_tnid.hicon = hicon; :: shell_notifyicon (nim_add, & m_tnid);} At this time, now run our Program, repeated start-up process, when IE recover, our icon will appear in the system tray.

My email is Sunyuzhe@263.net welcomes yourself.

转载请注明原文地址:https://www.9cbs.com/read-29230.html

New Post(0)