ReactOS 0.4.16-dev-853-g88d9285
shimgvw.c
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS Picture and Fax Viewer
3 * LICENSE: GPL-2.0 (https://spdx.org/licenses/GPL-2.0)
4 * PURPOSE: Image file browsing and manipulation
5 * COPYRIGHT: Copyright Dmitry Chapyshev (dmitry@reactos.org)
6 * Copyright 2018-2023 Katayama Hirofumi MZ (katayama.hirofumi.mz@gmail.com)
7 * Copyright 2025 Whindmar Saksit <whindsaks@proton.me>
8 */
9
10#include "shimgvw.h"
11#include <windowsx.h>
12#include <commctrl.h>
13#include <commdlg.h>
14#include <shlobj.h>
15#include <shellapi.h>
16
19
20/* Toolbar image size */
21#define TB_IMAGE_WIDTH 16
22#define TB_IMAGE_HEIGHT 16
23
24/* Slide show timer */
25#define SLIDESHOW_TIMER_ID 0xFACE
26#define SLIDESHOW_TIMER_INTERVAL 5000 /* 5 seconds */
27#define HIDECURSOR_TIMER_ID 0xBABE
28#define HIDECURSOR_TIMER_TIMEOUT 3000
29
37
38static const UINT s_ZoomSteps[] =
39{
40 5, 10, 25, 50, 100, 200, 300, 500, 1000, 2000, 4000
41};
42
43#define MIN_ZOOM s_ZoomSteps[0]
44#define MAX_ZOOM s_ZoomSteps[_countof(s_ZoomSteps) - 1]
45
46 /* iBitmap, idCommand, fsState, fsStyle, bReserved[2], dwData, iString */
47#define DEFINE_BTN_INFO(_name) \
48 { TBICON_##_name, IDC_##_name, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0 }
49
50#define DEFINE_BTN_SEPARATOR \
51 { -1, 0, TBSTATE_ENABLED, BTNS_SEP, {0}, 0, 0 }
52
53/* ToolBar Buttons */
54static const TBBUTTON s_Buttons[] =
55{
56 DEFINE_BTN_INFO(PREV_PIC),
57 DEFINE_BTN_INFO(NEXT_PIC),
59 DEFINE_BTN_INFO(BEST_FIT),
60 DEFINE_BTN_INFO(REAL_SIZE),
63 DEFINE_BTN_INFO(ZOOM_IN),
64 DEFINE_BTN_INFO(ZOOM_OUT),
66 DEFINE_BTN_INFO(ROT_CLOCKW),
67 DEFINE_BTN_INFO(ROT_COUNCW),
69 DEFINE_BTN_INFO(ROT_CWSAVE),
70 DEFINE_BTN_INFO(ROT_CCWSAVE),
73 DEFINE_BTN_INFO(PRINT),
74 DEFINE_BTN_INFO(SAVEAS),
77 DEFINE_BTN_INFO(HELP_TOC)
78};
79
80/* ToolBar Button configuration */
81typedef struct
82{
83 DWORD idb; /* Index to bitmap */
84 DWORD ids; /* Index to tooltip */
86
87#define DEFINE_BTN_CONFIG(_name) { IDB_##_name, IDS_TOOLTIP_##_name }
88
90{
91 DEFINE_BTN_CONFIG(PREV_PIC),
92 DEFINE_BTN_CONFIG(NEXT_PIC),
93 DEFINE_BTN_CONFIG(BEST_FIT),
94 DEFINE_BTN_CONFIG(REAL_SIZE),
96 DEFINE_BTN_CONFIG(ZOOM_IN),
97 DEFINE_BTN_CONFIG(ZOOM_OUT),
98 DEFINE_BTN_CONFIG(ROT_CLOCKW),
99 DEFINE_BTN_CONFIG(ROT_COUNCW),
100 DEFINE_BTN_CONFIG(ROT_CWSAVE),
101 DEFINE_BTN_CONFIG(ROT_CCWSAVE),
103 DEFINE_BTN_CONFIG(PRINT),
104 DEFINE_BTN_CONFIG(SAVEAS),
106 DEFINE_BTN_CONFIG(HELP_TOC),
107};
108
109typedef struct tagPREVIEW_DATA
110{
115 ANIME m_Anime; /* Animation */
124
126
127static inline PPREVIEW_DATA
129{
131}
132
133static inline BOOL
135{
136 return hwnd == g_hMainWnd;
137}
138
139static VOID
141{
143 {
146 if (pData->m_nTimerInterval)
147 SetTimer(hwnd, SLIDESHOW_TIMER_ID, pData->m_nTimerInterval, NULL);
148 }
149}
150
151static VOID
153{
154 BOOL IsFullscreen = !Preview_IsMainWnd(pData->m_hwnd);
155 enum { mintime = 1000, maxtime = SLIDESHOW_TIMER_INTERVAL * 3, step = 1000 };
156 UINT interval = pData->m_nTimerInterval ? pData->m_nTimerInterval : SLIDESHOW_TIMER_INTERVAL;
157 if (IsFullscreen)
158 {
159 interval = bSlower ? min(interval + step, maxtime) : max(interval - step, mintime);
160 if (pData->m_nTimerInterval != interval)
161 {
162 pData->m_nTimerInterval = interval;
164 }
165 }
166}
167
168static VOID
170{
171 HWND hwnd = pData->m_hwndZoom;
172 RECT rcClient;
173 UINT ImageWidth, ImageHeight, ZoomedWidth, ZoomedHeight;
174 SCROLLINFO si;
175 BOOL bShowHorz, bShowVert;
176
177 if (bResetPos)
178 pData->m_xScrollOffset = pData->m_yScrollOffset = 0;
179
180 if (!g_pImage)
181 {
184 return;
185 }
186
187 GdipGetImageWidth(g_pImage, &ImageWidth);
188 GdipGetImageHeight(g_pImage, &ImageHeight);
189
190 ZoomedWidth = (ImageWidth * pData->m_nZoomPercents) / 100;
191 ZoomedHeight = (ImageHeight * pData->m_nZoomPercents) / 100;
192
193 GetClientRect(hwnd, &rcClient);
194
195 bShowHorz = (rcClient.right < ZoomedWidth);
196 bShowVert = (rcClient.bottom < ZoomedHeight);
197 ShowScrollBar(hwnd, SB_HORZ, bShowHorz);
198 ShowScrollBar(hwnd, SB_VERT, bShowVert);
199
200 GetClientRect(hwnd, &rcClient);
201
202 ZeroMemory(&si, sizeof(si));
203 si.cbSize = sizeof(si);
204 si.fMask = SIF_ALL;
205
206 if (bShowHorz)
207 {
209 si.nPage = rcClient.right;
210 si.nMin = 0;
211 si.nMax = ZoomedWidth;
212 si.nPos = (ZoomedWidth - rcClient.right) / 2 + pData->m_xScrollOffset;
213 si.nPos = max(min(si.nPos, si.nMax - (INT)si.nPage), si.nMin);
215 pData->m_xScrollOffset = si.nPos - (ZoomedWidth - rcClient.right) / 2;
216 }
217 else
218 {
219 pData->m_xScrollOffset = 0;
220 }
221
222 if (bShowVert)
223 {
225 si.nPage = rcClient.bottom;
226 si.nMin = 0;
227 si.nMax = ZoomedHeight;
228 si.nPos = (ZoomedHeight - rcClient.bottom) / 2 + pData->m_yScrollOffset;
229 si.nPos = max(min(si.nPos, si.nMax - (INT)si.nPage), si.nMin);
231 pData->m_yScrollOffset = si.nPos - (ZoomedHeight - rcClient.bottom) / 2;
232 }
233 else
234 {
235 pData->m_yScrollOffset = 0;
236 }
237
239}
240
241static VOID
242Preview_UpdateZoom(PPREVIEW_DATA pData, UINT NewZoom, BOOL bEnableBestFit, BOOL bEnableRealSize)
243{
244 BOOL bEnableZoomIn, bEnableZoomOut;
245 HWND hToolBar = pData->m_hwndToolBar;
246
247 pData->m_nZoomPercents = NewZoom;
248
249 /* Check if a zoom button of the toolbar must be grayed */
250 bEnableZoomIn = (NewZoom < MAX_ZOOM);
251 bEnableZoomOut = (NewZoom > MIN_ZOOM);
252
253 /* Update toolbar buttons */
258
259 /* Redraw the display window */
260 InvalidateRect(pData->m_hwndZoom, NULL, TRUE);
261
262 /* Restart timer if necessary */
264
265 /* Update scroll info */
267}
268
269static VOID
271{
272 UINT i, NewZoom;
273
274 if (g_pImage == NULL)
275 return;
276
277 if (bZoomIn) /* zoom in */
278 {
279 /* find next step */
280 for (i = 0; i < _countof(s_ZoomSteps); ++i)
281 {
282 if (pData->m_nZoomPercents < s_ZoomSteps[i])
283 break;
284 }
285 NewZoom = ((i >= _countof(s_ZoomSteps)) ? MAX_ZOOM : s_ZoomSteps[i]);
286 }
287 else /* zoom out */
288 {
289 /* find previous step */
290 for (i = _countof(s_ZoomSteps); i > 0; )
291 {
292 --i;
293 if (s_ZoomSteps[i] < pData->m_nZoomPercents)
294 break;
295 }
296 NewZoom = ((i < 0) ? MIN_ZOOM : s_ZoomSteps[i]);
297 }
298
299 /* Update toolbar and refresh screen */
300 Preview_UpdateZoom(pData, NewZoom, TRUE, TRUE);
301}
302
303static VOID
305{
306 RECT Rect;
307 UINT ImageWidth, ImageHeight, NewZoom;
308
309 if (g_pImage == NULL)
310 return;
311
312 /* get disp window size and image size */
313 GetClientRect(pData->m_hwndZoom, &Rect);
314 GdipGetImageWidth(g_pImage, &ImageWidth);
315 GdipGetImageHeight(g_pImage, &ImageHeight);
316
317 /* compare two aspect rates. same as
318 (ImageHeight / ImageWidth < Rect.bottom / Rect.right) in real */
319 if (ImageHeight * Rect.right < Rect.bottom * ImageWidth)
320 {
321 if (Rect.right < ImageWidth)
322 {
323 /* it's large, shrink it */
324 NewZoom = (Rect.right * 100) / ImageWidth;
325 }
326 else
327 {
328 /* it's small. show as original size */
329 NewZoom = 100;
330 }
331 }
332 else
333 {
334 if (Rect.bottom < ImageHeight)
335 {
336 /* it's large, shrink it */
337 NewZoom = (Rect.bottom * 100) / ImageHeight;
338 }
339 else
340 {
341 /* it's small. show as original size */
342 NewZoom = 100;
343 }
344 }
345
347}
348
349static VOID
351{
352 WCHAR szText[MAX_PATH + 100];
353 LPWSTR pchFileTitle;
354
355 LoadStringW(g_hInstance, IDS_APPTITLE, szText, _countof(szText));
356
357 pchFileTitle = PathFindFileNameW(FileName);
358 if (pchFileTitle && *pchFileTitle)
359 {
360 StringCchCatW(szText, _countof(szText), L" - ");
361 StringCchCatW(szText, _countof(szText), pchFileTitle);
362 }
363
364 SetWindowTextW(pData->m_hwnd, szText);
365}
366
367static VOID
369{
370 Anime_FreeInfo(&pData->m_Anime);
371
372 if (g_pImage)
373 {
375 g_pImage = NULL;
376 }
377
378 pData->m_szFile[0] = UNICODE_NULL;
379}
380
381static VOID
383{
384 HRESULT hr;
386 InvalidateRect(pData->m_hwnd, NULL, FALSE); /* Schedule redraw in case we change to "No preview" */
387
388 hr = LoadImageFromPath(szOpenFileName, &g_pImage);
389 if (FAILED(hr))
390 {
391 DPRINT1("GdipLoadImageFromStream() failed, %d\n", hr);
394 return;
395 }
396
397 Anime_LoadInfo(&pData->m_Anime);
398
399 GetFullPathNameW(szOpenFileName, _countof(pData->m_szFile), pData->m_szFile, NULL);
401
402 /* Reset zoom and redraw display */
404
405 Preview_UpdateTitle(pData, szOpenFileName);
406
407 ++g_ImageId;
410}
411
412static VOID
414{
415 Preview_pLoadImage(pData, (pNode ? pNode->FileName : NULL));
416}
417
418static BOOL
420{
421 ImageCodecInfo *codecInfo;
422 GUID rawFormat;
423 UINT j, num, nFilterIndex, size;
424 BOOL ret = FALSE;
425
426 if (g_pImage == NULL)
427 return FALSE;
428
430 codecInfo = QuickAlloc(size, FALSE);
431 if (!codecInfo)
432 {
433 DPRINT1("QuickAlloc() failed in pSaveImage()\n");
434 return FALSE;
435 }
436 GdipGetImageEncoders(num, size, codecInfo);
437
438 GdipGetImageRawFormat(g_pImage, &rawFormat);
439 if (IsEqualGUID(&rawFormat, &ImageFormatMemoryBMP))
440 rawFormat = ImageFormatBMP;
441
442 nFilterIndex = 0;
443 for (j = 0; j < num; ++j)
444 {
445 if (IsEqualGUID(&rawFormat, &codecInfo[j].FormatID))
446 {
447 nFilterIndex = j + 1;
448 break;
449 }
450 }
451
452 Anime_Pause(&pData->m_Anime);
453
454 ret = (nFilterIndex > 0) &&
455 (GdipSaveImageToFile(g_pImage, pszFile, &codecInfo[nFilterIndex - 1].Clsid, NULL) == Ok);
456 if (!ret)
457 DPRINT1("GdipSaveImageToFile() failed\n");
458
459 Anime_Start(&pData->m_Anime, 0);
460
461 QuickFree(codecInfo);
462 return ret;
463}
464
465static VOID
467{
469 ImageCodecInfo *codecInfo;
470 WCHAR szSaveFileName[MAX_PATH];
471 WCHAR *szFilterMask;
472 GUID rawFormat;
473 UINT num, size, j;
474 size_t sizeRemain;
475 WCHAR *c;
476 HWND hwnd = pData->m_hwnd;
477
478 if (g_pImage == NULL)
479 return;
480
482 codecInfo = QuickAlloc(size, FALSE);
483 if (!codecInfo)
484 {
485 DPRINT1("QuickAlloc() failed in pSaveImageAs()\n");
486 return;
487 }
488
489 GdipGetImageEncoders(num, size, codecInfo);
490
491 GdipGetImageRawFormat(g_pImage, &rawFormat);
492 if (IsEqualGUID(&rawFormat, &ImageFormatMemoryBMP))
493 rawFormat = ImageFormatBMP;
494
495 sizeRemain = 0;
496 for (j = 0; j < num; ++j)
497 {
498 // Every pair needs space for the Description, twice the Extensions, 1 char for the space, 2 for the braces and 2 for the NULL terminators.
499 sizeRemain = sizeRemain + (((wcslen(codecInfo[j].FormatDescription) + (wcslen(codecInfo[j].FilenameExtension) * 2) + 5) * sizeof(WCHAR)));
500 }
501
502 /* Add two more chars for the last terminator */
503 sizeRemain += (sizeof(WCHAR) * 2);
504
505 szFilterMask = QuickAlloc(sizeRemain, FALSE);
506 if (!szFilterMask)
507 {
508 DPRINT1("cannot allocate memory for filter mask in pSaveImageAs()");
509 QuickFree(codecInfo);
510 return;
511 }
512
513 ZeroMemory(szSaveFileName, sizeof(szSaveFileName));
514 ZeroMemory(szFilterMask, sizeRemain);
515 ZeroMemory(&sfn, sizeof(sfn));
516 sfn.lStructSize = sizeof(sfn);
518 sfn.lpstrFile = szSaveFileName;
519 sfn.lpstrFilter = szFilterMask;
520 sfn.nMaxFile = _countof(szSaveFileName);
522 sfn.lpstrDefExt = L"png";
523
524 c = szFilterMask;
525
526 for (j = 0; j < num; ++j)
527 {
528 StringCbPrintfExW(c, sizeRemain, &c, &sizeRemain, 0, L"%ls (%ls)", codecInfo[j].FormatDescription, codecInfo[j].FilenameExtension);
529
530 /* Skip the NULL character */
531 c++;
532 sizeRemain -= sizeof(*c);
533
534 StringCbPrintfExW(c, sizeRemain, &c, &sizeRemain, 0, L"%ls", codecInfo[j].FilenameExtension);
535
536 /* Skip the NULL character */
537 c++;
538 sizeRemain -= sizeof(*c);
539
540 if (IsEqualGUID(&rawFormat, &codecInfo[j].FormatID))
541 {
542 sfn.nFilterIndex = j + 1;
543 }
544 }
545
547 {
548 Anime_Pause(&pData->m_Anime);
549
550 if (GdipSaveImageToFile(g_pImage, szSaveFileName, &codecInfo[sfn.nFilterIndex - 1].Clsid, NULL) != Ok)
551 {
552 DPRINT1("GdipSaveImageToFile() failed\n");
553 }
554
555 Anime_Start(&pData->m_Anime, 0);
556 }
557
558 QuickFree(szFilterMask);
559 QuickFree(codecInfo);
560}
561
562static VOID
564{
565 ShellExecuteVerb(g_hMainWnd, L"print", pData->m_szFile, FALSE);
566}
567
568static VOID
570{
571 BOOL bEnable = (g_pImage != NULL);
573 // These will be validated and enabled later by EnableCommandIfVerbExists
576}
577
578static VOID
580{
581 if (!Preview_IsMainWnd(pData->m_hwnd))
583
585}
586
587static SHIMGVW_FILENODE*
589{
590 HANDLE hFindHandle;
591 WCHAR *extension, *buffer;
592 WCHAR szSearchPath[MAX_PATH];
593 WCHAR szSearchMask[MAX_PATH];
594 WCHAR szFileTypes[MAX_PATH];
595 WIN32_FIND_DATAW findData;
596 SHIMGVW_FILENODE *currentNode = NULL;
598 SHIMGVW_FILENODE *conductor = NULL;
599 ImageCodecInfo *codecInfo;
600 UINT num = 0, size = 0, ExtraSize = 0;
601 UINT j;
602
603 const PCWSTR ExtraExtensions = GetExtraExtensionsGdipList();
604 const UINT ExtraCount = ExtraExtensions[0] ? 1 : 0;
605 if (ExtraCount)
606 ExtraSize += sizeof(*codecInfo) + (wcslen(ExtraExtensions) + 1) * sizeof(WCHAR);
607
608 StringCbCopyW(szSearchPath, sizeof(szSearchPath), szFirstFile);
609 PathRemoveFileSpecW(szSearchPath);
610
612 codecInfo = QuickAlloc(size + ExtraSize, FALSE);
613 if (!codecInfo)
614 {
615 DPRINT1("QuickAlloc() failed in pLoadFileList()\n");
616 return NULL;
617 }
618
619 GdipGetImageDecoders(num, size, codecInfo);
620 buffer = (PWSTR)((UINT_PTR)codecInfo + size + (sizeof(*codecInfo) * ExtraCount));
621 if (ExtraCount)
622 codecInfo[num].FilenameExtension = wcscpy(buffer, ExtraExtensions);
623 num += ExtraCount;
624
626 if (!root)
627 {
628 DPRINT1("QuickAlloc() failed in pLoadFileList()\n");
629 QuickFree(codecInfo);
630 return NULL;
631 }
632
633 conductor = root;
634
635 for (j = 0; j < num; ++j)
636 {
637 // FIXME: Parse each FilenameExtension list to bypass szFileTypes limit
638 StringCbCopyW(szFileTypes, sizeof(szFileTypes), codecInfo[j].FilenameExtension);
639
640 extension = wcstok(szFileTypes, L";");
641 while (extension != NULL)
642 {
643 PathCombineW(szSearchMask, szSearchPath, extension);
644
645 hFindHandle = FindFirstFileW(szSearchMask, &findData);
646 if (hFindHandle != INVALID_HANDLE_VALUE)
647 {
648 do
649 {
650 PathCombineW(conductor->FileName, szSearchPath, findData.cFileName);
651
652 // compare the name of the requested file with the one currently found.
653 // if the name matches, the current node is returned by the function.
654 if (_wcsicmp(szFirstFile, conductor->FileName) == 0)
655 {
656 currentNode = conductor;
657 }
658
659 conductor->Next = QuickAlloc(sizeof(SHIMGVW_FILENODE), FALSE);
660
661 // if QuickAlloc fails, make circular what we have and return it
662 if (!conductor->Next)
663 {
664 DPRINT1("QuickAlloc() failed in pLoadFileList()\n");
665
666 conductor->Next = root;
667 root->Prev = conductor;
668
669 FindClose(hFindHandle);
670 QuickFree(codecInfo);
671 return conductor;
672 }
673
674 conductor->Next->Prev = conductor;
675 conductor = conductor->Next;
676 }
677 while (FindNextFileW(hFindHandle, &findData) != 0);
678
679 FindClose(hFindHandle);
680 }
681
682 extension = wcstok(NULL, L";");
683 }
684 }
685
686 // we now have a node too much in the list. In case the requested file was not found,
687 // we use this node to store the name of it, otherwise we free it.
688 if (currentNode == NULL)
689 {
690 StringCchCopyW(conductor->FileName, MAX_PATH, szFirstFile);
691 currentNode = conductor;
692 }
693 else
694 {
695 conductor = conductor->Prev;
696 QuickFree(conductor->Next);
697 }
698
699 // link the last node with the first one to make the list circular
700 conductor->Next = root;
701 root->Prev = conductor;
702 conductor = currentNode;
703
704 QuickFree(codecInfo);
705
706 return conductor;
707}
708
709static VOID
711{
712 SHIMGVW_FILENODE *conductor;
713
714 if (!root)
715 return;
716
717 root->Prev->Next = NULL;
718 root->Prev = NULL;
719
720 while (root)
721 {
722 conductor = root;
723 root = conductor->Next;
724 QuickFree(conductor);
725 }
726}
727
729{
730 static const CHAR pattern[] =
731 "\x28\x00\x00\x00\x10\x00\x00\x00\x10\x00\x00\x00\x01\x00\x04\x00\x00\x00"
732 "\x00\x00\x80\x00\x00\x00\x23\x2E\x00\x00\x23\x2E\x00\x00\x10\x00\x00\x00"
733 "\x00\x00\x00\x00\x99\x99\x99\x00\xCC\xCC\xCC\x00\x00\x00\x00\x00\x00\x00"
734 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
735 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
736 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11\x11\x11\x11"
737 "\x00\x00\x00\x00\x11\x11\x11\x11\x00\x00\x00\x00\x11\x11\x11\x11\x00\x00"
738 "\x00\x00\x11\x11\x11\x11\x00\x00\x00\x00\x11\x11\x11\x11\x00\x00\x00\x00"
739 "\x11\x11\x11\x11\x00\x00\x00\x00\x11\x11\x11\x11\x00\x00\x00\x00\x11\x11"
740 "\x11\x11\x00\x00\x00\x00\x00\x00\x00\x00\x11\x11\x11\x11\x00\x00\x00\x00"
741 "\x11\x11\x11\x11\x00\x00\x00\x00\x11\x11\x11\x11\x00\x00\x00\x00\x11\x11"
742 "\x11\x11\x00\x00\x00\x00\x11\x11\x11\x11\x00\x00\x00\x00\x11\x11\x11\x11"
743 "\x00\x00\x00\x00\x11\x11\x11\x11\x00\x00\x00\x00\x11\x11\x11\x11";
744
746}
747
748static VOID
751 HDC hdc,
752 LPRECT prcPaint,
753 LPRECT prcClient)
754{
755 GpGraphics *graphics;
756 INT ZoomedWidth, ZoomedHeight;
757 RECT rect, rcClient = *prcClient;
758 HDC hdcMem;
759 HBRUSH hBrush;
760 HPEN hPen;
761 HGDIOBJ hbrOld, hbmOld, hPenOld;
762 UINT uFlags;
763 HBITMAP hbmMem;
764 SIZE paintSize = { prcPaint->right - prcPaint->left, prcPaint->bottom - prcPaint->top };
765 COLORREF color0, color1;
766 GpImageAttributes *imageAttributes;
767
768 /* We use a memory bitmap to reduce flickering */
770 hbmMem = CreateCompatibleBitmap(hdc, paintSize.cx, paintSize.cy);
771 hbmOld = SelectObject(hdcMem, hbmMem);
772
773 /* Choose colors */
774 if (Preview_IsMainWnd(pData->m_hwnd))
775 {
776 color0 = GetSysColor(COLOR_WINDOW);
778 }
779 else
780 {
781 color0 = RGB(0, 0, 0);
782 color1 = RGB(255, 255, 255);
783 }
784
785 hBrush = CreateSolidBrush(color0);
786 SetBkColor(hdcMem, color0);
787
788 hPen = CreatePen(PS_SOLID, 1, color1);
789 SetTextColor(hdcMem, color1);
790
791 /* Fill background */
792 SetRect(&rect, 0, 0, paintSize.cx, paintSize.cy);
793 FillRect(hdcMem, &rect, hBrush);
794
795 DeleteObject(hBrush);
796
797 if (g_pImage == NULL)
798 {
799 WCHAR szText[128];
801
803 OffsetRect(&rcClient, -prcPaint->left, -prcPaint->top);
804 DrawTextW(hdcMem, szText, -1, &rcClient, DT_SINGLELINE | DT_CENTER | DT_VCENTER |
806 }
807 else
808 {
809 UINT ImageWidth, ImageHeight;
810
811 GdipGetImageWidth(g_pImage, &ImageWidth);
812 GdipGetImageHeight(g_pImage, &ImageHeight);
813
814 ZoomedWidth = (ImageWidth * pData->m_nZoomPercents) / 100;
815 ZoomedHeight = (ImageHeight * pData->m_nZoomPercents) / 100;
816
817 GdipCreateFromHDC(hdcMem, &graphics);
818 if (!graphics)
819 {
820 DPRINT1("error: GdipCreateFromHDC\n");
821 return;
822 }
823
825
826 if (pData->m_nZoomPercents % 100 == 0)
827 {
830 }
831 else
832 {
835 }
836
837 rect.left = (rcClient.right - ZoomedWidth ) / 2;
838 rect.top = (rcClient.bottom - ZoomedHeight) / 2;
839 rect.right = rect.left + ZoomedWidth;
840 rect.bottom = rect.top + ZoomedHeight;
842 -prcPaint->left - pData->m_xScrollOffset,
843 -prcPaint->top - pData->m_yScrollOffset);
844
845 InflateRect(&rect, +1, +1); /* Add Rectangle() pen width */
846
847 /* Draw a rectangle. Fill by checker board if necessary */
850 else
852 hPenOld = SelectObject(hdcMem, hPen);
853 Rectangle(hdcMem, rect.left, rect.top, rect.right, rect.bottom);
856
857 InflateRect(&rect, -1, -1); /* Subtract Rectangle() pen width */
858
859 /* Image attributes are required to draw image correctly */
860 GdipCreateImageAttributes(&imageAttributes);
862 GetBkColor(hdcMem) | 0xFF000000, TRUE);
863
864 /* Draw image. -0.5f is used for interpolation */
866 rect.left, rect.top,
867 rect.right - rect.left, rect.bottom - rect.top,
868 -0.5f, -0.5f, ImageWidth, ImageHeight,
869 UnitPixel, imageAttributes, NULL, NULL);
870
871 GdipDisposeImageAttributes(imageAttributes);
872 GdipDeleteGraphics(graphics);
873 }
874
875 BitBlt(hdc, prcPaint->left, prcPaint->top, paintSize.cx, paintSize.cy, hdcMem, 0, 0, SRCCOPY);
878}
879
880static VOID
882{
883 PAINTSTRUCT ps;
884 HDC hDC;
885 RECT rcClient;
886
887 hDC = BeginPaint(hwnd, &ps);
888 if (hDC)
889 {
890 GetClientRect(hwnd, &rcClient);
891 ZoomWnd_OnDraw(pData, hDC, &ps.rcPaint, &rcClient);
892 EndPaint(hwnd, &ps);
893 }
894}
895
896static VOID
898{
902 g_Settings.Width = 520;
903 g_Settings.Height = 400;
904}
905
906static BOOL
908{
909 HKEY hKey;
911 LSTATUS nError;
912
913 nError = RegOpenKeyExW(HKEY_CURRENT_USER, L"Software\\ReactOS\\shimgvw", 0, KEY_READ, &hKey);
914 if (nError != ERROR_SUCCESS)
915 return FALSE;
916
917 dwSize = sizeof(g_Settings);
918 nError = RegQueryValueExW(hKey, L"Settings", NULL, NULL, (LPBYTE)&g_Settings, &dwSize);
920
921 return ((nError == ERROR_SUCCESS) && (dwSize == sizeof(g_Settings)));
922}
923
924static VOID
926{
927 HKEY hKey;
928 LSTATUS nError;
929
930 nError = RegCreateKeyExW(HKEY_CURRENT_USER, L"Software\\ReactOS\\shimgvw",
931 0, NULL, 0, KEY_WRITE, NULL, &hKey, NULL);
932 if (nError != ERROR_SUCCESS)
933 return;
934
935 RegSetValueExW(hKey, L"Settings", 0, REG_BINARY, (LPBYTE)&g_Settings, sizeof(g_Settings));
937}
938
939static BOOL
941{
942 HWND hwndToolBar;
943 HIMAGELIST hImageList, hOldImageList;
945
946 if (!Preview_IsMainWnd(pData->m_hwnd))
947 return TRUE; /* FIXME */
948
949 style |= CCS_BOTTOM;
950 hwndToolBar = CreateWindowExW(0, TOOLBARCLASSNAMEW, NULL, style,
951 0, 0, 0, 0, pData->m_hwnd, NULL, g_hInstance, NULL);
952 if (!hwndToolBar)
953 return FALSE;
954
955 pData->m_hwndToolBar = hwndToolBar;
956
957 SendMessageW(hwndToolBar, TB_BUTTONSTRUCTSIZE, sizeof(s_Buttons[0]), 0);
959
961 if (hImageList == NULL)
962 return FALSE;
963
964 for (UINT n = 0; n < _countof(s_ButtonConfig); n++)
965 {
967 ImageList_AddMasked(hImageList, hBitmap, RGB(255, 255, 255));
969 }
970
971 hOldImageList = (HIMAGELIST)SendMessageW(hwndToolBar, TB_SETIMAGELIST, 0, (LPARAM)hImageList);
972 ImageList_Destroy(hOldImageList);
973
975
976 return TRUE;
977}
978
979static VOID
981{
983 return;
984
989}
990
991static VOID
993{
995}
996
997static VOID
999{
1000 pData->m_bHideCursor = FALSE;
1001 KillTimer(pData->m_hwndZoom, HIDECURSOR_TIMER_ID);
1002}
1003
1004static VOID
1006{
1008 HWND hParent = GetParent(hwnd);
1009 if ((uMsg == WM_LBUTTONDOWN) || (uMsg == WM_RBUTTONDOWN))
1010 {
1011 if (!Preview_IsMainWnd(hParent))
1012 Preview_EndSlideShow(hParent);
1013 return;
1014 }
1015
1017 pData->m_nMouseDownMsg = uMsg;
1018 pData->m_ptOrigin.x = GET_X_LPARAM(lParam);
1019 pData->m_ptOrigin.y = GET_Y_LPARAM(lParam);
1022}
1023
1024static VOID
1026{
1029
1030 if (!Preview_IsMainWnd(pData->m_hwnd))
1031 {
1033 if (!pData->m_nMouseDownMsg)
1035 }
1036
1037 if (pData->m_nMouseDownMsg == WM_MBUTTONDOWN)
1038 {
1039 INT x = GetScrollPos(hwnd, SB_HORZ) - (pt.x - pData->m_ptOrigin.x);
1040 INT y = GetScrollPos(hwnd, SB_VERT) - (pt.y - pData->m_ptOrigin.y);
1043 pData->m_ptOrigin = pt;
1044 }
1045}
1046
1047static BOOL
1049{
1051 if (pData->m_nMouseDownMsg == WM_MBUTTONDOWN)
1052 {
1054 return TRUE;
1055 }
1056
1057 if (pData->m_bHideCursor)
1058 {
1059 SetCursor(NULL); /* Hide cursor in fullscreen */
1060 return TRUE;
1061 }
1062 return FALSE;
1063}
1064
1065static VOID
1067{
1069 BOOL wasdrag = pData->m_nMouseDownMsg == WM_MBUTTONDOWN;
1070
1071 pData->m_nMouseDownMsg = 0;
1072 if (wasdrag)
1073 GenerateSetCursor(hwnd, uMsg); /* Reset to default cursor */
1075
1076 if (!Preview_IsMainWnd(pData->m_hwnd))
1078}
1079
1080static VOID
1082{
1083 UINT ImageWidth, ImageHeight, ZoomedWidth, ZoomedHeight;
1084 RECT rcClient;
1085 UINT nBar = (bVertical ? SB_VERT : SB_HORZ);
1086 SCROLLINFO si = { sizeof(si), SIF_ALL };
1087 GetScrollInfo(hwnd, nBar, &si);
1088
1089 if (!g_pImage)
1090 return;
1091
1092 if (bVertical)
1093 {
1095 return;
1096 }
1097 else
1098 {
1100 return;
1101 }
1102
1103 switch (LOWORD(wParam))
1104 {
1105 case SB_THUMBTRACK:
1106 case SB_THUMBPOSITION:
1107 si.nPos = (SHORT)HIWORD(wParam);
1108 break;
1109 case SB_LINELEFT:
1110 si.nPos -= 48;
1111 break;
1112 case SB_LINERIGHT:
1113 si.nPos += 48;
1114 break;
1115 case SB_PAGELEFT:
1116 si.nPos -= si.nPage;
1117 break;
1118 case SB_PAGERIGHT:
1119 si.nPos += si.nPage;
1120 break;
1121 }
1122
1123 si.fMask = SIF_POS;
1124 SetScrollInfo(hwnd, nBar, &si, TRUE);
1125 GetScrollInfo(hwnd, nBar, &si);
1126
1127 GetClientRect(hwnd, &rcClient);
1128
1129 if (bVertical)
1130 {
1131 GdipGetImageHeight(g_pImage, &ImageHeight);
1132 ZoomedHeight = (ImageHeight * pData->m_nZoomPercents) / 100;
1133 pData->m_yScrollOffset = si.nPos - (ZoomedHeight - rcClient.bottom) / 2;
1134 }
1135 else
1136 {
1137 GdipGetImageWidth(g_pImage, &ImageWidth);
1138 ZoomedWidth = (ImageWidth * pData->m_nZoomPercents) / 100;
1139 pData->m_xScrollOffset = si.nPos - (ZoomedWidth - rcClient.right) / 2;
1140 }
1141
1143}
1144
1145static VOID
1147{
1149 if (zDelta == 0)
1150 return;
1151
1152 if (GetKeyState(VK_CONTROL) < 0)
1153 {
1154 Preview_ZoomInOrOut(pData, zDelta > 0);
1155 }
1156 else if (GetKeyState(VK_SHIFT) < 0)
1157 {
1158 if (zDelta > 0)
1160 else
1162 }
1163 else
1164 {
1165 if (zDelta > 0)
1167 else
1169 }
1170}
1171
1174{
1176 switch (uMsg)
1177 {
1178 case WM_LBUTTONDOWN:
1179 case WM_MBUTTONDOWN:
1180 case WM_RBUTTONDOWN:
1181 {
1183 break;
1184 }
1185 case WM_MOUSEMOVE:
1186 {
1188 break;
1189 }
1190 case WM_SETCURSOR:
1191 {
1192 if (!ZoomWnd_OnSetCursor(hwnd, uMsg, wParam, lParam))
1193 return DefWindowProcW(hwnd, uMsg, wParam, lParam);
1194 }
1195 case WM_LBUTTONUP:
1196 case WM_MBUTTONUP:
1197 case WM_RBUTTONUP:
1198 {
1200 goto doDefault;
1201 }
1202 case WM_LBUTTONDBLCLK:
1203 {
1204 if (Preview_IsMainWnd(pData->m_hwnd))
1206 break;
1207 }
1208 case WM_PAINT:
1209 {
1211 break;
1212 }
1213 case WM_MOUSEWHEEL:
1214 {
1217 break;
1218 }
1219 case WM_CONTEXTMENU:
1220 if (Preview_IsMainWnd(pData->m_hwnd))
1222 break;
1223 case WM_HSCROLL:
1224 case WM_VSCROLL:
1226 break;
1227 case WM_TIMER:
1228 {
1230 {
1232 if (IsWindowVisible(hwnd))
1233 {
1234 pData->m_bHideCursor = TRUE;
1235 GenerateSetCursor(hwnd, uMsg);
1236 }
1237 }
1238 if (Anime_OnTimer(&pData->m_Anime, wParam))
1239 {
1241 }
1242 break;
1243 }
1244 default: doDefault:
1245 {
1246 return DefWindowProcW(hwnd, uMsg, wParam, lParam);
1247 }
1248 }
1249 return 0;
1250}
1251
1252static BOOL
1254{
1255 DWORD exstyle = 0;
1256 HWND hwndZoom;
1258 pData->m_hwnd = hwnd;
1260
1262
1263 if (g_hMainWnd == NULL)
1264 {
1265 g_hMainWnd = hwnd;
1266 exstyle |= WS_EX_CLIENTEDGE;
1267 }
1268 else if (g_hwndFullscreen == NULL)
1269 {
1271 }
1272 else
1273 {
1274 return FALSE;
1275 }
1276
1277 hwndZoom = CreateWindowExW(exstyle, WC_ZOOM, NULL, WS_CHILD | WS_VISIBLE,
1278 0, 0, 0, 0, hwnd, NULL, g_hInstance, NULL);
1279 if (!hwndZoom)
1280 {
1282 return FALSE;
1283 }
1284
1285 pData->m_hwndZoom = hwndZoom;
1287 Anime_SetTimerWnd(&pData->m_Anime, pData->m_hwndZoom);
1288
1290 {
1292 return FALSE;
1293 }
1294
1295 if (pCS && pCS->lpCreateParams)
1296 {
1298 WCHAR szFile[MAX_PATH];
1299
1300 /* Make sure the path has no quotes on it */
1301 StringCchCopyW(szFile, _countof(szFile), pszFileName);
1302 PathUnquoteSpacesW(szFile);
1303
1308 }
1309
1310 return TRUE;
1311}
1312
1313static VOID
1315{
1316 WINDOWPLACEMENT wp;
1317 RECT *prc;
1318
1320 return;
1321
1322 wp.length = sizeof(WINDOWPLACEMENT);
1324
1325 /* Remember window position and size */
1326 prc = &wp.rcNormalPosition;
1327 g_Settings.X = prc->left;
1328 g_Settings.Y = prc->top;
1332}
1333
1334static VOID
1336{
1337 RECT rc, rcClient;
1339 HWND hToolBar = pData->m_hwndToolBar;
1340 INT cx, cy;
1341
1342 /* We want 32-bit values. Don't use WM_SIZE lParam */
1343 GetClientRect(hwnd, &rcClient);
1344 cx = rcClient.right;
1345 cy = rcClient.bottom;
1346
1347 if (Preview_IsMainWnd(pData->m_hwnd))
1348 {
1350 GetWindowRect(hToolBar, &rc);
1351
1352 MoveWindow(pData->m_hwndZoom, 0, 0, cx, cy - (rc.bottom - rc.top), TRUE);
1353
1354 if (pData->m_nZoomPercents > 100)
1356 else if (!IsIconic(hwnd)) /* Is it not minimized? */
1358
1360 }
1361 else
1362 {
1363 MoveWindow(pData->m_hwndZoom, 0, 0, cx, cy, TRUE);
1364 }
1365}
1366
1367static VOID
1369{
1370 WCHAR szCurFile[MAX_PATH + 1], szNextFile[MAX_PATH];
1371 HWND hwnd = pData->m_hwnd;
1372 SHFILEOPSTRUCTW FileOp = { hwnd, FO_DELETE };
1373
1374 if (!pData->m_szFile[0])
1375 return;
1376
1377 /* FileOp.pFrom must be double-null-terminated */
1378 GetFullPathNameW(pData->m_szFile, _countof(szCurFile) - 1, szCurFile, NULL);
1379 szCurFile[_countof(szCurFile) - 2] = UNICODE_NULL; /* Avoid buffer overrun */
1380 szCurFile[lstrlenW(szCurFile) + 1] = UNICODE_NULL;
1381
1382 szNextFile[0] = UNICODE_NULL;
1383 if (g_pCurrentFile)
1384 {
1385 GetFullPathNameW(g_pCurrentFile->Next->FileName, _countof(szNextFile), szNextFile, NULL);
1386 szNextFile[_countof(szNextFile) - 1] = UNICODE_NULL; /* Avoid buffer overrun */
1387 }
1388
1389 /* Confirm file deletion and delete if allowed */
1390 FileOp.pFrom = szCurFile;
1391 FileOp.fFlags = FOF_ALLOWUNDO;
1392 if (SHFileOperationW(&FileOp) != 0)
1393 {
1394 DPRINT("Preview_Delete: SHFileOperationW() failed or canceled\n");
1395 return;
1396 }
1397
1398 /* Reload the file list and go next file */
1400 g_pCurrentFile = pBuildFileList(szNextFile);
1402}
1403
1404static VOID
1406{
1408 ShellExecuteVerb(pData->m_hwnd, L"edit", pData->m_szFile, TRUE);
1409}
1410
1411static VOID
1413{
1415 {
1417 WCHAR szTitle[256];
1420 0, 0, 0, 0, NULL, NULL, g_hInstance, NULL);
1421 }
1422
1424 {
1426 }
1427 else
1428 {
1430 pSlideData->m_nTimerInterval = StartTimer ? SLIDESHOW_TIMER_INTERVAL : 0;
1433 Preview_ResetZoom(pSlideData);
1435 PostMessage(pSlideData->m_hwndZoom, WM_MOUSEMOVE, 0, 0); /* Start hide cursor */
1436 }
1437}
1438
1439static inline VOID
1441{
1443}
1444
1445static VOID
1447{
1448 Preview_RestartTimer(pData->m_hwnd);
1449 if (g_pCurrentFile)
1450 {
1451 if (bNext)
1453 else
1458 }
1459}
1460
1461static VOID
1463{
1465
1466 switch (nCommandID)
1467 {
1468 case IDC_PREV_PIC:
1470 break;
1471
1472 case IDC_NEXT_PIC:
1474 break;
1475
1476 case IDC_BEST_FIT:
1478 break;
1479
1480 case IDC_REAL_SIZE:
1482 break;
1483
1484 case IDC_SLIDE_SHOW:
1486 break;
1487
1488 case IDC_ZOOM_IN:
1490 break;
1491
1492 case IDC_ZOOM_OUT:
1494 break;
1495
1496 case IDC_ENDSLIDESHOW:
1498 break;
1499
1502 break;
1503
1504 case IDC_INCTIMER:
1505 case IDC_DECTIMER:
1507 break;
1508
1509 default:
1510 break;
1511 }
1512
1513 if (!Preview_IsMainWnd(hwnd))
1514 return;
1515
1516 // The following commands are for main window only:
1517 switch (nCommandID)
1518 {
1519 case IDC_SAVEAS:
1521 break;
1522
1523 case IDC_PRINT:
1525 break;
1526
1527 case IDC_ROT_CLOCKW:
1528 if (g_pImage)
1529 {
1532 }
1533 break;
1534
1535 case IDC_ROT_COUNCW:
1536 if (g_pImage)
1537 {
1540 }
1541 break;
1542
1543 case IDC_ROT_CWSAVE:
1544 if (g_pImage)
1545 {
1547 Preview_pSaveImage(pData, pData->m_szFile);
1549 }
1550 break;
1551
1552 case IDC_ROT_CCWSAVE:
1553 if (g_pImage)
1554 {
1556 Preview_pSaveImage(pData, pData->m_szFile);
1558 }
1559 break;
1560
1561 case IDC_DELETE:
1565 break;
1566
1567 case IDC_MODIFY:
1569 break;
1570
1571 case IDC_HELP_TOC:
1573 break;
1574
1575 default:
1576 break;
1577 }
1578}
1579
1580static LRESULT
1582{
1583 switch (pnmhdr->code)
1584 {
1585 case TTN_GETDISPINFOW:
1586 {
1587 LPTOOLTIPTEXTW lpttt = (LPTOOLTIPTEXTW)pnmhdr;
1588 lpttt->hinst = g_hInstance;
1589 lpttt->lpszText = MAKEINTRESOURCEW(s_ButtonConfig[lpttt->hdr.idFrom - IDC_TOOL_BASE].ids);
1590 break;
1591 }
1592 }
1593 return 0;
1594}
1595
1596static VOID
1598{
1600
1603
1606
1608
1609 SetWindowLongPtrW(pData->m_hwndZoom, GWLP_USERDATA, 0);
1610 DestroyWindow(pData->m_hwndZoom);
1611 pData->m_hwndZoom = NULL;
1612
1613 DestroyWindow(pData->m_hwndToolBar);
1614 pData->m_hwndToolBar = NULL;
1615
1618
1619 PostQuitMessage(0);
1620}
1621
1622static VOID
1624{
1625 WCHAR szFile[MAX_PATH];
1627
1628 DragQueryFileW(hDrop, 0, szFile, _countof(szFile));
1629
1633
1634 DragFinish(hDrop);
1635}
1636
1639{
1640 switch (uMsg)
1641 {
1642 case WM_CREATE:
1643 {
1645 return -1;
1646 break;
1647 }
1648 case WM_COMMAND:
1649 {
1651 break;
1652 }
1653 case WM_NOTIFY:
1654 {
1656 }
1657 case WM_GETMINMAXINFO:
1658 {
1659 MINMAXINFO *pMMI = (MINMAXINFO*)lParam;
1660 pMMI->ptMinTrackSize.x = 350;
1661 pMMI->ptMinTrackSize.y = 290;
1662 break;
1663 }
1664 case WM_MOVE:
1665 {
1667 break;
1668 }
1669 case WM_SIZE:
1670 {
1672 break;
1673 }
1674 case WM_DROPFILES:
1675 {
1677 break;
1678 }
1679 case WM_SYSCOLORCHANGE:
1680 {
1682 InvalidateRect(pData->m_hwnd, NULL, TRUE);
1683 InvalidateRect(pData->m_hwndZoom, NULL, TRUE);
1684 break;
1685 }
1686 case WM_DESTROY:
1687 {
1689 break;
1690 }
1691 case WM_CONTEXTMENU:
1692 {
1694 if ((int)lParam == -1)
1695 return ZoomWndProc(pData->m_hwndZoom, uMsg, wParam, lParam);
1696 break;
1697 }
1698 case WM_TIMER:
1699 {
1701 {
1704 }
1705 break;
1706 }
1708 {
1710 if (g_ImageId == lParam)
1712 break;
1713 }
1714 default:
1715 {
1716 return DefWindowProcW(hwnd, uMsg, wParam, lParam);
1717 }
1718 }
1719
1720 return 0;
1721}
1722
1723LONG
1725{
1726 struct GdiplusStartupInput gdiplusStartupInput;
1727 ULONG_PTR gdiplusToken;
1729 WCHAR szTitle[256];
1730 HWND hMainWnd;
1731 MSG msg;
1732 HACCEL hAccel;
1733 HRESULT hrCoInit;
1734 INITCOMMONCONTROLSEX Icc = { .dwSize = sizeof(Icc), .dwICC = ICC_WIN95_CLASSES };
1735
1737 SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL); // Give UI higher priority than background threads
1738
1739 /* Initialize COM */
1741 if (FAILED(hrCoInit))
1742 DPRINT1("Warning, CoInitializeEx failed with code=%08X\n", (int)hrCoInit);
1743
1746
1747 /* Initialize GDI+ */
1748 ZeroMemory(&gdiplusStartupInput, sizeof(gdiplusStartupInput));
1749 gdiplusStartupInput.GdiplusVersion = 1;
1750 GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);
1751
1752 /* Register window classes */
1753 ZeroMemory(&WndClass, sizeof(WndClass));
1754 WndClass.lpszClassName = WC_PREVIEW;
1755 WndClass.lpfnWndProc = PreviewWndProc;
1756 WndClass.hInstance = g_hInstance;
1757 WndClass.style = CS_HREDRAW | CS_VREDRAW;
1760 WndClass.hbrBackground = GetStockBrush(NULL_BRUSH); /* less flicker */
1761 if (!RegisterClassW(&WndClass))
1762 return -1;
1763 WndClass.lpszClassName = WC_ZOOM;
1764 WndClass.lpfnWndProc = ZoomWndProc;
1766 WndClass.hbrBackground = GetStockBrush(NULL_BRUSH); /* less flicker */
1767 if (!RegisterClassW(&WndClass))
1768 return -1;
1769
1770 /* Create the main window */
1775 NULL, NULL, g_hInstance, (LPVOID)szFileName);
1776
1777 /* Create accelerator table for keystrokes */
1779
1780 /* Show the main window now */
1783 else
1785
1787
1788 /* Message Loop */
1789 while (GetMessageW(&msg, NULL, 0, 0) > 0)
1790 {
1791 const HWND hwndFull = g_hwndFullscreen;
1792 if (IsWindowVisible(hwndFull) && TranslateAcceleratorW(hwndFull, hAccel, &msg))
1793 continue;
1795 continue;
1796
1799 }
1800
1801 /* Destroy accelerator table */
1803
1805
1806 GdiplusShutdown(gdiplusToken);
1807
1808 /* Release COM resources */
1809 if (SUCCEEDED(hrCoInit))
1811
1812 return 0;
1813}
1814
1817{
1819}
1820
1823{
1825}
1826
1829{
1830 WCHAR szFile[MAX_PATH];
1831
1832 if (MultiByteToWideChar(CP_ACP, 0, path, -1, szFile, _countof(szFile)))
1833 {
1834 ImageView_Main(hwnd, szFile);
1835 }
1836}
1837
1840{
1841 DPRINT("ImageView_PrintTo() not implemented\n");
1842}
1843
1846{
1847 DPRINT("ImageView_PrintToA() not implemented\n");
1848}
1849
1852{
1853 DPRINT("ImageView_PrintToW() not implemented\n");
1854}
1855
1860{
1861 switch (dwReason)
1862 {
1863 case DLL_PROCESS_ATTACH:
1864 g_hInstance = hinstDLL;
1865 break;
1866 }
1867
1868 return TRUE;
1869}
static HDC hDC
Definition: 3dtext.c:33
PRTL_UNICODE_STRING_BUFFER Path
#define SLIDE_SHOW
Arabic default style
Definition: afstyles.h:94
BOOL Anime_LoadInfo(PANIME pAnime)
Definition: anime.c:89
void Anime_Start(PANIME pAnime, DWORD dwDelay)
Definition: anime.c:35
BOOL Anime_OnTimer(PANIME pAnime, WPARAM wParam)
Definition: anime.c:76
void Anime_SetTimerWnd(PANIME pAnime, HWND hwndTimer)
Definition: anime.c:25
void Anime_FreeInfo(PANIME pAnime)
Definition: anime.c:12
void Anime_Pause(PANIME pAnime)
Definition: anime.c:30
#define msg(x)
Definition: auth_time.c:54
#define IDS_APPTITLE
Definition: resource.h:3
#define IDC_HANDDRAG
Definition: resource.h:25
#define IDC_SAVEAS
Definition: resource.h:17
#define DPRINT1
Definition: precomp.h:8
DWORD dwReason
Definition: misc.cpp:135
#define EXTERN_C
Definition: basetyps.h:12
#define RegCloseKey(hKey)
Definition: registry.h:49
struct _root root
WCHAR WndClass[]
Definition: capicon.c:23
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
BOOL WINAPI InitCommonControlsEx(const INITCOMMONCONTROLSEX *lpInitCtrls)
Definition: commctrl.c:900
#define OFN_OVERWRITEPROMPT
Definition: commdlg.h:116
#define OFN_EXPLORER
Definition: commdlg.h:104
#define OFN_HIDEREADONLY
Definition: commdlg.h:107
wcscpy
#define ERROR_SUCCESS
Definition: deptool.c:10
static LSTATUS(WINAPI *pRegDeleteTreeW)(HKEY
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
static HBITMAP hBitmap
Definition: timezone.c:26
LONG WINAPI RegCreateKeyExW(_In_ HKEY hKey, _In_ LPCWSTR lpSubKey, _In_ DWORD Reserved, _In_opt_ LPWSTR lpClass, _In_ DWORD dwOptions, _In_ REGSAM samDesired, _In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, _Out_ PHKEY phkResult, _Out_opt_ LPDWORD lpdwDisposition)
Definition: reg.c:1096
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3333
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4882
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4103
UINT uFlags
Definition: api.c:59
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:941
INT WINAPI ImageList_AddMasked(HIMAGELIST himl, HBITMAP hBitmap, COLORREF clrMask)
Definition: imagelist.c:573
HIMAGELIST WINAPI ImageList_Create(INT cx, INT cy, UINT flags, INT cInitial, INT cGrow)
Definition: imagelist.c:814
BOOL WINAPI GetSaveFileNameW(LPOPENFILENAMEW ofn)
Definition: filedlg.c:4801
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
#define CP_ACP
Definition: compat.h:109
#define INVALID_HANDLE_VALUE
Definition: compat.h:731
#define MAX_PATH
Definition: compat.h:34
#define CALLBACK
Definition: compat.h:35
#define MultiByteToWideChar
Definition: compat.h:110
#define lstrlenW
Definition: compat.h:750
GpStatus WINGDIPAPI GdipDrawImageRectRect(GpGraphics *graphics, GpImage *image, REAL dstx, REAL dsty, REAL dstwidth, REAL dstheight, REAL srcx, REAL srcy, REAL srcwidth, REAL srcheight, GpUnit srcUnit, GDIPCONST GpImageAttributes *imageattr, DrawImageAbort callback, VOID *callbackData)
Definition: graphics.c:3498
GpStatus WINGDIPAPI GdipCreateFromHDC(HDC hdc, GpGraphics **graphics)
Definition: graphics.c:2395
GpStatus WINGDIPAPI GdipDeleteGraphics(GpGraphics *graphics)
Definition: graphics.c:2581
GpStatus WINGDIPAPI GdipSetInterpolationMode(GpGraphics *graphics, InterpolationMode mode)
Definition: graphics.c:6147
GpStatus WINGDIPAPI GdipSetSmoothingMode(GpGraphics *graphics, SmoothingMode mode)
Definition: graphics.c:6293
GpStatus WINGDIPAPI GdipGetImageRawFormat(GpImage *image, GUID *format)
Definition: image.c:2354
GpStatus WINGDIPAPI GdipGetImageEncodersSize(UINT *numEncoders, UINT *size)
Definition: image.c:5049
GpStatus WINGDIPAPI GdipGetImageFlags(GpImage *image, UINT *flags)
Definition: image.c:5318
GpStatus WINGDIPAPI GdipGetImageWidth(GpImage *image, UINT *width)
Definition: image.c:2390
GpStatus WINGDIPAPI GdipGetImageHeight(GpImage *image, UINT *height)
Definition: image.c:2287
GpStatus WINGDIPAPI GdipGetImageDecodersSize(UINT *numDecoders, UINT *size)
Definition: image.c:4998
GpStatus WINGDIPAPI GdipSaveImageToFile(GpImage *image, GDIPCONST WCHAR *filename, GDIPCONST CLSID *clsidEncoder, GDIPCONST EncoderParameters *encoderParams)
Definition: image.c:4476
GpStatus WINGDIPAPI GdipDisposeImage(GpImage *image)
Definition: image.c:2155
GpStatus WINGDIPAPI GdipImageRotateFlip(GpImage *image, RotateFlipType type)
Definition: image.c:5410
GpStatus WINGDIPAPI GdipGetImageEncoders(UINT numEncoders, UINT size, ImageCodecInfo *encoders)
Definition: image.c:5073
GpStatus WINGDIPAPI GdipGetImageDecoders(UINT numDecoders, UINT size, ImageCodecInfo *decoders)
Definition: image.c:5022
HANDLE WINAPI FindFirstFileW(IN LPCWSTR lpFileName, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:320
BOOL WINAPI FindClose(HANDLE hFindFile)
Definition: find.c:502
BOOL WINAPI FindNextFileW(IN HANDLE hFindFile, OUT LPWIN32_FIND_DATAW lpFindFileData)
Definition: find.c:382
DWORD WINAPI GetFullPathNameW(IN LPCWSTR lpFileName, IN DWORD nBufferLength, OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart)
Definition: path.c:1106
BOOL WINAPI SetThreadPriority(IN HANDLE hThread, IN int nPriority)
Definition: thread.c:700
HRESULT WINAPI DECLSPEC_HOTPATCH CoInitializeEx(LPVOID lpReserved, DWORD dwCoInit)
Definition: compobj.c:2002
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:2067
void WINAPI DragFinish(HDROP h)
Definition: shellole.c:538
UINT WINAPI DragQueryFileW(HDROP hDrop, UINT lFile, LPWSTR lpszwFile, UINT lLength)
Definition: shellole.c:622
void WINAPI DragAcceptFiles(HWND hWnd, BOOL b)
Definition: shellole.c:522
#define IDC_ZOOM_IN
Definition: resource.h:44
#define IDC_SLIDE_SHOW
Definition: resource.h:43
#define IDC_ROT_COUNCW
Definition: resource.h:47
#define IDC_REAL_SIZE
Definition: resource.h:42
#define IDC_MODIFY
Definition: resource.h:53
#define IDC_INCTIMER
Definition: resource.h:36
#define IDC_ENDSLIDESHOW
Definition: resource.h:55
#define IDC_NEXT_PIC
Definition: resource.h:40
#define IDI_APP_ICON
Definition: resource.h:4
#define IDC_ROT_CWSAVE
Definition: resource.h:48
#define IDC_PREV_PIC
Definition: resource.h:39
#define IDC_BEST_FIT
Definition: resource.h:41
#define IDS_NOPREVIEW
Definition: resource.h:77
#define IDR_ACCELERATOR
Definition: resource.h:108
#define IDC_DECTIMER
Definition: resource.h:37
#define IDC_DELETE
Definition: resource.h:50
#define IDC_HELP_TOC
Definition: resource.h:54
#define IDC_TOGGLEFULLSCREEN
Definition: resource.h:35
#define IDC_ZOOM_OUT
Definition: resource.h:45
#define IDC_ROT_CLOCKW
Definition: resource.h:46
#define IDC_TOOL_BASE
Definition: resource.h:32
#define IDC_ROT_CCWSAVE
Definition: resource.h:49
BOOL WINAPI PathRemoveFileSpecW(LPWSTR lpszPath)
Definition: path.c:629
LPWSTR WINAPI PathFindFileNameW(LPCWSTR lpszPath)
Definition: path.c:394
VOID WINAPI PathUnquoteSpacesW(LPWSTR lpszPath)
Definition: path.c:1040
#define pt(x, y)
Definition: drawing.c:79
static VOID BitBlt(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Width, _In_ ULONG Height, _In_reads_bytes_(Delta *Height) PUCHAR Buffer, _In_ ULONG BitsPerPixel, _In_ ULONG Delta)
Definition: common.c:57
#define RGB(r, g, b)
Definition: precomp.h:71
HINSTANCE hInst
Definition: dxdiag.c:13
OPENFILENAMEW sfn
Definition: eventvwr.c:101
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
#define IDC_PRINT
Definition: fontview.h:14
#define MODIFY(p, i, v)
Definition: check.c:44
FxAutoRegKey hKey
pKey DeleteObject()
Status WINAPI GdiplusStartup(ULONG_PTR *token, const struct GdiplusStartupInput *input, struct GdiplusStartupOutput *output)
Definition: gdiplus.c:81
@ SmoothingModeNone
Definition: gdiplusenums.h:126
@ SmoothingModeHighQuality
Definition: gdiplusenums.h:125
@ ImageFlagsHasTranslucent
Definition: gdiplusenums.h:336
@ ImageFlagsHasAlpha
Definition: gdiplusenums.h:335
@ WrapModeTile
Definition: gdiplusenums.h:207
@ UnitPixel
Definition: gdiplusenums.h:29
@ InterpolationModeHighQualityBilinear
Definition: gdiplusenums.h:149
@ InterpolationModeNearestNeighbor
Definition: gdiplusenums.h:148
@ Rotate270FlipNone
@ Rotate90FlipNone
void WINAPI GdiplusShutdown(ULONG_PTR)
@ Ok
Definition: gdiplustypes.h:26
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLdouble n
Definition: glext.h:7729
GLuint buffer
Definition: glext.h:5915
GLsizeiptr size
Definition: glext.h:5919
const GLubyte * c
Definition: glext.h:8905
GLubyte * pattern
Definition: glext.h:7787
GLuint GLuint num
Definition: glext.h:9618
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
GpStatus WINGDIPAPI GdipCreateImageAttributes(GpImageAttributes **imageattr)
GpStatus WINGDIPAPI GdipDisposeImageAttributes(GpImageAttributes *imageattr)
GpStatus WINGDIPAPI GdipSetImageAttributesWrapMode(GpImageAttributes *imageAttr, WrapMode wrap, ARGB argb, BOOL clamp)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define FAILED(hr)
Definition: intsafe.h:51
#define c
Definition: ke_i.h:80
static IN DWORD IN LPVOID lpvReserved
TCHAR szTitle[MAX_LOADSTRING]
Definition: magnifier.c:35
HWND hMainWnd
Definition: magnifier.c:32
HACCEL hAccel
Definition: main.c:47
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56
HDC hdc
Definition: main.c:9
static HBITMAP
Definition: button.c:44
static HDC
Definition: imagelist.c:88
#define min(a, b)
Definition: monoChain.cc:55
HWND hToolBar
Definition: mplay32.c:23
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
unsigned int UINT
Definition: ndis.h:50
#define REG_BINARY
Definition: nt_native.h:1496
#define KEY_READ
Definition: nt_native.h:1023
#define DELETE
Definition: nt_native.h:57
#define KEY_WRITE
Definition: nt_native.h:1031
#define UNICODE_NULL
_Out_ LPRECT prc
Definition: ntgdi.h:1658
INT WINAPI DrawTextW(HDC hdc, LPCWSTR str, INT count, LPRECT rect, UINT flags)
Definition: defwnd.c:16
#define L(x)
Definition: ntvdm.h:50
@ COINIT_APARTMENTTHREADED
Definition: objbase.h:278
@ COINIT_DISABLE_OLE1DDE
Definition: objbase.h:280
#define PathCombineW
Definition: pathcch.h:317
#define LOWORD(l)
Definition: pedump.c:82
#define WS_CHILD
Definition: pedump.c:617
#define WS_OVERLAPPEDWINDOW
Definition: pedump.c:637
#define WS_POPUP
Definition: pedump.c:616
#define WS_VSCROLL
Definition: pedump.c:627
#define WS_VISIBLE
Definition: pedump.c:620
short SHORT
Definition: pedump.c:59
#define WS_EX_TOPMOST
Definition: pedump.c:647
long LONG
Definition: pedump.c:60
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define WS_HSCROLL
Definition: pedump.c:628
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:586
#define TB_ADDBUTTONS
Definition: commctrl.h:1271
#define TB_SETEXTENDEDSTYLE
Definition: commctrl.h:1190
#define TB_AUTOSIZE
Definition: commctrl.h:1137
#define LPTOOLTIPTEXTW
Definition: commctrl.h:1892
#define TTN_GETDISPINFOW
Definition: commctrl.h:1878
#define TBSTYLE_TOOLTIPS
Definition: commctrl.h:989
#define CCS_BOTTOM
Definition: commctrl.h:2249
struct _IMAGELIST * HIMAGELIST
Definition: commctrl.h:324
#define TB_BUTTONSTRUCTSIZE
Definition: commctrl.h:1134
_Out_opt_ int * cx
Definition: commctrl.h:585
#define TB_SETIMAGELIST
Definition: commctrl.h:1150
#define TBSTYLE_EX_HIDECLIPPEDBUTTONS
Definition: commctrl.h:1013
#define TB_ENABLEBUTTON
Definition: commctrl.h:1042
#define TOOLBARCLASSNAMEW
Definition: commctrl.h:943
#define TBSTYLE_FLAT
Definition: commctrl.h:992
#define ILC_MASK
Definition: commctrl.h:351
#define ICC_WIN95_CLASSES
Definition: commctrl.h:66
#define ILC_COLOR24
Definition: commctrl.h:357
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define WM_CONTEXTMENU
Definition: richedit.h:64
#define WM_NOTIFY
Definition: richedit.h:61
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
_CRT_RESTORE_GCC_WARNINGS _Check_return_ _CRTIMP wchar_t *__cdecl wcstok(_Inout_opt_z_ wchar_t *_Str, _In_z_ const wchar_t *_Delim)
#define FOF_ALLOWUNDO
Definition: shellapi.h:148
#define FO_DELETE
Definition: shellapi.h:139
void WINAPI SHAddToRecentDocs(UINT uFlags, LPCVOID pv)
Definition: shellord.c:1010
static BOOL Preview_OnCreate(HWND hwnd, LPCREATESTRUCT pCS)
Definition: shimgvw.c:1253
static VOID Preview_ResetZoom(PPREVIEW_DATA pData)
Definition: shimgvw.c:304
static VOID Preview_Delete(PPREVIEW_DATA pData)
Definition: shimgvw.c:1368
static BOOL Preview_IsMainWnd(HWND hwnd)
Definition: shimgvw.c:134
static VOID Preview_ToggleSlideShowEx(PPREVIEW_DATA pData, BOOL StartTimer)
Definition: shimgvw.c:1412
VOID WINAPI ImageView_PrintToW(HWND hwnd, HINSTANCE hInst, LPCWSTR path, int nShow)
Definition: shimgvw.c:1851
static VOID Preview_ToggleSlideShow(PPREVIEW_DATA pData)
Definition: shimgvw.c:1440
#define TB_IMAGE_HEIGHT
Definition: shimgvw.c:22
static VOID ZoomWnd_OnMouseWheel(HWND hwnd, INT x, INT y, INT zDelta, UINT fwKeys)
Definition: shimgvw.c:1146
static BOOL ZoomWnd_OnSetCursor(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: shimgvw.c:1048
static VOID Preview_pFreeImage(PPREVIEW_DATA pData)
Definition: shimgvw.c:368
static VOID ZoomWnd_OnDraw(PPREVIEW_DATA pData, HDC hdc, LPRECT prcPaint, LPRECT prcClient)
Definition: shimgvw.c:749
#define SLIDESHOW_TIMER_INTERVAL
Definition: shimgvw.c:26
static VOID Preview_UpdateImage(PPREVIEW_DATA pData)
Definition: shimgvw.c:579
static VOID Preview_UpdateZoom(PPREVIEW_DATA pData, UINT NewZoom, BOOL bEnableBestFit, BOOL bEnableRealSize)
Definition: shimgvw.c:242
static VOID ZoomWnd_UpdateScroll(PPREVIEW_DATA pData, BOOL bResetPos)
Definition: shimgvw.c:169
LRESULT CALLBACK ZoomWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: shimgvw.c:1173
LONG ImageView_Main(HWND hwnd, LPCWSTR szFileName)
Definition: shimgvw.c:1724
static VOID Preview_RestartTimer(HWND hwnd)
Definition: shimgvw.c:140
static VOID Preview_GoNextPic(PPREVIEW_DATA pData, BOOL bNext)
Definition: shimgvw.c:1446
static VOID Preview_pPrintImage(PPREVIEW_DATA pData)
Definition: shimgvw.c:563
static const TBBUTTON s_Buttons[]
Definition: shimgvw.c:54
struct tagPREVIEW_DATA * PPREVIEW_DATA
static VOID Preview_OnSize(HWND hwnd)
Definition: shimgvw.c:1335
#define MAX_ZOOM
Definition: shimgvw.c:44
static VOID GenerateSetCursor(HWND hwnd, UINT uMsg)
Definition: shimgvw.c:992
#define MIN_ZOOM
Definition: shimgvw.c:43
static PPREVIEW_DATA Preview_GetData(HWND hwnd)
Definition: shimgvw.c:128
struct tagPREVIEW_DATA PREVIEW_DATA
BOOL WINAPI DllMain(IN HINSTANCE hinstDLL, IN DWORD dwReason, IN LPVOID lpvReserved)
Definition: shimgvw.c:1857
HWND g_hMainWnd
Definition: shimgvw.c:31
#define SLIDESHOW_TIMER_ID
Definition: shimgvw.c:25
SHIMGVW_FILENODE * g_pCurrentFile
Definition: shimgvw.c:33
static VOID ZoomWnd_OnMouseMove(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: shimgvw.c:1025
static VOID Preview_ChangeSlideShowTimer(PPREVIEW_DATA pData, BOOL bSlower)
Definition: shimgvw.c:152
static BOOL Preview_CreateToolBar(PPREVIEW_DATA pData)
Definition: shimgvw.c:940
static VOID ZoomWnd_OnHVScroll(PPREVIEW_DATA pData, HWND hwnd, WPARAM wParam, BOOL bVertical)
Definition: shimgvw.c:1081
static VOID Preview_pLoadImageFromNode(PPREVIEW_DATA pData, SHIMGVW_FILENODE *pNode)
Definition: shimgvw.c:413
EXTERN_C PCWSTR GetExtraExtensionsGdipList(VOID)
Definition: loader.cpp:131
static VOID Preview_EndSlideShow(HWND hwnd)
Definition: shimgvw.c:980
#define DEFINE_BTN_SEPARATOR
Definition: shimgvw.c:50
#define TB_IMAGE_WIDTH
Definition: shimgvw.c:21
SHIMGVW_SETTINGS g_Settings
Definition: shimgvw.c:35
static VOID Preview_pLoadImage(PPREVIEW_DATA pData, LPCWSTR szOpenFileName)
Definition: shimgvw.c:382
static VOID Preview_OnMoveSize(HWND hwnd)
Definition: shimgvw.c:1314
LRESULT CALLBACK PreviewWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: shimgvw.c:1638
static SHIMGVW_FILENODE * pBuildFileList(LPCWSTR szFirstFile)
Definition: shimgvw.c:588
static VOID Preview_OnDropFiles(HWND hwnd, HDROP hDrop)
Definition: shimgvw.c:1623
static const TB_BUTTON_CONFIG s_ButtonConfig[]
Definition: shimgvw.c:89
static LRESULT Preview_OnNotify(HWND hwnd, LPNMHDR pnmhdr)
Definition: shimgvw.c:1581
static BOOL ImageView_LoadSettings(VOID)
Definition: shimgvw.c:907
static VOID ZoomWnd_StopHideCursor(PPREVIEW_DATA pData)
Definition: shimgvw.c:998
HWND g_hwndFullscreen
Definition: shimgvw.c:32
static VOID ImageView_SaveSettings(VOID)
Definition: shimgvw.c:925
static VOID ImageView_ResetSettings(VOID)
Definition: shimgvw.c:897
#define DEFINE_BTN_CONFIG(_name)
Definition: shimgvw.c:87
static VOID ZoomWnd_OnPaint(PPREVIEW_DATA pData, HWND hwnd)
Definition: shimgvw.c:881
static VOID Preview_ZoomInOrOut(PPREVIEW_DATA pData, BOOL bZoomIn)
Definition: shimgvw.c:270
static VOID Preview_UpdateUI(PPREVIEW_DATA pData)
Definition: shimgvw.c:569
static VOID Preview_pSaveImageAs(PPREVIEW_DATA pData)
Definition: shimgvw.c:466
UINT g_ImageId
Definition: shimgvw.c:36
static const UINT s_ZoomSteps[]
Definition: shimgvw.c:38
HINSTANCE g_hInstance
Definition: shimgvw.c:30
VOID WINAPI ImageView_Fullscreen(HWND hwnd, HINSTANCE hInst, LPCWSTR path, int nShow)
Definition: shimgvw.c:1822
VOID WINAPI ImageView_FullscreenA(HWND hwnd, HINSTANCE hInst, LPCSTR path, int nShow)
Definition: shimgvw.c:1828
static VOID Preview_OnCommand(HWND hwnd, UINT nCommandID)
Definition: shimgvw.c:1462
#define HIDECURSOR_TIMER_ID
Definition: shimgvw.c:27
static VOID Preview_OnDestroy(HWND hwnd)
Definition: shimgvw.c:1597
static BOOL Preview_pSaveImage(PPREVIEW_DATA pData, LPCWSTR pszFile)
Definition: shimgvw.c:419
VOID WINAPI ImageView_PrintToA(HWND hwnd, HINSTANCE hInst, LPCSTR path, int nShow)
Definition: shimgvw.c:1845
VOID WINAPI ImageView_FullscreenW(HWND hwnd, HINSTANCE hInst, LPCWSTR path, int nShow)
Definition: shimgvw.c:1816
static HBRUSH CreateCheckerBoardBrush(VOID)
Definition: shimgvw.c:728
static VOID ZoomWnd_OnButtonUp(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: shimgvw.c:1066
static VOID Preview_UpdateTitle(PPREVIEW_DATA pData, LPCWSTR FileName)
Definition: shimgvw.c:350
#define DEFINE_BTN_INFO(_name)
Definition: shimgvw.c:47
static VOID ZoomWnd_OnButtonDown(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: shimgvw.c:1005
#define HIDECURSOR_TIMER_TIMEOUT
Definition: shimgvw.c:28
VOID WINAPI ImageView_PrintTo(HWND hwnd, HINSTANCE hInst, LPCWSTR path, int nShow)
Definition: shimgvw.c:1839
static VOID pFreeFileList(SHIMGVW_FILENODE *root)
Definition: shimgvw.c:710
GpImage * g_pImage
Definition: shimgvw.c:34
static VOID Preview_Edit(HWND hwnd)
Definition: shimgvw.c:1405
EXTERN_C HRESULT LoadImageFromPath(LPCWSTR Path, GpImage **ppImage)
Definition: loader.cpp:269
void EnableCommandIfVerbExists(UINT ImageId, HWND hwnd, UINT CmdId, PCWSTR Verb, PCWSTR File)
Definition: util.c:207
#define WM_UPDATECOMMANDSTATE
Definition: shimgvw.h:33
void ShellExecuteVerb(HWND hwnd, PCWSTR Verb, PCWSTR File, BOOL Quit)
Definition: util.c:223
void DoShellContextMenuOnFile(HWND hwnd, PCWSTR File, LPARAM lParam)
Definition: util.c:150
#define WC_PREVIEW
Definition: shimgvw.h:54
#define WC_ZOOM
Definition: shimgvw.h:55
static LPVOID QuickAlloc(SIZE_T cbSize, BOOL bZero)
Definition: shimgvw.h:81
void DisplayHelp(HWND hwnd)
Definition: util.c:245
static VOID QuickFree(LPVOID ptr)
Definition: shimgvw.h:86
int WINAPI SHFileOperationW(LPSHFILEOPSTRUCTW lpFileOp)
Definition: shlfileop.cpp:2119
HRESULT hr
Definition: shlfolder.c:183
#define SHARD_PATHW
Definition: shlobj.h:1184
#define DPRINT
Definition: sndvol32.h:73
#define _countof(array)
Definition: sndvol32.h:70
& rect
Definition: startmenu.cpp:1413
STRSAFEAPI StringCchCatW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:325
STRSAFEAPI StringCbCopyW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:166
STRSAFEAPI StringCbPrintfExW(STRSAFE_LPWSTR pszDest, size_t cbDest, STRSAFE_LPWSTR *ppszDestEnd, size_t *pcbRemaining, STRSAFE_DWORD dwFlags, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:623
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:149
const WCHAR * FilenameExtension
BOOL Maximized
Definition: shimgvw.h:40
LPCWSTR pFrom
Definition: shellapi.h:358
FILEOP_FLAGS fFlags
Definition: shellapi.h:360
LONG cx
Definition: kdterminal.h:27
LONG cy
Definition: kdterminal.h:28
RECT rcNormalPosition
Definition: winuser.h:3298
LPVOID lpCreateParams
Definition: winuser.h:2943
POINT ptMinTrackSize
Definition: winuser.h:3633
UINT code
Definition: winuser.h:3162
HWND hwndOwner
Definition: commdlg.h:361
DWORD Flags
Definition: commdlg.h:373
LPWSTR lpstrFile
Definition: commdlg.h:367
LPCWSTR lpstrDefExt
Definition: commdlg.h:376
DWORD lStructSize
Definition: commdlg.h:360
DWORD nMaxFile
Definition: commdlg.h:368
LPCWSTR lpstrFilter
Definition: commdlg.h:363
DWORD nFilterIndex
Definition: commdlg.h:366
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
INT m_xScrollOffset
Definition: shimgvw.c:116
POINT m_ptOrigin
Definition: shimgvw.c:121
HWND m_hwndToolBar
Definition: shimgvw.c:113
BOOL m_bHideCursor
Definition: shimgvw.c:120
INT m_nZoomPercents
Definition: shimgvw.c:114
HWND m_hwndZoom
Definition: shimgvw.c:112
UINT m_nMouseDownMsg
Definition: shimgvw.c:118
WCHAR m_szFile[MAX_PATH]
Definition: shimgvw.c:122
UINT m_nTimerInterval
Definition: shimgvw.c:119
ANIME m_Anime
Definition: shimgvw.c:115
INT m_yScrollOffset
Definition: shimgvw.c:117
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
WCHAR FileName[MAX_PATH]
Definition: shimgvw.h:49
struct tagSHIMGVW_FILENODE * Next
Definition: shimgvw.h:51
struct tagSHIMGVW_FILENODE * Prev
Definition: shimgvw.h:50
#define max(a, b)
Definition: svc.c:63
#define GWLP_USERDATA
Definition: treelist.c:63
#define WM_MOUSEWHEEL
Definition: treelist.c:96
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
Definition: twain.h:1830
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
uint16_t * PWSTR
Definition: typedefs.h:56
const uint16_t * PCWSTR
Definition: typedefs.h:57
unsigned char * LPBYTE
Definition: typedefs.h:53
int32_t INT
Definition: typedefs.h:58
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define IN
Definition: typedefs.h:39
#define MAKELONG(a, b)
Definition: typedefs.h:249
#define HIWORD(l)
Definition: typedefs.h:247
WORD WORD PSZ PSZ pszFileName
Definition: vdmdbg.h:44
int ret
HDC hdcMem
Definition: welcome.c:104
#define ZeroMemory
Definition: winbase.h:1737
HANDLE WINAPI GetCurrentThread(void)
Definition: proc.c:1148
#define THREAD_PRIORITY_ABOVE_NORMAL
Definition: winbase.h:301
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
_In_ BOOL bEnable
Definition: winddi.h:3426
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209
UINT_PTR WPARAM
Definition: windef.h:207
DWORD COLORREF
Definition: windef.h:300
#define WINAPI
Definition: msvc.h:6
#define GetStockBrush(i)
Definition: windowsx.h:307
#define GET_Y_LPARAM(lp)
Definition: windowsx.h:300
#define GET_X_LPARAM(lp)
Definition: windowsx.h:299
#define GetStockFont(i)
Definition: windowsx.h:308
#define DIB_RGB_COLORS
Definition: wingdi.h:367
COLORREF WINAPI SetBkColor(_In_ HDC, _In_ COLORREF)
Definition: dc.c:999
#define DEFAULT_GUI_FONT
Definition: wingdi.h:909
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1546
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
#define SRCCOPY
Definition: wingdi.h:333
COLORREF WINAPI GetBkColor(_In_ HDC)
Definition: dc.c:978
#define NULL_BRUSH
Definition: wingdi.h:901
HBITMAP WINAPI CreateCompatibleBitmap(_In_ HDC hdc, _In_ INT cx, _In_ INT cy)
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
BOOL WINAPI Rectangle(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int)
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
Definition: text.c:918
HBRUSH WINAPI CreateDIBPatternBrushPt(_In_ const VOID *pvPackedDIB, _In_ UINT uUsage)
HBRUSH WINAPI CreateSolidBrush(_In_ COLORREF)
BOOL WINAPI DeleteDC(_In_ HDC)
HPEN WINAPI CreatePen(_In_ int, _In_ int, _In_ COLORREF)
#define PS_SOLID
Definition: wingdi.h:586
#define HKEY_CURRENT_USER
Definition: winreg.h:11
#define SW_SHOWNORMAL
Definition: winuser.h:773
#define WM_PAINT
Definition: winuser.h:1623
HWND WINAPI SetCapture(_In_ HWND hWnd)
#define CS_VREDRAW
Definition: winuser.h:658
#define SW_SHOWMAXIMIZED
Definition: winuser.h:776
DWORD WINAPI GetSysColor(_In_ int)
#define MAKEWPARAM(l, h)
Definition: winuser.h:4012
BOOL WINAPI IsWindow(_In_opt_ HWND)
#define SW_HIDE
Definition: winuser.h:771
#define DT_NOPREFIX
Definition: winuser.h:537
#define SB_THUMBTRACK
Definition: winuser.h:573
#define GetWindowLongPtrW
Definition: winuser.h:4832
#define SB_LINEUP
Definition: winuser.h:564
#define WM_HSCROLL
Definition: winuser.h:1746
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define COLOR_WINDOW
Definition: winuser.h:921
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
BOOL WINAPI ReleaseCapture(void)
Definition: message.c:2890
#define DT_CENTER
Definition: winuser.h:527
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI GetMessageW(_Out_ LPMSG, _In_opt_ HWND, _In_ UINT, _In_ UINT)
#define COLOR_WINDOWTEXT
Definition: winuser.h:924
#define WM_VSCROLL
Definition: winuser.h:1747
BOOL WINAPI GetWindowPlacement(_In_ HWND, _Inout_ WINDOWPLACEMENT *)
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
#define WM_CREATE
Definition: winuser.h:1611
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#define SB_PAGERIGHT
Definition: winuser.h:571
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
#define WM_SIZE
Definition: winuser.h:1614
#define SB_VERT
Definition: winuser.h:553
#define WM_DROPFILES
Definition: winuser.h:1828
#define DT_SINGLELINE
Definition: winuser.h:540
#define WM_LBUTTONDBLCLK
Definition: winuser.h:1781
#define WM_COMMAND
Definition: winuser.h:1743
#define CS_HREDRAW
Definition: winuser.h:653
ATOM WINAPI RegisterClassW(_In_ CONST WNDCLASSW *)
#define IDC_ARROW
Definition: winuser.h:687
#define VK_CONTROL
Definition: winuser.h:2206
#define WM_RBUTTONUP
Definition: winuser.h:1783
HCURSOR WINAPI SetCursor(_In_opt_ HCURSOR)
#define WM_MOUSEMOVE
Definition: winuser.h:1778
#define SB_LINERIGHT
Definition: winuser.h:567
#define CS_DBLCLKS
Definition: winuser.h:651
#define WM_LBUTTONDOWN
Definition: winuser.h:1779
#define WM_SYSCOLORCHANGE
Definition: winuser.h:1629
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2191
BOOL WINAPI IsIconic(_In_ HWND)
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
#define WM_RBUTTONDOWN
Definition: winuser.h:1782
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
BOOL WINAPI IsZoomed(_In_ HWND)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define SB_LINELEFT
Definition: winuser.h:566
#define WM_GETMINMAXINFO
Definition: winuser.h:1643
#define WM_TIMER
Definition: winuser.h:1745
HWND WINAPI CreateWindowExW(_In_ DWORD dwExStyle, _In_opt_ LPCWSTR lpClassName, _In_opt_ LPCWSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
BOOL WINAPI UpdateWindow(_In_ HWND)
#define SIF_ALL
Definition: winuser.h:1235
#define HTCLIENT
Definition: winuser.h:2478
#define SendMessage
Definition: winuser.h:5855
#define SB_BOTH
Definition: winuser.h:555
#define WS_EX_WINDOWEDGE
Definition: winuser.h:407
#define SB_LINEDOWN
Definition: winuser.h:565
#define WM_LBUTTONUP
Definition: winuser.h:1780
#define DT_VCENTER
Definition: winuser.h:543
#define PostMessage
Definition: winuser.h:5844
#define CW_USEDEFAULT
Definition: winuser.h:225
HWND WINAPI GetParent(_In_ HWND)
HACCEL WINAPI LoadAcceleratorsW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
#define WM_MOVE
Definition: winuser.h:1613
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
#define SIF_POS
Definition: winuser.h:1237
int WINAPI TranslateAcceleratorW(_In_ HWND, _In_ HACCEL, _In_ LPMSG)
#define WM_SETCURSOR
Definition: winuser.h:1639
BOOL WINAPI OffsetRect(_Inout_ LPRECT, _In_ int, _In_ int)
#define VK_SHIFT
Definition: winuser.h:2205
#define SW_SHOW
Definition: winuser.h:778
int WINAPI SetScrollInfo(_In_ HWND, _In_ int, _In_ LPCSCROLLINFO, _In_ BOOL)
#define WM_DESTROY
Definition: winuser.h:1612
#define WS_EX_CLIENTEDGE
Definition: winuser.h:384
BOOL WINAPI ShowScrollBar(_In_ HWND, _In_ int, _In_ BOOL)
int WINAPI GetScrollPos(_In_ HWND, _In_ int)
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
HBITMAP WINAPI LoadBitmapW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2249
BOOL WINAPI DestroyAcceleratorTable(_In_ HACCEL)
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
#define SetWindowLongPtrW
Definition: winuser.h:5358
BOOL WINAPI InflateRect(_Inout_ LPRECT, _In_ int, _In_ int)
#define WM_MBUTTONUP
Definition: winuser.h:1786
struct _WINDOWPLACEMENT WINDOWPLACEMENT
#define GWL_STYLE
Definition: winuser.h:855
BOOL WINAPI GetScrollInfo(_In_ HWND, _In_ int, _Inout_ LPSCROLLINFO)
BOOL WINAPI IsWindowVisible(_In_ HWND)
BOOL WINAPI DestroyWindow(_In_ HWND)
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE hInstance, _In_ LPCWSTR lpIconName)
Definition: cursoricon.c:2161
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)
#define WM_MBUTTONDOWN
Definition: winuser.h:1785
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define SB_HORZ
Definition: winuser.h:552
SHORT WINAPI GetKeyState(_In_ int)
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
#define SB_PAGELEFT
Definition: winuser.h:570
#define SB_THUMBPOSITION
Definition: winuser.h:572
const char * LPCSTR
Definition: xmlstorage.h:183
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
char CHAR
Definition: xmlstorage.h:175