1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| case IDM_OPEN:
*** choix du Fichier à ouvrir
ZeroMemory(&ofn, sizeof(OPENFILENAME));
*cheminfile=0x0;
ofn.lStructSize = sizeof(OPENFILENAME);
ofn.hwndOwner = winmainkey;
ofn.lpstrFile = cheminfile;
ofn.nMaxFile = Tailchemin;
ofn.lpstrFilter = "Tous les fichiers (*.*)\0*.*\0\0";
ofn.nFilterIndex = 1;
ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST | OFN_HIDEREADONLY;
Messages("1", "je passe", XOK); // pas de pb jusqu’ici !!! **************
if (GetOpenFileName(&ofn)==false) break;
Messages("2", "je passe", XOK); // pb si fichier > 93 Ko ????????? *************
keyfile = CreateFile(cheminfile, GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_ARCHIVE, NULL);
sizebyte=GetFileSize(keyfile, NULL);
ReadFile(keyfile, Bloc, nbbytetoread, &nbbyteread, NULL);
SendMessage(winmainkey, WM_PAINT, 0, 0);
break;
case IDM_CLOSE:
CloseHandle(keyfile);
SendMessage(winmainkey, WM_PAINT, 0, 0);
break; |
Partager