ComMÉDIA
for Windows CE HomeArticles Calendar Date (I) ActiveX Controls



References


Windows CE
Web Community



[Prev] [Random] [Next]
[List Sites] [Next 5]

(Download Code)  

Part 1

Selecting Date and Time is particularly important when building most VBCE applications. H/PC’s and P/PC’s are often used as PDA’s, opening a large demand for applications that, in some way, have a close relationship with certain moments in time.

However, there’s no in-built Date control on the Visual Basic 6.0 Windows CE Toolkit. Once again, we’ll have to search for alternative ways to implement this functionality.

There’s always the option of implementing the calendar with VBCE elements. However, to keep GUI consistency and the "familiar interface to perform common tasks", we’d have to clone the control already available on the Windows CE. This seems to be an excellent opportunity to explore the Windows CE API and reuse the code already available.

 

In Windows CE there’s two basic types of controls: "Windows Controls" and "Common Controls". The first type include basic functionality like buttons, labels, list boxes or combo boxes. "Common controls" provide extra functionality and include most other controls, including Image Lists, Progress Bars, Toolbars, Month Calendars and others. In this case, we are particularly interested on the Month Calendar control.

"Common controls are a set of windows that are supported by the common control library, which is a dynamic-link library (DLL) included with the Windows operating system". There’s a basic distinction between the two types of controls which is related with the way windows communicate between them. Let's first have a look on "Messages" and "Callbacks" to understand this distinction.

On our context, the Common Control will be a child window of the VBCE window that we’ll be building. These two windows will be working in conjunction to provide the desired Date input task.

The basic mechanism underneath every interaction in the Windows OS is the "asynchronous message-passing". The OS sends "messages" to windows, these windows take control and process the messages and return to the OS again after acting accordingly. Every window has a function that the OS calls to handle all the messages for that window. We’ll call it WindowProc.

On our particular example, we have two windows interacting: our VBCE window and the Month-Calendar control window. Both windows are capable of sending messages to each other. However, we’ll call them differently.

Let’s assume that our VBCE window wants to instruct the Month-Calendar window to change its background colour. This, of course, is performed through sending a message and we’ll use the SendMessage API function to perform this. However, there are instances where it is the Month-Calendar control that wants to inform the VBCE window that some user action has occurred. This is performed through Callbacks. We’ve seen earlier that every window has a default function, WindowProc, to process all messages. When the Month-Calendar control window wants to send a message to our VBCE window, it does so by calling its WindowProc with a set of parameters that specify the contents of that message.

"Common Controls" differ from "Windows Controls" in the type of callback messages they send. Instead of "WM_COMMAND" messages, "Common Controls" use "WM_NOTIFY" messages that can handle much more information. It should be logical by now that "WM_NOTIFY" messages pass this information through User Defined Types (structures).
VBCE windows do not provide handling functionality for "WM_NOTIFY" messages sent by "Common Controls". This is why we would have to implement "Subclassing" for this only purpose.

Part II



[ Home ] [ Source Code ] [ Articles ] [ Download ] [ Support ]
[ VBCE Icons Tool ] [ ActiveX Controls ]

Copyright ComMedia 2000-2003. All rights reserved.
Microsoft, Windows CE, and Visual Basic are registered trademarks of Microsoft Corporation.

Windows CE ActiveX Controls specifically designed in ATL for eVB.

Date Time
Month Calendar
Progress Bar
Popup Menu
Tray Icon
Locale
Settings
RAS Dial
RAS Entries
RAS PPTP

>> Try them! <<


Icons Tool

The Evaluation version of the
VBCE Icons Tool
performs exactly as the registered version but draws all Icons over a grid with scrambled colors .

Check the details.

VBCE UDT's

"...to extend the intrinsic VB functionality with extra functions provided by the MS Windows Operating System..."

more...