Customizing Windows Vista Calendar Display - delphi

I want to make a program using Delphi, to watch and wait windows vista calendar displays (the two windows that appear bottom right of the screen when you hold or click the mouse on the time in systray), and when they appeared change their contents to make my own calendar (Persian calendar). Is there any way to change the contents of calendar control (SysMonthCal32) with windows messages?
Sample:

Finally I did it. The program must watch for creation of calendar window and then place its own calendar on it using SetParent API function.You can see the result app in http://www.dihav.com/pghcal/.

Related

Accelerator character not shown for TPopupMenu items, a windows settings issue or what?

Well, this sounds a like newbie question, but somehow I couldn't get the accelerator keys appears for the standard TPopupMenu items, how to fix that?
Below are two screenshots I created by creating a new VCL forms application without any coding.
Design time, OK:
Run time, no underlines:
The system is win7 Home with latest updates.
This is the default behaviour of Windows. Accelerator keys are hidden so long as you interact with menus using the mouse. Once you start using the keyboard to interact with them then the accelerator keys will be displayed.
You can see this in action by invoking the menu using the popup menu key that is typically found to the right of the space bar. Alternatively Shift + F10 can be used to invoke the popup menu from the keyboard. Main menus behave in the same way, this is not limited to popup menus.
There is a Windows setting that allows this behaviour to be changed. This setting allows you to request that accelerator keys are always show, irrespective of how the menu was invoked.

Windows Ribbon Framework: Does not highlight on hover

I am building an application which has Windows Ribbon at the top a panel with embedded 3rd party application at the bottom. As soon as embedded app loads, the main application form becomes inactive (title text becomes gray). This is expected behavior, however my problem is - unlike all other controls on the inactive main form, Ribbon tabs and the components they contain become unresponsive to mouse movements, i.e. do not highlight buttons on mouse over, do not show hints, etc. The only part of the Ribbon that works correctly on inactive form is Quick Access Toolbar. As the result, after interacting with embedded app user needs to click twice on the ribbon control to trigger an action.
The sample apps provided with Ribbon Framework do the same when they become inactive, so the issue is definitely not with my code.
I wonder if anyone else had similar experience and can suggest a workaround or a solution.
Thanks.
Just discovered that Microsoft Outlook and Excel behave exactly the same. Delphi-Ribbon-Framework uses native Windows API for creating ribbon, so this is not an issue with Delphi Ribbon Framework, or my code, but the way Microsoft implemented it.
Thanks.

Components inside a Balloon hint

I'm trying to figure out a way to add a TButton inside a TTrayIcon Balloon Hint.
Is that possible?
Application description and goal:
Basically my software detects when a USB device is connected to the computer
and automatically pops up a balloon hint which notifies the user that
a new device has been connected.
What should happen next is to ask the user "Do you want to execute operation A or operation B?",
and I'd like to give the user fast access to the options directly inside the ballooon hint.
What I have tried:
Googling a lot, but no success, because there is no info about how to access the balloon hint interface in any way.
I am using Delphi XE2 on Windows 8.
TTrayIcon is a wrapper for Shell_NotifyIcon(), which does not support custom controls in its popup notifications.
You will have to create your own popup window. You can use Shell_NotifyIconGetRect() if you want to position it relative to the tray icon. Just be aware that system tray icons can be hidden by the user, so be prepared that you may have to position your popup window without knowing where the icon is located at times.

Firemonkey and Mobile Navigation

I have an interesting observation and question, but first a comment. I have been using Delphi for 14 years and have taken a job developing an iOS mobile application using XE5. This is my first time using FMX and frankly I feel like I am stepping back in time many moons ago. In other words, if this is the future, then it feels like I have crippled. No problem though. Roll with the punches. Developing in this brave new world is not just a job. It is an adventure.
Now my question. Start a FMX mobile project using the "Header/Footer with Navigation" as your base. Then add an edit control (Edit1) to the first tab item. Then set the tab control align to none and move it to the right until you can clearly see the form itself. Then add an edit control (Edit2) to the form.
Now set the form's active control to Edit1 and run the app - no focus on Edit1. Now set the form's active control to Edit2 and run the app - focus is placed on Edit2. Interesting. Tab is a foreign word to tablets, right? Why have active control or even setfocus available? Is this an oversight by Embarcadero? Any thoughts?
Long story short I think they both have potential uses.
I use the SetFocus call to manually show the keyboard. Lets say the user navigates to a page where they're 100% sure to be putting in their username (or any text), I'll use ctrl.SetFocus to show the keyboard just to save them having to click (or is it press now?) on the edit.
I don't see ActiveControl being as useful, but it could definitely still be used. You could possibly use it to set up some sort of tabbing like structure for when the user presses Next on the keyboard (when the edit's ReturnKeyType is rkNext).

TMonthCalendar of delphi - disable the buttons

Is it possible to disable the buttons that change the date on the TMonthCalendar (VCL native)?
The calendar control is not a native Delphi control, but a wrapped Windows standard control. As such it can only be accessed using the documented interface.
In particular Spy++ reveals that it is a single window, so calling EnableWindow() to disable the navigation buttons seems impossible. What you could do is set the MaxDate and MinDate properties of the VCL control to the first and last day of the interesting month, so the month can't be changed. Unfortunately this will result in an annoying sound when the buttons are clicked.

Resources