LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Date/Time picker for LabWindows? (Win32 DATETIMEPICK_CLASS?)

I am just starting learning LabWindows, so please excuse the newbie question.

I am trying to write a Date/Time picker. I have found a reference in this forum about being able to use WIN32 APIs, and code like this can bring up a picker in a LabWindows panel. (Note: Not my code. I found it elsewhere and am just modifying it for placement, etc.)

#include "Windows.h" 
#include "CommCtrl.h"
…
HWND startDateHandle;
HWND startTimeHandle;

int hwndDlg;
HINSTANCE hProgInst;
	
GetPanelAttribute (panelHandle, ATTR_SYSTEM_WINDOW_HANDLE, &hwndDlg);

hProgInst = GetModuleHandle (NULL);
	
startDateHandle = CreateWindowEx (0, DATETIMEPICK_CLASS, TEXT("DateTime"),
                           WS_BORDER|WS_CHILD|WS_VISIBLE| DTS_SHORTDATEFORMAT, 37+54+10, 37,
                           90, 23, (HWND)hwndDlg, NULL, hProgInst, NULL);

startTimeHandle = CreateWindowEx (0, DATETIMEPICK_CLASS, TEXT("DateTime"),
                           WS_BORDER|WS_CHILD|WS_VISIBLE| DTS_TIMEFORMAT, 37+54+10+100, 37,
                           90, 23, (HWND)hwndDlg, NULL, hProgInst, NULL);

Although I have been able to write a simple User Interface app that uses a Canvas, buttons, input fields, timers and threads, I have no experience using the WIN32 API.

Could someone point me in the right direction for what I should be consulting in the Help files for doing something like this?

Much appreciated...

 

0 Kudos
Message 1 of 2
(2,387 Views)

Update: I have since been told that this method won't work on panels -- only the main Windows window of the app. From reading on this site, it appears .NET can't use "interface" items, so probably not .NET date picker either. And, Active X doesn't show the item on my system, and the Microsoft download for the bundle that has the needed file(s) does not list Windows 10 as a supported operating system. I suppose the user may just have to type something in, or we will make something using Rings.

0 Kudos
Message 2 of 2
(2,305 Views)