It is currently April 27th, 2024, 8:02 am

Anyone know the cmd for the calendar on Win 7?

General topics related to Rainmeter.
taxstin
Posts: 21
Joined: March 29th, 2011, 12:06 am

Anyone know the cmd for the calendar on Win 7?

Post by taxstin »

The clock in the bottom right hand corner, when you click, it will display a calendar which you can cycle through the months. This is really useful which is why I have always kept my taskbar, I haven't found a rainmeter clock skin that had the same function. So I'm trying to make one on my own. I'm a noob though so I don't know how I would go about getting the cmd that lets you view the calendar when clicking on the clock.

Of course this is what I'm referring to

Image

thanks

*edit

Ok so I know that something like this:

Code: Select all

LeftMouseUpAction=!Execute [control.exe timedate.cpl]
Will display this:

Image

But as you can see this does not display any calendar. So it seems like a really simple fix though, I just don't know what to change to make the calendar show is all.
taxstin
Posts: 21
Joined: March 29th, 2011, 12:06 am

Re: Anyone know the cmd for the calendar on Win 7?

Post by taxstin »

i take it this is more difficult to do than i thought since no one has replied...
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Anyone know the cmd for the calendar on Win 7?

Post by jsmorley »

I'm not completely sure, but I don't think there is any "command line" native to Windows that will pop open the clock/calendar on the Notification Area (artist formerly known as System Tray).

You can use NirCmd and do it though.

http://www.nirsoft.net/utils/nircmd.html
User avatar
santa_ryan
Posts: 397
Joined: June 22nd, 2010, 4:11 am

Re: Anyone know the cmd for the calendar on Win 7?

Post by santa_ryan »

You can most likely use a rundll command, but those are tricky and VERY tedious to look for. However, im a windows freak and so I will look for a way to do this, as im very interested in learning about the new windows 7 taskbar. I know windows XP and previous, but im "New" to windows 7 (Even if ive been using it since the first beta build)

EDIT:
Well heres a way using C#
Im going to make a autoit or autohotkey script that will allow you to open the flyout window where you mouse is.

Code: Select all

using System;
using System.ComponentModel;
using System.Runtime.InteropServices;
using System.Text;

class ShowCalendar
{
    private delegate bool EnumChildCallback(IntPtr hwnd, 
            ref IntPtr lParam);

    [DllImport("User32.dll")]
    private static extern bool EnumChildWindows(IntPtr hWndParent, 
            EnumChildCallback lpEnumFunc, 
            ref IntPtr lParam);

    [DllImport("User32.dll")]
    private static extern int GetClassName(IntPtr hWnd, 
        StringBuilder lpClassName, 
        int nMaxCount);

    [DllImport("user32.dll", CharSet = CharSet.Auto)]
    private static extern IntPtr SendMessage(IntPtr hWnd, 
        UInt32 Msg, 
        IntPtr wParam, 
        IntPtr lParam);

    [DllImport("user32.dll", SetLastError = true)]
    private static extern IntPtr FindWindow(string lpClassName, 
        string lpWindowName);

    [DllImport("user32.dll", SetLastError = true)]
    private static extern IntPtr FindWindowEx(IntPtr hwndParent, 
        IntPtr hwndChildAfter, 
        string lpszClass, 
        string lpszWindow);

    [DllImport("user32.dll")]
    [return: MarshalAs(UnmanagedType.Bool)]
    private static extern bool GetWindowRect(IntPtr hWnd, 
            out RECT lpRect);

    [StructLayout(LayoutKind.Sequential)]
    private struct RECT
    {
        public int Left;        
        public int Top;         
        public int Right;       
        public int Bottom;      
    }

    private static readonly string TrayWndClassName = "Shell_TrayWnd";
    private static readonly string TrayNotifyWndClassName = "TrayNotifyWnd";
    private static readonly string ClockWndClassName = "TrayClockWClass";
    private static readonly uint WM_NCLBUTTONDOWN = 0x00A1;
    private static readonly uint HTCAPTION = 2;

    private static bool EnumChildProc(IntPtr hwndChild, ref IntPtr lParam)
    {
        StringBuilder className = new StringBuilder(128);
        GetClassName(hwndChild, className, 128);

        if (className.ToString() == ClockWndClassName)
        {
            lParam = hwndChild;
            return false;
        }
        return true;
    }


    static void Main(string[] args)
    {
        IntPtr hWndTray = FindWindow(TrayWndClassName, string.Empty);
        if (hWndTray == IntPtr.Zero)
        {
            throw new Win32Exception();
        }

        IntPtr hWndTrayNotify = FindWindowEx(hWndTray, 
            IntPtr.Zero, 
            TrayNotifyWndClassName, 
            string.Empty);
        if (hWndTrayNotify == IntPtr.Zero)
        {
            throw new Win32Exception();
        }

        // search clock window
        EnumChildCallback cb = new EnumChildCallback(EnumChildProc);
        IntPtr hWndClock = IntPtr.Zero;
        EnumChildWindows(hWndTray, cb, ref hWndClock);
        if (hWndClock == IntPtr.Zero)
        {
            throw new Win32Exception();
        }

        // get clock window position
        RECT rect;
        if (!GetWindowRect(hWndClock, out rect))
        {
            throw new Win32Exception();
        }

        // send click, lParam contains window position
        IntPtr wParam = new IntPtr(HTCAPTION);
        IntPtr lParam = new IntPtr(rect.Top << 16 | rect.Left);
        SendMessage(hWndTray, WM_NCLBUTTONDOWN, wParam, lParam);
    }
}
I have three rules when I'm trying to help you.
  • Don't get mad when you don't understand something
  • Be VERY specific with what you ask for.
    The more specific you are, the higher the quality of support you receive.
  • Do not just copy and paste what I put in examples and come back saying it doesn't work.
    It does work, but I purposely left blanks that you need to fill for your specific needs.
tumbleweed1993sf
Posts: 8
Joined: June 1st, 2011, 4:46 am

Re: Anyone know the cmd for the calendar on Win 7?

Post by tumbleweed1993sf »

Here's what you use:

"C:\WINDOWS\System32\control.exe" timedate.cpl
User avatar
GHOST®
Posts: 55
Joined: March 11th, 2011, 6:33 pm
Location: Garden City, MI

Re: Anyone know the cmd for the calendar on Win 7?

Post by GHOST® »

tumbleweed1993sf wrote:Here's what you use:

"C:\WINDOWS\System32\control.exe" timedate.cpl
SWEEET!! :oD

You wouldnt happen to know the cmd /.cpl / Majik MoJo or whatever for this window would you?? ;o)
WiFi.jpg
I've look everywhere & tried everything but the kitchen sink. :o(
You do not have the required permissions to view the files attached to this post.
"Do you want to be healed, now? Or would you prefer to bleed to death so I can try my hand at resurrection?"
User avatar
santa_ryan
Posts: 397
Joined: June 22nd, 2010, 4:11 am

Re: Anyone know the cmd for the calendar on Win 7?

Post by santa_ryan »

Code: Select all

rundll32.exe %SystemRoot%\system32\van.dll,RunVAN
I have three rules when I'm trying to help you.
  • Don't get mad when you don't understand something
  • Be VERY specific with what you ask for.
    The more specific you are, the higher the quality of support you receive.
  • Do not just copy and paste what I put in examples and come back saying it doesn't work.
    It does work, but I purposely left blanks that you need to fill for your specific needs.
User avatar
GHOST®
Posts: 55
Joined: March 11th, 2011, 6:33 pm
Location: Garden City, MI

Re: Anyone know the cmd for the calendar on Win 7?

Post by GHOST® »

santa_ryan wrote:

Code: Select all

rundll32.exe %SystemRoot%\system32\van.dll,RunVAN
AWESOME!!!
Another erli Xmas treat, THANK you very much santa_ryan. :oD
"Do you want to be healed, now? Or would you prefer to bleed to death so I can try my hand at resurrection?"
taxstin
Posts: 21
Joined: March 29th, 2011, 12:06 am

Re: Anyone know the cmd for the calendar on Win 7?

Post by taxstin »

tumbleweed1993sf wrote:Here's what you use:

"C:\WINDOWS\System32\control.exe" timedate.cpl
this gave me the same result as i posted in the second screen shot
User avatar
santa_ryan
Posts: 397
Joined: June 22nd, 2010, 4:11 am

Re: Anyone know the cmd for the calendar on Win 7?

Post by santa_ryan »

Im still working on it, i know how to do it but it will take me a bit of time to figure out how to do it from autoit or something similiar and compile an exe for you to use.
I have three rules when I'm trying to help you.
  • Don't get mad when you don't understand something
  • Be VERY specific with what you ask for.
    The more specific you are, the higher the quality of support you receive.
  • Do not just copy and paste what I put in examples and come back saying it doesn't work.
    It does work, but I purposely left blanks that you need to fill for your specific needs.