VC refresh system tray icon (original)

Source: Internet
Author: User

/*************************************** *********************************/
/* This function is mainly used to refresh the icon of the system tray */
/**/
/* The icons in the pallets cannot be automatically deleted after operations such as forcible killing of the pallets */
/* You can use the following methods to simulate Mouse clicking on the tray icon and refresh the icon */
/**/
/* Usage: Call the refurbishtray function directly */
/* OPERATOR: Richard */

/* Mail box: happyhell@gmail.com */
/* Date: 2006-11-06 */
/*************************************** * *******************************/Void cgreenspandlg:: refurbishtray ()
{
Rect windowrect;
Point point;
Int X;
Int y;
// Int smalliconwidth, smalliconheight;
// Smalliconwidth = getsystemmetrics (sm_cxsmicon );
// Smalliconheight = getsystemmetrics (sm_cysmicon); hwnd = getw.raywnd ();
: Getwindowrect (hwnd, & windowrect );
: Getcursorpos (& Point); For (x = 1; x <windowrect. Right-windowrect. Left-1; X ++)
{
For (y = 1; y <windowrect. Bottom-windowrect. Top-1; y ++)
{
Setcursorpos (windowrect. Left + X, windowrect. Top + y );
Sleep (0 );
} // Setcursorpos (smalliconwidth, smalliconheight );
}/************************************** **********************************/
/* This function is mainly used to obtain the system tray handle */
/**/
/* This method only supports versions earlier than nt. If it is earlier than nt
/* Modify the taskbar window and Its subwindow structure */
/* Author: Richard * // * mail box: happyhell@gmail.com */
/* Date: 2006-11-06 */
/*************************************** *********************************/
Hwnd cgreenspandlg: getjavasraywnd ()
{
 
Hwnd;
Hwnd =: findwindow ("shell_traywnd", null );
 
Hwnd =: find1_wex (hwnd, 0, "traypolicywnd", null); Return hwnd;
}

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.