Changeset 496 for trunk/src/comctl32/animate.c
- Timestamp:
- Aug 14, 1999, 6:13:16 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/comctl32/animate.c
r94 r496 1 /* $Id: animate.c,v 1. 3 1999-06-10 16:21:57 achimhaExp $ */1 /* $Id: animate.c,v 1.4 1999-08-14 16:13:09 cbratschi Exp $ */ 2 2 /* 3 3 * Animation control … … 34 34 hrsrc = FindResourceA (hInst, lpName, "AVI"); 35 35 if (!hrsrc) 36 36 return FALSE; 37 37 38 38 handle = LoadResource (hInst, hrsrc); 39 39 if (!handle) 40 40 return FALSE; 41 41 42 42 infoPtr->lpAvi = LockResource (handle); 43 43 if (!infoPtr->lpAvi) 44 44 return FALSE; 45 45 46 46 return TRUE; … … 54 54 55 55 infoPtr->hFile = 56 57 56 CreateFileA (lpName, GENERIC_READ, 0, NULL, OPEN_EXISTING, 57 FILE_ATTRIBUTE_NORMAL, 0); 58 58 if (!infoPtr->hFile) 59 59 return FALSE; 60 60 61 61 handle = 62 63 62 CreateFileMappingA (infoPtr->hFile, NULL, PAGE_READONLY | SEC_COMMIT, 63 0, 0, NULL); 64 64 if (!handle) { 65 66 67 65 CloseHandle (infoPtr->hFile); 66 infoPtr->hFile = 0; 67 return FALSE; 68 68 } 69 69 70 70 infoPtr->lpAvi = MapViewOfFile (handle, FILE_MAP_READ, 0, 0, 0); 71 71 if (!infoPtr->lpAvi) { 72 73 74 72 CloseHandle (infoPtr->hFile); 73 infoPtr->hFile = 0; 74 return FALSE; 75 75 } 76 76 … … 83 83 { 84 84 if (infoPtr->hFile) { 85 86 87 85 UnmapViewOfFile (infoPtr->lpAvi); 86 CloseHandle (infoPtr->hFile); 87 infoPtr->lpAvi = NULL; 88 88 } 89 89 else { 90 91 90 GlobalFree ((HGLOBAL)infoPtr->lpAvi); 91 infoPtr->lpAvi = NULL; 92 92 } 93 93 } … … 111 111 112 112 if (!lParam) { 113 // 114 115 } 116 113 // TRACE (animate, "closing avi!\n"); 114 return TRUE; 115 } 116 117 117 if (HIWORD(lParam)) { 118 // 119 120 121 122 // 123 124 125 126 // 127 128 // 129 130 131 // 132 133 134 118 // FIXME (animate, "(\"%s\") empty stub!\n", (LPSTR)lParam); 119 120 if (ANIMATE_LoadResA (infoPtr, hInstance, (LPSTR)lParam)) { 121 122 // FIXME (animate, "AVI resource found!\n"); 123 124 } 125 else { 126 // FIXME (animate, "No AVI resource found!\n"); 127 if (ANIMATE_LoadFileA (infoPtr, (LPSTR)lParam)) { 128 // FIXME (animate, "AVI file found!\n"); 129 } 130 else { 131 // FIXME (animate, "No AVI file found!\n"); 132 return FALSE; 133 } 134 } 135 135 } 136 136 else { 137 // 138 139 140 141 // 142 143 144 // 145 146 137 // FIXME (animate, "(%u) empty stub!\n", (WORD)LOWORD(lParam)); 138 139 if (ANIMATE_LoadResA (infoPtr, hInstance, 140 MAKEINTRESOURCEA((INT)lParam))) { 141 // FIXME (animate, "AVI resource found!\n"); 142 } 143 else { 144 // FIXME (animate, "No AVI resource found!\n"); 145 return FALSE; 146 } 147 147 } 148 148 … … 167 167 /* nothing opened */ 168 168 if (...) 169 169 return FALSE; 170 170 #endif 171 171 172 172 if (nRepeat == -1) { 173 173 174 // 175 // 174 // FIXME (animate, "(loop from=%d to=%d) empty stub!\n", 175 // nFrom, nTo); 176 176 177 177 } 178 178 else { 179 179 180 // 181 // 180 // FIXME (animate, "(repeat=%d from=%d to=%d) empty stub!\n", 181 // nRepeat, nFrom, nTo); 182 182 183 183 } … … 196 196 /* nothing opened */ 197 197 if (...) 198 198 return FALSE; 199 199 #endif 200 200 201 201 return TRUE; 202 202 } … … 212 212 infoPtr = (ANIMATE_INFO *)COMCTL32_Alloc (sizeof(ANIMATE_INFO)); 213 213 if (!infoPtr) { 214 // 215 214 // ERR (animate, "could not allocate info memory!\n"); 215 return 0; 216 216 } 217 217 … … 262 262 263 263 264 LRESULT WINAPI264 static LRESULT WINAPI 265 265 ANIMATE_WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) 266 266 { 267 267 switch (uMsg) 268 268 { 269 270 271 272 /* 273 /* 269 case ACM_OPENA: 270 return ANIMATE_OpenA (hwnd, wParam, lParam); 271 272 /* case ACM_OPEN32W: */ 273 /* return ANIMATE_Open32W (hwnd, wParam, lParam); */ 274 274 275 275 case ACM_PLAY: 276 276 return ANIMATE_Play (hwnd, wParam, lParam); 277 277 278 279 280 281 282 283 284 285 286 287 288 /* 289 /* 290 291 /* 292 /* 293 /* 294 /* 295 /* 296 /* 297 298 299 // 300 // 301 // 302 278 case ACM_STOP: 279 return ANIMATE_Stop (hwnd, wParam, lParam); 280 281 282 case WM_CREATE: 283 return ANIMATE_Create (hwnd, wParam, lParam); 284 285 case WM_DESTROY: 286 return ANIMATE_Destroy (hwnd, wParam, lParam); 287 288 /* case WM_ERASEBKGND: */ 289 /* return ANIMATE_EraseBackground (hwnd, wParam, lParam); */ 290 291 /* case WM_NCCREATE: */ 292 /* case WM_NCHITTEST: */ 293 /* case WM_PAINT: */ 294 /* case WM_SIZE: */ 295 /* case WM_STYLECHANGED: */ 296 /* case WM_TIMER: */ 297 298 default: 299 // if (uMsg >= WM_USER) 300 // ERR (animate, "unknown msg %04x wp=%08x lp=%08lx\n", 301 // uMsg, wParam, lParam); 302 return DefWindowProcA (hwnd, uMsg, wParam, lParam); 303 303 } 304 304 return 0; … … 321 321 wndClass.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1); 322 322 wndClass.lpszClassName = ANIMATE_CLASSA; 323 323 324 324 RegisterClassA (&wndClass); 325 325 } … … 330 330 { 331 331 if (GlobalFindAtomA (ANIMATE_CLASSA)) 332 333 } 334 332 UnregisterClassA (ANIMATE_CLASSA, (HINSTANCE)NULL); 333 } 334
Note:
See TracChangeset
for help on using the changeset viewer.