Bonjour,
j'ai créé une fetre static qui me sert de fond, qui est subclassée sur un procedure ProcPrelev. J' ai ensuite plusieurs controles enfants qui sont traités par la procedure ProcPrelev
Dans cette derniere procedure je n'arrive pas a gerer le focus...
Voilà un bout de code :
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
hprelev = CreateWindowEx(WS_EX_OVERLAPPEDWINDOW, 
			            "Static", "", WS_BORDER | WS_CHILD | WS_VISIBLE | SS_NOTIFY, 			
			            15, 5,	600, 355,						
			            hWnd, (HMENU)1,	hInst, NULL);
           lpfnOldWndProc3 = (FARPROC)SetWindowLong(hprelev,
                                 GWL_WNDPROC, (DWORD) ProcPrelev);
           hsttitre = CreateWindowEx(WS_EX_LEFT,
			              "Static", "",	WS_CHILD | WS_VISIBLE, 			
			              150, 2, 280, 30,						
			              hprelev, (HMENU)1, hInst, NULL);
           SendMessage (hsttitre, WM_SETFONT, (UINT)hFont3, 0);
		   SetWindowText(hsttitre, "Gestion des prelèvements ...");
hstobj = CreateWindowEx(WS_EX_LEFT,
			              "Static", "",	WS_CHILD | WS_VISIBLE, 			
			              20, 45, 380, 18,						
			              hprelev, (HMENU)1, hInst, NULL);

           SetWindowText (hstobj, cp.LibCompte);
for &#40;is=175,js=0; js<6; is+=25, js++&#41; &#123;
           hckbxprel&#91;js&#93; = CreateWindow&#40;"Button", "",
                          BS_AUTOCHECKBOX|WS_VISIBLE|WS_CHILD|WS_GROUP,
                          5, is, 18, 18, hprelev, NULL, hInst, NULL&#41;;
           hbtsel&#91;js&#93; = CreateWindowEx&#40;WS_EX_CLIENTEDGE,
			             "Button", "",
                          WS_VISIBLE|WS_CHILD|WS_GROUP|BS_PUSHBUTTON,
                          25,is,18,18, hprelev, NULL, hInst, NULL&#41;;
           SendMessage &#40;hbtsel&#91;js&#93;, WM_SETFONT, &#40;UINT&#41;hFont2, 0&#41;;
		   SetWindowText &#40;hbtsel&#91;js&#93;, "S"&#41;;

           hdateprel&#91;js&#93; = CreateWindowEx&#40;WS_EX_LEFT|WS_EX_CLIENTEDGE,
			              "Edit", "",	WS_CHILD | WS_VISIBLE|ES_READONLY, 			
			              45, is, 70, 18,						
			              hprelev, &#40;HMENU&#41;1, hInst, NULL&#41;;
           SendMessage &#40;hdateprel&#91;js&#93;, WM_SETFONT, &#40;UINT&#41;hFont2, 0&#41;;

           hmontprel&#91;js&#93; = CreateWindowEx&#40;WS_EX_LEFT|WS_EX_CLIENTEDGE,
			              "Edit", "",	WS_CHILD | WS_VISIBLE, 			
			              125, is, 60, 18,						
			              hprelev, &#40;HMENU&#41;1, hInst, NULL&#41;;
           SendMessage &#40;hmontprel&#91;js&#93;, WM_SETFONT, &#40;UINT&#41;hFont2, 0&#41;;
		 &#125;
J'ai bien essayé de coder un WM_SETFOCUS ou un KILLFOCUS, mais il y repond seulement en quittant la fenetre ???
Comment puis gerer le curseur ?
Merci.