using System;

using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;

namespace TodayDemo
{
    public partial class Form1 : Form
    {
        [DllImport("coredll.dll")]
        static extern IntPtr FindWindow(string class_name, string caption);

        [DllImport("coredll.dll")]
        static extern int SendMessage(IntPtr hWnd, uint Msg, int wParam, int lParam);

        const uint WM_WININICHANGE = 0x1a;

        public Form1()
        {
            InitializeComponent();
            #if DEBUG
                MinimizeBox = false;
            #else
                MinimizeBox = true;
            #endif
        }
                
        void RefreshTodayScreen()
        {
            IntPtr hWnd = FindWindow("DesktopExplorerWindow", "Desktop");
            SendMessage(hWnd, WM_WININICHANGE, 0x000000F2, 0);
        }
        
        private void butRefreshToday_Click(object sender, EventArgs e)
        {
            RefreshTodayScreen();
        }
    }
}