Bonjour,
je recherche des conseils, voire un petit exemple, pour integrer correctement un controle calendrier dans une appli ...
Merci d'avance.
Bonjour,
je recherche des conseils, voire un petit exemple, pour integrer correctement un controle calendrier dans une appli ...
Merci d'avance.
Bonjour,
développée en quel langage, sur quelle plate forme, ... ?pour integrer correctement un controle calendrier dans une appli ...
Google est ton ami.
Il y a des millions d'exemples de contrôles calendrier qui traînent sur le web.
En standard sous Windows tu as ça:
http://msdn.microsoft.com/library/en-us/shellcc/platform/commctls/monthcal/monthcal.asp
J'ai essayé de faire une procedure de test ...
Dès que je mets le MessageBox l'application Plante !!!
Pourtant "wDay" fait bien partie de la structure ...
Si quelqu'un pouvait m'aider ...
Mon code de procedure :
Merci d'avance.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61 BOOL CALLBACK Dialog1DlgProc (HWND hDlg, UINT message, UINT wParam, LONG lParam) { #define LEFT 35 #define TOP 30 HWND hwnd; RECT rc; INITCOMMONCONTROLSEX icex; LPNMHDR hdr = (LPNMHDR)lParam; NMSELCHANGE strd; switch (message) { case WM_INITDIALOG: icex.dwSize = sizeof(icex); icex.dwICC = ICC_DATE_CLASSES; InitCommonControlsEx(&icex); hwnd = CreateWindowEx(0, MONTHCAL_CLASS, "", WS_BORDER | WS_CHILD | WS_VISIBLE | MCS_DAYSTATE, 0,0,0,0, hDlg, NULL, hInst, NULL); MonthCal_GetMinReqRect(hwnd, &rc); SetWindowPos(hDlg, NULL, TOP, LEFT, LEFT + rc.right, TOP + rc.bottom +10, SWP_NOZORDER); SetWindowPos(hwnd, NULL, 0, 0, LEFT + rc.right, TOP + rc.bottom, SWP_NOZORDER); return TRUE ; case WM_NOTIFY : switch(hdr->code){ case MCN_SELECT: // MessageBox(hDlg, strd.stSelStart.wDay, "Application ", MB_OK|MB_ICONEXCLAMATION); break; case MCN_SELCHANGE: break; } return 0; case WM_COMMAND: switch (wParam) { case IDOK: case IDCANCEL: EndDialog (hDlg, 0) ; return TRUE ; } break ; } return FALSE ; }
Correction !
LPNMSELCHANGE strd = (LPNMSELCHANGE)lParam;
etça fonctionne mieux !
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10 case WM_NOTIFY : switch(strd->nmhdr.code){ case MCN_SELECT: itoa(strd->stSelStart.wDay, conv, 10); MessageBox(hDlg, conv, "selection", MB_OK|MB_ICONEXCLAMATION); break; case MCN_SELCHANGE: break; } return 0;
Partager