ReactOS 0.4.16-dev-974-g5022a45
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
38
39static const UINT s_ZoomSteps[] =
40{
41 5, 10, 25, 50, 100, 200, 300, 500, 1000, 2000, 4000
42};
43
44#define MIN_ZOOM s_ZoomSteps[0]
45#define MAX_ZOOM s_ZoomSteps[_countof(s_ZoomSteps) - 1]
46
47 /* iBitmap, idCommand, fsState, fsStyle, bReserved[2], dwData, iString */
48#define DEFINE_BTN_INFO(_name) \
49 { TBICON_##_name, IDC_##_name, TBSTATE_ENABLED, BTNS_BUTTON, {0}, 0, 0 }
50
51#define DEFINE_BTN_SEPARATOR \
52 { -1, 0, TBSTATE_ENABLED, BTNS_SEP, {0}, 0, 0 }
53
54/* ToolBar Buttons */
55static const TBBUTTON s_Buttons[] =
56{
57 DEFINE_BTN_INFO(PREV_PIC),
58 DEFINE_BTN_INFO(NEXT_PIC),
60 DEFINE_BTN_INFO(BEST_FIT),
61 DEFINE_BTN_INFO(REAL_SIZE),
64 DEFINE_BTN_INFO(ZOOM_IN),
65 DEFINE_BTN_INFO(ZOOM_OUT),
67 DEFINE_BTN_INFO(ROT_CLOCKW),
68 DEFINE_BTN_INFO(ROT_COUNCW),
70 DEFINE_BTN_INFO(ROT_CWSAVE),
71 DEFINE_BTN_INFO(ROT_CCWSAVE),
74 DEFINE_BTN_INFO(PRINT),
75 DEFINE_BTN_INFO(SAVEAS),
78 DEFINE_BTN_INFO(HELP_TOC)
79};
80
81/* ToolBar Button configuration */
82typedef struct
83{
84 DWORD idb; /* Index to bitmap */
85 DWORD ids; /* Index to tooltip */
87
88#define DEFINE_BTN_CONFIG(_name) { IDB_##_name, IDS_TOOLTIP_##_name }
89
91{
92 DEFINE_BTN_CONFIG(PREV_PIC),
93 DEFINE_BTN_CONFIG(NEXT_PIC),
94 DEFINE_BTN_CONFIG(BEST_FIT),
95 DEFINE_BTN_CONFIG(REAL_SIZE),
97 DEFINE_BTN_CONFIG(ZOOM_IN),
98 DEFINE_BTN_CONFIG(ZOOM_OUT),
99 DEFINE_BTN_CONFIG(ROT_CLOCKW),
100 DEFINE_BTN_CONFIG(ROT_COUNCW),
101 DEFINE_BTN_CONFIG(ROT_CWSAVE),
102 DEFINE_BTN_CONFIG(ROT_CCWSAVE),
104 DEFINE_BTN_CONFIG(PRINT),
105 DEFINE_BTN_CONFIG(SAVEAS),
107 DEFINE_BTN_CONFIG(HELP_TOC),
108};
109
110typedef struct tagPREVIEW_DATA
111{
116 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
379static VOID
381{
382 HRESULT hr;
383 BOOL bCanDel;
385 InvalidateRect(pData->m_hwnd, NULL, FALSE); /* Schedule redraw in case we change to "No preview" */
386
387 GetFullPathNameW(szOpenFileName, _countof(g_szFile), g_szFile, NULL);
388 hr = LoadImageFromPath(szOpenFileName, &g_pImage);
391 if (FAILED(hr))
392 {
393 DPRINT1("GdipLoadImageFromStream() failed, %d\n", hr);
396 return;
397 }
398
399 Anime_LoadInfo(&pData->m_Anime);
400
401 /* Reset zoom and redraw display */
405
406 ++g_ImageId;
409}
410
411static VOID
413{
414 Preview_pLoadImage(pData, (pNode ? pNode->FileName : NULL));
415}
416
417static BOOL
419{
420 ImageCodecInfo *codecInfo;
421 GUID rawFormat;
422 UINT j, num, nFilterIndex, size;
423 BOOL ret = FALSE;
424
425 if (g_pImage == NULL)
426 return FALSE;
427
429 codecInfo = QuickAlloc(size, FALSE);
430 if (!codecInfo)
431 {
432 DPRINT1("QuickAlloc() failed in pSaveImage()\n");
433 return FALSE;
434 }
435 GdipGetImageEncoders(num, size, codecInfo);
436
437 GdipGetImageRawFormat(g_pImage, &rawFormat);
438 if (IsEqualGUID(&rawFormat, &ImageFormatMemoryBMP))
439 rawFormat = ImageFormatBMP;
440
441 nFilterIndex = 0;
442 for (j = 0; j < num; ++j)
443 {
444 if (IsEqualGUID(&rawFormat, &codecInfo[j].FormatID))
445 {
446 nFilterIndex = j + 1;
447 break;
448 }
449 }
450
451 Anime_Pause(&pData->m_Anime);
452
453 ret = (nFilterIndex > 0) &&
454 (GdipSaveImageToFile(g_pImage, pszFile, &codecInfo[nFilterIndex - 1].Clsid, NULL) == Ok);
455 if (!ret)
456 DPRINT1("GdipSaveImageToFile() failed\n");
457
458 Anime_Start(&pData->m_Anime, 0);
459
460 QuickFree(codecInfo);
461 return ret;
462}
463
464static VOID
466{
468 ImageCodecInfo *codecInfo;
469 WCHAR szSaveFileName[MAX_PATH];
470 WCHAR *szFilterMask;
471 GUID rawFormat;
472 UINT num, size, j;
473 size_t sizeRemain;
474 WCHAR *c;
475 HWND hwnd = pData->m_hwnd;
476
477 if (g_pImage == NULL)
478 return;
479
481 codecInfo = QuickAlloc(size, FALSE);
482 if (!codecInfo)
483 {
484 DPRINT1("QuickAlloc() failed in pSaveImageAs()\n");
485 return;
486 }
487
488 GdipGetImageEncoders(num, size, codecInfo);
489
490 GdipGetImageRawFormat(g_pImage, &rawFormat);
491 if (IsEqualGUID(&rawFormat, &ImageFormatMemoryBMP))
492 rawFormat = ImageFormatBMP;
493
494 sizeRemain = 0;
495 for (j = 0; j < num; ++j)
496 {
497 // 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.
498 sizeRemain = sizeRemain + (((wcslen(codecInfo[j].FormatDescription) + (wcslen(codecInfo[j].FilenameExtension) * 2) + 5) * sizeof(WCHAR)));
499 }
500
501 /* Add two more chars for the last terminator */
502 sizeRemain += (sizeof(WCHAR) * 2);
503
504 szFilterMask = QuickAlloc(sizeRemain, FALSE);
505 if (!szFilterMask)
506 {
507 DPRINT1("cannot allocate memory for filter mask in pSaveImageAs()");
508 QuickFree(codecInfo);
509 return;
510 }
511
512 ZeroMemory(szSaveFileName, sizeof(szSaveFileName));
513 ZeroMemory(szFilterMask, sizeRemain);
514 ZeroMemory(&sfn, sizeof(sfn));
515 sfn.lStructSize = sizeof(sfn);
517 sfn.lpstrFile = szSaveFileName;
518 sfn.lpstrFilter = szFilterMask;
519 sfn.nMaxFile = _countof(szSaveFileName);
521 sfn.lpstrDefExt = L"png";
522
523 c = szFilterMask;
524
525 for (j = 0; j < num; ++j)
526 {
527 StringCbPrintfExW(c, sizeRemain, &c, &sizeRemain, 0, L"%ls (%ls)", codecInfo[j].FormatDescription, codecInfo[j].FilenameExtension);
528
529 /* Skip the NULL character */
530 c++;
531 sizeRemain -= sizeof(*c);
532
533 StringCbPrintfExW(c, sizeRemain, &c, &sizeRemain, 0, L"%ls", codecInfo[j].FilenameExtension);
534
535 /* Skip the NULL character */
536 c++;
537 sizeRemain -= sizeof(*c);
538
539 if (IsEqualGUID(&rawFormat, &codecInfo[j].FormatID))
540 {
541 sfn.nFilterIndex = j + 1;
542 }
543 }
544
546 {
547 Anime_Pause(&pData->m_Anime);
548
549 if (GdipSaveImageToFile(g_pImage, szSaveFileName, &codecInfo[sfn.nFilterIndex - 1].Clsid, NULL) != Ok)
550 {
551 DPRINT1("GdipSaveImageToFile() failed\n");
552 }
553
554 Anime_Start(&pData->m_Anime, 0);
555 }
556
557 QuickFree(szFilterMask);
558 QuickFree(codecInfo);
559}
560
561static VOID
563{
565}
566
567static VOID
569{
570 BOOL bEnable = (g_pImage != NULL);
572 // These will be validated and enabled later by EnableCommandIfVerbExists
575}
576
577static VOID
579{
580 if (!Preview_IsMainWnd(pData->m_hwnd))
582
584}
585
586static VOID
588{
592}
593
594static SHIMGVW_FILENODE*
596{
597 HANDLE hFindHandle;
598 WCHAR *extension, *buffer;
599 WCHAR szSearchPath[MAX_PATH];
600 WCHAR szSearchMask[MAX_PATH];
601 WCHAR szFileTypes[MAX_PATH];
602 WIN32_FIND_DATAW findData;
603 SHIMGVW_FILENODE *currentNode = NULL;
605 SHIMGVW_FILENODE *conductor = NULL;
606 ImageCodecInfo *codecInfo;
607 UINT num = 0, size = 0, ExtraSize = 0;
608 UINT j;
609
610 const PCWSTR ExtraExtensions = GetExtraExtensionsGdipList();
611 const UINT ExtraCount = ExtraExtensions[0] ? 1 : 0;
612 if (ExtraCount)
613 ExtraSize += sizeof(*codecInfo) + (wcslen(ExtraExtensions) + 1) * sizeof(WCHAR);
614
615 StringCbCopyW(szSearchPath, sizeof(szSearchPath), szFirstFile);
616 PathRemoveFileSpecW(szSearchPath);
617
619 codecInfo = QuickAlloc(size + ExtraSize, FALSE);
620 if (!codecInfo)
621 {
622 DPRINT1("QuickAlloc() failed in pLoadFileList()\n");
623 return NULL;
624 }
625
626 GdipGetImageDecoders(num, size, codecInfo);
627 buffer = (PWSTR)((UINT_PTR)codecInfo + size + (sizeof(*codecInfo) * ExtraCount));
628 if (ExtraCount)
629 codecInfo[num].FilenameExtension = wcscpy(buffer, ExtraExtensions);
630 num += ExtraCount;
631
633 if (!root)
634 {
635 DPRINT1("QuickAlloc() failed in pLoadFileList()\n");
636 QuickFree(codecInfo);
637 return NULL;
638 }
639
640 conductor = root;
641
642 for (j = 0; j < num; ++j)
643 {
644 // FIXME: Parse each FilenameExtension list to bypass szFileTypes limit
645 StringCbCopyW(szFileTypes, sizeof(szFileTypes), codecInfo[j].FilenameExtension);
646
647 extension = wcstok(szFileTypes, L";");
648 while (extension != NULL)
649 {
650 PathCombineW(szSearchMask, szSearchPath, extension);
651
652 hFindHandle = FindFirstFileW(szSearchMask, &findData);
653 if (hFindHandle != INVALID_HANDLE_VALUE)
654 {
655 do
656 {
657 PathCombineW(conductor->FileName, szSearchPath, findData.cFileName);
658
659 // compare the name of the requested file with the one currently found.
660 // if the name matches, the current node is returned by the function.
661 if (_wcsicmp(szFirstFile, conductor->FileName) == 0)
662 {
663 currentNode = conductor;
664 }
665
666 conductor->Next = QuickAlloc(sizeof(SHIMGVW_FILENODE), FALSE);
667
668 // if QuickAlloc fails, make circular what we have and return it
669 if (!conductor->Next)
670 {
671 DPRINT1("QuickAlloc() failed in pLoadFileList()\n");
672
673 conductor->Next = root;
674 root->Prev = conductor;
675
676 FindClose(hFindHandle);
677 QuickFree(codecInfo);
678 return conductor;
679 }
680
681 conductor->Next->Prev = conductor;
682 conductor = conductor->Next;
683 }
684 while (FindNextFileW(hFindHandle, &findData) != 0);
685
686 FindClose(hFindHandle);
687 }
688
689 extension = wcstok(NULL, L";");
690 }
691 }
692
693 // we now have a node too much in the list. In case the requested file was not found,
694 // we use this node to store the name of it, otherwise we free it.
695 if (currentNode == NULL)
696 {
697 StringCchCopyW(conductor->FileName, MAX_PATH, szFirstFile);
698 currentNode = conductor;
699 }
700 else
701 {
702 conductor = conductor->Prev;
703 QuickFree(conductor->Next);
704 }
705
706 // link the last node with the first one to make the list circular
707 conductor->Next = root;
708 root->Prev = conductor;
709 conductor = currentNode;
710
711 QuickFree(codecInfo);
712
713 return conductor;
714}
715
716static VOID
718{
719 SHIMGVW_FILENODE *conductor;
720
721 if (!root)
722 return;
723
724 root->Prev->Next = NULL;
725 root->Prev = NULL;
726
727 while (root)
728 {
729 conductor = root;
730 root = conductor->Next;
731 QuickFree(conductor);
732 }
733}
734
736{
737 static const CHAR pattern[] =
738 "\x28\x00\x00\x00\x10\x00\x00\x00\x10\x00\x00\x00\x01\x00\x04\x00\x00\x00"
739 "\x00\x00\x80\x00\x00\x00\x23\x2E\x00\x00\x23\x2E\x00\x00\x10\x00\x00\x00"
740 "\x00\x00\x00\x00\x99\x99\x99\x00\xCC\xCC\xCC\x00\x00\x00\x00\x00\x00\x00"
741 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
742 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"
743 "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x11\x11\x11\x11"
744 "\x00\x00\x00\x00\x11\x11\x11\x11\x00\x00\x00\x00\x11\x11\x11\x11\x00\x00"
745 "\x00\x00\x11\x11\x11\x11\x00\x00\x00\x00\x11\x11\x11\x11\x00\x00\x00\x00"
746 "\x11\x11\x11\x11\x00\x00\x00\x00\x11\x11\x11\x11\x00\x00\x00\x00\x11\x11"
747 "\x11\x11\x00\x00\x00\x00\x00\x00\x00\x00\x11\x11\x11\x11\x00\x00\x00\x00"
748 "\x11\x11\x11\x11\x00\x00\x00\x00\x11\x11\x11\x11\x00\x00\x00\x00\x11\x11"
749 "\x11\x11\x00\x00\x00\x00\x11\x11\x11\x11\x00\x00\x00\x00\x11\x11\x11\x11"
750 "\x00\x00\x00\x00\x11\x11\x11\x11\x00\x00\x00\x00\x11\x11\x11\x11";
751
753}
754
755static VOID
758 HDC hdc,
759 LPRECT prcPaint,
760 LPRECT prcClient)
761{
762 GpGraphics *graphics;
763 INT ZoomedWidth, ZoomedHeight;
764 RECT rect, rcClient = *prcClient;
765 HDC hdcMem;
766 HBRUSH hBrush;
767 HPEN hPen;
768 HGDIOBJ hbrOld, hbmOld, hPenOld;
769 UINT uFlags;
770 HBITMAP hbmMem;
771 SIZE paintSize = { prcPaint->right - prcPaint->left, prcPaint->bottom - prcPaint->top };
772 COLORREF color0, color1;
773 GpImageAttributes *imageAttributes;
774
775 /* We use a memory bitmap to reduce flickering */
777 hbmMem = CreateCompatibleBitmap(hdc, paintSize.cx, paintSize.cy);
778 hbmOld = SelectObject(hdcMem, hbmMem);
779
780 /* Choose colors */
781 if (Preview_IsMainWnd(pData->m_hwnd))
782 {
783 color0 = GetSysColor(COLOR_WINDOW);
785 }
786 else
787 {
788 color0 = RGB(0, 0, 0);
789 color1 = RGB(255, 255, 255);
790 }
791
792 hBrush = CreateSolidBrush(color0);
793 SetBkColor(hdcMem, color0);
794
795 hPen = CreatePen(PS_SOLID, 1, color1);
796 SetTextColor(hdcMem, color1);
797
798 /* Fill background */
799 SetRect(&rect, 0, 0, paintSize.cx, paintSize.cy);
800 FillRect(hdcMem, &rect, hBrush);
801
802 DeleteObject(hBrush);
803
804 if (g_pImage == NULL)
805 {
806 WCHAR szText[128];
808
810 OffsetRect(&rcClient, -prcPaint->left, -prcPaint->top);
811 DrawTextW(hdcMem, szText, -1, &rcClient, DT_SINGLELINE | DT_CENTER | DT_VCENTER |
813 }
814 else
815 {
816 UINT ImageWidth, ImageHeight;
817
818 GdipGetImageWidth(g_pImage, &ImageWidth);
819 GdipGetImageHeight(g_pImage, &ImageHeight);
820
821 ZoomedWidth = (ImageWidth * pData->m_nZoomPercents) / 100;
822 ZoomedHeight = (ImageHeight * pData->m_nZoomPercents) / 100;
823
824 GdipCreateFromHDC(hdcMem, &graphics);
825 if (!graphics)
826 {
827 DPRINT1("error: GdipCreateFromHDC\n");
828 return;
829 }
830
832
833 if (pData->m_nZoomPercents % 100 == 0)
834 {
837 }
838 else
839 {
842 }
843
844 rect.left = (rcClient.right - ZoomedWidth ) / 2;
845 rect.top = (rcClient.bottom - ZoomedHeight) / 2;
846 rect.right = rect.left + ZoomedWidth;
847 rect.bottom = rect.top + ZoomedHeight;
849 -prcPaint->left - pData->m_xScrollOffset,
850 -prcPaint->top - pData->m_yScrollOffset);
851
852 InflateRect(&rect, +1, +1); /* Add Rectangle() pen width */
853
854 /* Draw a rectangle. Fill by checker board if necessary */
857 else
859 hPenOld = SelectObject(hdcMem, hPen);
860 Rectangle(hdcMem, rect.left, rect.top, rect.right, rect.bottom);
863
864 InflateRect(&rect, -1, -1); /* Subtract Rectangle() pen width */
865
866 /* Image attributes are required to draw image correctly */
867 GdipCreateImageAttributes(&imageAttributes);
869 GetBkColor(hdcMem) | 0xFF000000, TRUE);
870
871 /* Draw image. -0.5f is used for interpolation */
873 rect.left, rect.top,
874 rect.right - rect.left, rect.bottom - rect.top,
875 -0.5f, -0.5f, ImageWidth, ImageHeight,
876 UnitPixel, imageAttributes, NULL, NULL);
877
878 GdipDisposeImageAttributes(imageAttributes);
879 GdipDeleteGraphics(graphics);
880 }
881
882 BitBlt(hdc, prcPaint->left, prcPaint->top, paintSize.cx, paintSize.cy, hdcMem, 0, 0, SRCCOPY);
885}
886
887static VOID
889{
890 PAINTSTRUCT ps;
891 HDC hDC;
892 RECT rcClient;
893
894 hDC = BeginPaint(hwnd, &ps);
895 if (hDC)
896 {
897 GetClientRect(hwnd, &rcClient);
898 ZoomWnd_OnDraw(pData, hDC, &ps.rcPaint, &rcClient);
899 EndPaint(hwnd, &ps);
900 }
901}
902
903static VOID
905{
909 g_Settings.Width = 520;
910 g_Settings.Height = 400;
911}
912
913static BOOL
915{
916 HKEY hKey;
918 LSTATUS nError;
919
920 nError = RegOpenKeyExW(HKEY_CURRENT_USER, L"Software\\ReactOS\\shimgvw", 0, KEY_READ, &hKey);
921 if (nError != ERROR_SUCCESS)
922 return FALSE;
923
924 dwSize = sizeof(g_Settings);
925 nError = RegQueryValueExW(hKey, L"Settings", NULL, NULL, (LPBYTE)&g_Settings, &dwSize);
927
928 return ((nError == ERROR_SUCCESS) && (dwSize == sizeof(g_Settings)));
929}
930
931static VOID
933{
934 HKEY hKey;
935 LSTATUS nError;
936
937 nError = RegCreateKeyExW(HKEY_CURRENT_USER, L"Software\\ReactOS\\shimgvw",
938 0, NULL, 0, KEY_WRITE, NULL, &hKey, NULL);
939 if (nError != ERROR_SUCCESS)
940 return;
941
942 RegSetValueExW(hKey, L"Settings", 0, REG_BINARY, (LPBYTE)&g_Settings, sizeof(g_Settings));
944}
945
946static BOOL
948{
949 HWND hwndToolBar;
950 HIMAGELIST hImageList, hOldImageList;
952
953 if (!Preview_IsMainWnd(pData->m_hwnd))
954 return TRUE; /* FIXME */
955
956 style |= CCS_BOTTOM;
957 hwndToolBar = CreateWindowExW(0, TOOLBARCLASSNAMEW, NULL, style,
958 0, 0, 0, 0, pData->m_hwnd, (HMENU)IDC_TOOLBAR, g_hInstance, NULL);
959 if (!hwndToolBar)
960 return FALSE;
961
962 pData->m_hwndToolBar = hwndToolBar;
963
964 SendMessageW(hwndToolBar, TB_BUTTONSTRUCTSIZE, sizeof(s_Buttons[0]), 0);
966
968 if (hImageList == NULL)
969 return FALSE;
970
971 for (UINT n = 0; n < _countof(s_ButtonConfig); n++)
972 {
974 ImageList_AddMasked(hImageList, hBitmap, RGB(255, 255, 255));
976 }
977
978 hOldImageList = (HIMAGELIST)SendMessageW(hwndToolBar, TB_SETIMAGELIST, 0, (LPARAM)hImageList);
979 ImageList_Destroy(hOldImageList);
980
982
983 return TRUE;
984}
985
986static VOID
988{
990 return;
991
996}
997
998static VOID
1000{
1002}
1003
1004static VOID
1006{
1007 pData->m_bHideCursor = FALSE;
1008 KillTimer(pData->m_hwndZoom, HIDECURSOR_TIMER_ID);
1009}
1010
1011static VOID
1013{
1015 HWND hParent = GetParent(hwnd);
1016 if ((uMsg == WM_LBUTTONDOWN) || (uMsg == WM_RBUTTONDOWN))
1017 {
1018 if (!Preview_IsMainWnd(hParent))
1019 Preview_EndSlideShow(hParent);
1020 return;
1021 }
1022
1024 pData->m_nMouseDownMsg = uMsg;
1025 pData->m_ptOrigin.x = GET_X_LPARAM(lParam);
1026 pData->m_ptOrigin.y = GET_Y_LPARAM(lParam);
1029}
1030
1031static VOID
1033{
1036
1037 if (!Preview_IsMainWnd(pData->m_hwnd))
1038 {
1040 if (!pData->m_nMouseDownMsg)
1042 }
1043
1044 if (pData->m_nMouseDownMsg == WM_MBUTTONDOWN)
1045 {
1046 INT x = GetScrollPos(hwnd, SB_HORZ) - (pt.x - pData->m_ptOrigin.x);
1047 INT y = GetScrollPos(hwnd, SB_VERT) - (pt.y - pData->m_ptOrigin.y);
1050 pData->m_ptOrigin = pt;
1051 }
1052}
1053
1054static BOOL
1056{
1058 if (pData->m_nMouseDownMsg == WM_MBUTTONDOWN)
1059 {
1061 return TRUE;
1062 }
1063
1064 if (pData->m_bHideCursor)
1065 {
1066 SetCursor(NULL); /* Hide cursor in fullscreen */
1067 return TRUE;
1068 }
1069 return FALSE;
1070}
1071
1072static VOID
1074{
1076 BOOL wasdrag = pData->m_nMouseDownMsg == WM_MBUTTONDOWN;
1077
1078 pData->m_nMouseDownMsg = 0;
1079 if (wasdrag)
1080 GenerateSetCursor(hwnd, uMsg); /* Reset to default cursor */
1082
1083 if (!Preview_IsMainWnd(pData->m_hwnd))
1085}
1086
1087static VOID
1089{
1090 UINT ImageWidth, ImageHeight, ZoomedWidth, ZoomedHeight;
1091 RECT rcClient;
1092 UINT nBar = (bVertical ? SB_VERT : SB_HORZ);
1093 SCROLLINFO si = { sizeof(si), SIF_ALL };
1094 GetScrollInfo(hwnd, nBar, &si);
1095
1096 if (!g_pImage)
1097 return;
1098
1099 if (bVertical)
1100 {
1102 return;
1103 }
1104 else
1105 {
1107 return;
1108 }
1109
1110 switch (LOWORD(wParam))
1111 {
1112 case SB_THUMBTRACK:
1113 case SB_THUMBPOSITION:
1114 si.nPos = (SHORT)HIWORD(wParam);
1115 break;
1116 case SB_LINELEFT:
1117 si.nPos -= 48;
1118 break;
1119 case SB_LINERIGHT:
1120 si.nPos += 48;
1121 break;
1122 case SB_PAGELEFT:
1123 si.nPos -= si.nPage;
1124 break;
1125 case SB_PAGERIGHT:
1126 si.nPos += si.nPage;
1127 break;
1128 }
1129
1130 si.fMask = SIF_POS;
1131 SetScrollInfo(hwnd, nBar, &si, TRUE);
1132 GetScrollInfo(hwnd, nBar, &si);
1133
1134 GetClientRect(hwnd, &rcClient);
1135
1136 if (bVertical)
1137 {
1138 GdipGetImageHeight(g_pImage, &ImageHeight);
1139 ZoomedHeight = (ImageHeight * pData->m_nZoomPercents) / 100;
1140 pData->m_yScrollOffset = si.nPos - (ZoomedHeight - rcClient.bottom) / 2;
1141 }
1142 else
1143 {
1144 GdipGetImageWidth(g_pImage, &ImageWidth);
1145 ZoomedWidth = (ImageWidth * pData->m_nZoomPercents) / 100;
1146 pData->m_xScrollOffset = si.nPos - (ZoomedWidth - rcClient.right) / 2;
1147 }
1148
1150}
1151
1152static VOID
1154{
1156 if (zDelta == 0)
1157 return;
1158
1159 if (GetKeyState(VK_CONTROL) < 0)
1160 {
1161 Preview_ZoomInOrOut(pData, zDelta > 0);
1162 }
1163 else if (GetKeyState(VK_SHIFT) < 0)
1164 {
1165 if (zDelta > 0)
1167 else
1169 }
1170 else
1171 {
1172 if (zDelta > 0)
1174 else
1176 }
1177}
1178
1181{
1183 switch (uMsg)
1184 {
1185 case WM_LBUTTONDOWN:
1186 case WM_MBUTTONDOWN:
1187 case WM_RBUTTONDOWN:
1188 {
1190 break;
1191 }
1192 case WM_MOUSEMOVE:
1193 {
1195 break;
1196 }
1197 case WM_SETCURSOR:
1198 {
1199 if (!ZoomWnd_OnSetCursor(hwnd, uMsg, wParam, lParam))
1200 return DefWindowProcW(hwnd, uMsg, wParam, lParam);
1201 }
1202 case WM_LBUTTONUP:
1203 case WM_MBUTTONUP:
1204 case WM_RBUTTONUP:
1205 {
1207 goto doDefault;
1208 }
1209 case WM_LBUTTONDBLCLK:
1210 {
1211 if (Preview_IsMainWnd(pData->m_hwnd))
1213 break;
1214 }
1215 case WM_PAINT:
1216 {
1218 break;
1219 }
1220 case WM_MOUSEWHEEL:
1221 {
1224 break;
1225 }
1226 case WM_CONTEXTMENU:
1227 if (Preview_IsMainWnd(pData->m_hwnd) && *g_szFile)
1229 break;
1230 case WM_HSCROLL:
1231 case WM_VSCROLL:
1233 break;
1234 case WM_TIMER:
1235 {
1237 {
1239 if (IsWindowVisible(hwnd))
1240 {
1241 pData->m_bHideCursor = TRUE;
1242 GenerateSetCursor(hwnd, uMsg);
1243 }
1244 }
1245 if (Anime_OnTimer(&pData->m_Anime, wParam))
1246 {
1248 }
1249 break;
1250 }
1251 default: doDefault:
1252 {
1253 return DefWindowProcW(hwnd, uMsg, wParam, lParam);
1254 }
1255 }
1256 return 0;
1257}
1258
1259static BOOL
1261{
1262 DWORD exstyle = 0;
1263 HWND hwndZoom;
1265 pData->m_hwnd = hwnd;
1267
1269
1270 if (g_hMainWnd == NULL)
1271 {
1272 g_hMainWnd = hwnd;
1273 exstyle |= WS_EX_CLIENTEDGE;
1274 }
1275 else if (g_hwndFullscreen == NULL)
1276 {
1278 }
1279 else
1280 {
1281 return FALSE;
1282 }
1283
1284 hwndZoom = CreateWindowExW(exstyle, WC_ZOOM, NULL, WS_CHILD | WS_VISIBLE,
1285 0, 0, 0, 0, hwnd, NULL, g_hInstance, NULL);
1286 if (!hwndZoom)
1287 {
1289 return FALSE;
1290 }
1291
1292 pData->m_hwndZoom = hwndZoom;
1294 Anime_SetTimerWnd(&pData->m_Anime, pData->m_hwndZoom);
1295
1297 {
1299 return FALSE;
1300 }
1301
1302 if (pCS && pCS->lpCreateParams)
1303 {
1305 WCHAR szFile[MAX_PATH];
1306
1307 /* Make sure the path has no quotes on it */
1308 StringCchCopyW(szFile, _countof(szFile), pszFileName);
1309 PathUnquoteSpacesW(szFile);
1310
1313 }
1314
1315 return TRUE;
1316}
1317
1318static VOID
1320{
1321 WINDOWPLACEMENT wp;
1322 RECT *prc;
1323
1325 return;
1326
1327 wp.length = sizeof(WINDOWPLACEMENT);
1329
1330 /* Remember window position and size */
1331 prc = &wp.rcNormalPosition;
1332 g_Settings.X = prc->left;
1333 g_Settings.Y = prc->top;
1337}
1338
1339static VOID
1341{
1342 RECT rc, rcClient;
1344 HWND hToolBar = pData->m_hwndToolBar;
1345 INT cx, cy;
1346
1347 /* We want 32-bit values. Don't use WM_SIZE lParam */
1348 GetClientRect(hwnd, &rcClient);
1349 cx = rcClient.right;
1350 cy = rcClient.bottom;
1351
1352 if (Preview_IsMainWnd(pData->m_hwnd))
1353 {
1355 GetWindowRect(hToolBar, &rc);
1356
1357 MoveWindow(pData->m_hwndZoom, 0, 0, cx, cy - (rc.bottom - rc.top), TRUE);
1358
1359 if (pData->m_nZoomPercents > 100)
1361 else if (!IsIconic(hwnd)) /* Is it not minimized? */
1363
1365 }
1366 else
1367 {
1368 MoveWindow(pData->m_hwndZoom, 0, 0, cx, cy, TRUE);
1369 }
1370}
1371
1372static VOID
1374{
1375 WCHAR szCurFile[MAX_PATH + 1], szNextFile[MAX_PATH];
1376 SHFILEOPSTRUCTW FileOp = { pData->m_hwnd, FO_DELETE };
1377 UINT error;
1378
1379 /* FileOp.pFrom must be double-null-terminated */
1380 GetFullPathNameW(g_szFile, _countof(szCurFile) - 1, szCurFile, NULL);
1381 szCurFile[_countof(szCurFile) - 2] = UNICODE_NULL; /* Avoid buffer overrun */
1382 szCurFile[lstrlenW(szCurFile) + 1] = UNICODE_NULL;
1383
1384 szNextFile[0] = UNICODE_NULL;
1385 if (g_pCurrentFile)
1386 {
1387 GetFullPathNameW(g_pCurrentFile->Next->FileName, _countof(szNextFile), szNextFile, NULL);
1388 szNextFile[_countof(szNextFile) - 1] = UNICODE_NULL; /* Avoid buffer overrun */
1389 }
1390
1391 /* Confirm file deletion and delete if allowed */
1392 FileOp.pFrom = szCurFile;
1393 FileOp.fFlags = GetKeyState(VK_SHIFT) < 0 ? 0 : FOF_ALLOWUNDO;
1395 if (error)
1396 return;
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", g_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
1456 }
1457}
1458
1459static HRESULT
1461{
1463 LRESULT Ok = SendMessageW(hToolbar, TB_ISBUTTONENABLED, nCmdId, 0);
1464 return Ok ? S_OK : SendMessageW(hToolbar, TB_COMMANDTOINDEX, nCmdId, 0) != -1 ? S_FALSE : E_FAIL;
1465}
1466
1467static VOID
1469{
1471 UINT nCommandID = LOWORD(wParam);
1472 if ((!HIWORD(wParam) || !lParam) && IsCommandEnabled(nCommandID) == S_FALSE)
1473 {
1475 return;
1476 }
1477
1478 switch (nCommandID)
1479 {
1480 case IDC_PREV_PIC:
1482 break;
1483
1484 case IDC_NEXT_PIC:
1486 break;
1487
1488 case IDC_BEST_FIT:
1490 break;
1491
1492 case IDC_REAL_SIZE:
1494 break;
1495
1496 case IDC_SLIDE_SHOW:
1498 break;
1499
1500 case IDC_ZOOM_IN:
1502 break;
1503
1504 case IDC_ZOOM_OUT:
1506 break;
1507
1508 case IDC_ENDSLIDESHOW:
1510 break;
1511
1514 break;
1515
1516 case IDC_INCTIMER:
1517 case IDC_DECTIMER:
1519 break;
1520
1521 default:
1522 break;
1523 }
1524
1525 if (!Preview_IsMainWnd(hwnd))
1526 return;
1527
1528 // The following commands are for main window only:
1529 switch (nCommandID)
1530 {
1531 case IDC_SAVEAS:
1533 break;
1534
1535 case IDC_PRINT:
1537 break;
1538
1539 case IDC_ROT_CLOCKW:
1540 if (g_pImage)
1541 {
1544 }
1545 break;
1546
1547 case IDC_ROT_COUNCW:
1548 if (g_pImage)
1549 {
1552 }
1553 break;
1554
1555 case IDC_ROT_CWSAVE:
1556 if (g_pImage)
1557 {
1561 }
1562 break;
1563
1564 case IDC_ROT_CCWSAVE:
1565 if (g_pImage)
1566 {
1570 }
1571 break;
1572
1573 case IDC_DELETE:
1575 break;
1576
1577 case IDC_MODIFY:
1579 break;
1580
1581 case IDC_HELP_TOC:
1583 break;
1584
1585 default:
1586 break;
1587 }
1588}
1589
1590static LRESULT
1592{
1593 switch (pnmhdr->code)
1594 {
1595 case TTN_GETDISPINFOW:
1596 {
1597 LPTOOLTIPTEXTW lpttt = (LPTOOLTIPTEXTW)pnmhdr;
1598 lpttt->hinst = g_hInstance;
1599 lpttt->lpszText = MAKEINTRESOURCEW(s_ButtonConfig[lpttt->hdr.idFrom - IDC_TOOL_BASE].ids);
1600 break;
1601 }
1602 }
1603 return 0;
1604}
1605
1606static VOID
1608{
1610
1613
1616
1618
1619 SetWindowLongPtrW(pData->m_hwndZoom, GWLP_USERDATA, 0);
1620 DestroyWindow(pData->m_hwndZoom);
1621 pData->m_hwndZoom = NULL;
1622
1623 DestroyWindow(pData->m_hwndToolBar);
1624 pData->m_hwndToolBar = NULL;
1625
1628
1629 PostQuitMessage(0);
1630}
1631
1632static VOID
1634{
1635 WCHAR szFile[MAX_PATH];
1637
1638 DragQueryFileW(hDrop, 0, szFile, _countof(szFile));
1639
1643
1644 DragFinish(hDrop);
1645}
1646
1649{
1650 switch (uMsg)
1651 {
1652 case WM_CREATE:
1653 {
1655 return -1;
1656 break;
1657 }
1658 case WM_COMMAND:
1659 {
1661 break;
1662 }
1663 case WM_NOTIFY:
1664 {
1666 }
1667 case WM_GETMINMAXINFO:
1668 {
1669 MINMAXINFO *pMMI = (MINMAXINFO*)lParam;
1670 pMMI->ptMinTrackSize.x = 350;
1671 pMMI->ptMinTrackSize.y = 290;
1672 break;
1673 }
1674 case WM_MOVE:
1675 {
1677 break;
1678 }
1679 case WM_SIZE:
1680 {
1682 break;
1683 }
1684 case WM_DROPFILES:
1685 {
1687 break;
1688 }
1689 case WM_SYSCOLORCHANGE:
1690 {
1692 InvalidateRect(pData->m_hwnd, NULL, TRUE);
1693 InvalidateRect(pData->m_hwndZoom, NULL, TRUE);
1694 break;
1695 }
1696 case WM_DESTROY:
1697 {
1699 break;
1700 }
1701 case WM_CONTEXTMENU:
1702 {
1704 if ((int)lParam == -1)
1705 return ZoomWndProc(pData->m_hwndZoom, uMsg, wParam, lParam);
1706 break;
1707 }
1708 case WM_TIMER:
1709 {
1711 {
1714 }
1715 break;
1716 }
1718 {
1720 if (g_ImageId == lParam)
1722 break;
1723 }
1724 default:
1725 {
1726 return DefWindowProcW(hwnd, uMsg, wParam, lParam);
1727 }
1728 }
1729
1730 return 0;
1731}
1732
1733LONG
1735{
1736 struct GdiplusStartupInput gdiplusStartupInput;
1737 ULONG_PTR gdiplusToken;
1739 WCHAR szTitle[256];
1740 HWND hMainWnd;
1741 MSG msg;
1742 HACCEL hAccel;
1743 HRESULT hrCoInit;
1744 INITCOMMONCONTROLSEX Icc = { .dwSize = sizeof(Icc), .dwICC = ICC_WIN95_CLASSES };
1746
1748 SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_ABOVE_NORMAL); // Give UI higher priority than background threads
1749
1750 /* Initialize COM */
1751 hrCoInit = OleInitialize(NULL);
1752 if (FAILED(hrCoInit))
1753 DPRINT1("Warning, OleInitialize failed with code=%08X\n", (int)hrCoInit);
1754
1757
1758 /* Initialize GDI+ */
1759 ZeroMemory(&gdiplusStartupInput, sizeof(gdiplusStartupInput));
1760 gdiplusStartupInput.GdiplusVersion = 1;
1761 GdiplusStartup(&gdiplusToken, &gdiplusStartupInput, NULL);
1762
1763 /* Register window classes */
1764 ZeroMemory(&WndClass, sizeof(WndClass));
1765 WndClass.lpszClassName = WC_PREVIEW;
1766 WndClass.lpfnWndProc = PreviewWndProc;
1767 WndClass.hInstance = g_hInstance;
1768 WndClass.style = CS_HREDRAW | CS_VREDRAW;
1771 WndClass.hbrBackground = GetStockBrush(NULL_BRUSH); /* less flicker */
1772 if (!RegisterClassW(&WndClass))
1773 return -1;
1774 WndClass.lpszClassName = WC_ZOOM;
1775 WndClass.lpfnWndProc = ZoomWndProc;
1777 WndClass.hbrBackground = GetStockBrush(NULL_BRUSH); /* less flicker */
1778 if (!RegisterClassW(&WndClass))
1779 return -1;
1780
1781 /* Create the main window */
1786 NULL, NULL, g_hInstance, (LPVOID)szFileName);
1787
1788 /* Create accelerator table for keystrokes */
1790
1791 /* Show the main window now */
1794 else
1796
1798
1799 /* Message Loop */
1800 while (GetMessageW(&msg, NULL, 0, 0) > 0)
1801 {
1802 const HWND hwndFull = g_hwndFullscreen;
1803 if (IsWindowVisible(hwndFull) && TranslateAcceleratorW(hwndFull, hAccel, &msg))
1804 continue;
1806 continue;
1807
1810 }
1811
1812 /* Destroy accelerator table */
1814
1816
1817 GdiplusShutdown(gdiplusToken);
1818
1819 /* Release COM resources */
1820 if (SUCCEEDED(hrCoInit))
1822
1823 return 0;
1824}
1825
1828{
1830}
1831
1834{
1836}
1837
1840{
1841 WCHAR szFile[MAX_PATH];
1842
1843 if (MultiByteToWideChar(CP_ACP, 0, path, -1, szFile, _countof(szFile)))
1844 {
1845 ImageView_Main(hwnd, szFile);
1846 }
1847}
1848
1851{
1852 DPRINT("ImageView_PrintTo() not implemented\n");
1853}
1854
1857{
1858 DPRINT("ImageView_PrintToA() not implemented\n");
1859}
1860
1863{
1864 DPRINT("ImageView_PrintToW() not implemented\n");
1865}
1866
1871{
1872 switch (dwReason)
1873 {
1874 case DLL_PROCESS_ATTACH:
1875 g_hInstance = hinstDLL;
1876 break;
1877 }
1878
1879 return TRUE;
1880}
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 E_FAIL
Definition: ddrawi.h:102
#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 OleInitialize(LPVOID reserved)
Definition: ole2.c:169
void WINAPI DECLSPEC_HOTPATCH OleUninitialize(void)
Definition: ole2.c:230
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:47
#define IDC_SLIDE_SHOW
Definition: resource.h:46
#define IDC_ROT_COUNCW
Definition: resource.h:50
#define IDC_REAL_SIZE
Definition: resource.h:45
#define IDC_MODIFY
Definition: resource.h:56
#define IDC_INCTIMER
Definition: resource.h:39
#define IDC_ENDSLIDESHOW
Definition: resource.h:58
#define IDC_NEXT_PIC
Definition: resource.h:43
#define IDI_APP_ICON
Definition: resource.h:4
#define IDC_ROT_CWSAVE
Definition: resource.h:51
#define IDC_PREV_PIC
Definition: resource.h:42
#define IDC_BEST_FIT
Definition: resource.h:44
#define IDS_NOPREVIEW
Definition: resource.h:80
#define IDR_ACCELERATOR
Definition: resource.h:111
#define IDC_DECTIMER
Definition: resource.h:40
#define IDC_DELETE
Definition: resource.h:53
#define IDC_HELP_TOC
Definition: resource.h:57
#define IDC_TOGGLEFULLSCREEN
Definition: resource.h:38
#define IDC_ZOOM_OUT
Definition: resource.h:48
#define IDC_ROT_CLOCKW
Definition: resource.h:49
#define IDC_TOOL_BASE
Definition: resource.h:35
#define IDC_ROT_CCWSAVE
Definition: resource.h:52
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 S_OK
Definition: intsafe.h:52
#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
#define error(str)
Definition: mkdosfs.c:1605
#define ERROR_FILE_NOT_FOUND
Definition: disk.h:79
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
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:63
#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
#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 TB_ISBUTTONENABLED
Definition: commctrl.h:1048
#define TB_COMMANDTOINDEX
Definition: commctrl.h:1111
#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:1011
static BOOL Preview_OnCreate(HWND hwnd, LPCREATESTRUCT pCS)
Definition: shimgvw.c:1260
static VOID Preview_ResetZoom(PPREVIEW_DATA pData)
Definition: shimgvw.c:304
static VOID Preview_Delete(PPREVIEW_DATA pData)
Definition: shimgvw.c:1373
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:1862
static VOID Preview_ToggleSlideShow(PPREVIEW_DATA pData)
Definition: shimgvw.c:1440
static HRESULT IsCommandEnabled(UINT nCmdId)
Definition: shimgvw.c:1460
#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:1153
static BOOL ZoomWnd_OnSetCursor(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: shimgvw.c:1055
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:756
#define SLIDESHOW_TIMER_INTERVAL
Definition: shimgvw.c:26
static VOID Preview_UpdateImage(PPREVIEW_DATA pData)
Definition: shimgvw.c:578
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:1180
LONG ImageView_Main(HWND hwnd, LPCWSTR szFileName)
Definition: shimgvw.c:1734
static VOID Preview_OnCommand(HWND hwnd, WPARAM wParam, LPARAM lParam)
Definition: shimgvw.c:1468
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:562
static const TBBUTTON s_Buttons[]
Definition: shimgvw.c:55
struct tagPREVIEW_DATA * PPREVIEW_DATA
static VOID Preview_OnSize(HWND hwnd)
Definition: shimgvw.c:1340
#define MAX_ZOOM
Definition: shimgvw.c:45
static VOID GenerateSetCursor(HWND hwnd, UINT uMsg)
Definition: shimgvw.c:999
#define MIN_ZOOM
Definition: shimgvw.c:44
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:1868
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:1032
static VOID Preview_ChangeSlideShowTimer(PPREVIEW_DATA pData, BOOL bSlower)
Definition: shimgvw.c:152
static BOOL Preview_CreateToolBar(PPREVIEW_DATA pData)
Definition: shimgvw.c:947
static VOID ZoomWnd_OnHVScroll(PPREVIEW_DATA pData, HWND hwnd, WPARAM wParam, BOOL bVertical)
Definition: shimgvw.c:1088
static VOID Preview_pLoadImageFromNode(PPREVIEW_DATA pData, SHIMGVW_FILENODE *pNode)
Definition: shimgvw.c:412
EXTERN_C PCWSTR GetExtraExtensionsGdipList(VOID)
Definition: loader.cpp:131
static VOID Preview_EndSlideShow(HWND hwnd)
Definition: shimgvw.c:987
#define DEFINE_BTN_SEPARATOR
Definition: shimgvw.c:51
#define TB_IMAGE_WIDTH
Definition: shimgvw.c:21
SHIMGVW_SETTINGS g_Settings
Definition: shimgvw.c:36
static VOID Preview_pLoadImage(PPREVIEW_DATA pData, LPCWSTR szOpenFileName)
Definition: shimgvw.c:380
static VOID Preview_OnMoveSize(HWND hwnd)
Definition: shimgvw.c:1319
LRESULT CALLBACK PreviewWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: shimgvw.c:1648
static SHIMGVW_FILENODE * pBuildFileList(LPCWSTR szFirstFile)
Definition: shimgvw.c:595
WCHAR g_szFile[MAX_PATH]
Definition: shimgvw.c:34
static VOID Preview_OnDropFiles(HWND hwnd, HDROP hDrop)
Definition: shimgvw.c:1633
static const TB_BUTTON_CONFIG s_ButtonConfig[]
Definition: shimgvw.c:90
static LRESULT Preview_OnNotify(HWND hwnd, LPNMHDR pnmhdr)
Definition: shimgvw.c:1591
static BOOL ImageView_LoadSettings(VOID)
Definition: shimgvw.c:914
static VOID ZoomWnd_StopHideCursor(PPREVIEW_DATA pData)
Definition: shimgvw.c:1005
HWND g_hwndFullscreen
Definition: shimgvw.c:32
static VOID ImageView_SaveSettings(VOID)
Definition: shimgvw.c:932
static VOID ImageView_ResetSettings(VOID)
Definition: shimgvw.c:904
#define DEFINE_BTN_CONFIG(_name)
Definition: shimgvw.c:88
static VOID ZoomWnd_OnPaint(PPREVIEW_DATA pData, HWND hwnd)
Definition: shimgvw.c:888
static VOID Preview_ZoomInOrOut(PPREVIEW_DATA pData, BOOL bZoomIn)
Definition: shimgvw.c:270
static VOID Preview_UpdateUI(PPREVIEW_DATA pData)
Definition: shimgvw.c:568
static VOID Preview_pSaveImageAs(PPREVIEW_DATA pData)
Definition: shimgvw.c:465
UINT g_ImageId
Definition: shimgvw.c:37
static const UINT s_ZoomSteps[]
Definition: shimgvw.c:39
HINSTANCE g_hInstance
Definition: shimgvw.c:30
VOID WINAPI ImageView_Fullscreen(HWND hwnd, HINSTANCE hInst, LPCWSTR path, int nShow)
Definition: shimgvw.c:1833
VOID WINAPI ImageView_FullscreenA(HWND hwnd, HINSTANCE hInst, LPCSTR path, int nShow)
Definition: shimgvw.c:1839
#define HIDECURSOR_TIMER_ID
Definition: shimgvw.c:27
static VOID Preview_OnDestroy(HWND hwnd)
Definition: shimgvw.c:1607
static VOID Preview_LoadImage(PPREVIEW_DATA pData, SHIMGVW_FILENODE *pNode)
Definition: shimgvw.c:587
static BOOL Preview_pSaveImage(PPREVIEW_DATA pData, LPCWSTR pszFile)
Definition: shimgvw.c:418
VOID WINAPI ImageView_PrintToA(HWND hwnd, HINSTANCE hInst, LPCSTR path, int nShow)
Definition: shimgvw.c:1856
VOID WINAPI ImageView_FullscreenW(HWND hwnd, HINSTANCE hInst, LPCWSTR path, int nShow)
Definition: shimgvw.c:1827
static HBRUSH CreateCheckerBoardBrush(VOID)
Definition: shimgvw.c:735
static VOID ZoomWnd_OnButtonUp(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: shimgvw.c:1073
static VOID Preview_UpdateTitle(PPREVIEW_DATA pData, LPCWSTR FileName)
Definition: shimgvw.c:350
#define DEFINE_BTN_INFO(_name)
Definition: shimgvw.c:48
static VOID ZoomWnd_OnButtonDown(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: shimgvw.c:1012
#define HIDECURSOR_TIMER_TIMEOUT
Definition: shimgvw.c:28
VOID WINAPI ImageView_PrintTo(HWND hwnd, HINSTANCE hInst, LPCWSTR path, int nShow)
Definition: shimgvw.c:1850
static VOID pFreeFileList(SHIMGVW_FILENODE *root)
Definition: shimgvw.c:717
GpImage * g_pImage
Definition: shimgvw.c:35
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:209
#define WM_UPDATECOMMANDSTATE
Definition: shimgvw.h:33
void ShellExecuteVerb(HWND hwnd, PCWSTR Verb, PCWSTR File, BOOL Quit)
Definition: util.c:225
void DoShellContextMenuOnFile(HWND hwnd, PCWSTR File, LPARAM lParam)
Definition: util.c:152
#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:82
void DisplayHelp(HWND hwnd)
Definition: util.c:253
static VOID QuickFree(LPVOID ptr)
Definition: shimgvw.h:87
int WINAPI SHFileOperationW(LPSHFILEOPSTRUCTW lpFileOp)
Definition: shlfileop.cpp:2200
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:3306
LPVOID lpCreateParams
Definition: winuser.h:2951
POINT ptMinTrackSize
Definition: winuser.h:3641
UINT code
Definition: winuser.h:3170
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:117
POINT m_ptOrigin
Definition: shimgvw.c:122
HWND m_hwndToolBar
Definition: shimgvw.c:114
BOOL m_bHideCursor
Definition: shimgvw.c:121
INT m_nZoomPercents
Definition: shimgvw.c:115
HWND m_hwndZoom
Definition: shimgvw.c:113
UINT m_nMouseDownMsg
Definition: shimgvw.c:119
UINT m_nTimerInterval
Definition: shimgvw.c:120
ANIME m_Anime
Definition: shimgvw.c:116
INT m_yScrollOffset
Definition: shimgvw.c:118
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:1743
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 S_FALSE
Definition: winerror.h:2357
#define ERROR_PATH_NOT_FOUND
Definition: winerror.h:106
#define HRESULT_FROM_WIN32(x)
Definition: winerror.h:92
#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:781
#define WM_PAINT
Definition: winuser.h:1631
HWND WINAPI SetCapture(_In_ HWND hWnd)
#define CS_VREDRAW
Definition: winuser.h:666
#define SW_SHOWMAXIMIZED
Definition: winuser.h:784
DWORD WINAPI GetSysColor(_In_ int)
#define MAKEWPARAM(l, h)
Definition: winuser.h:4020
BOOL WINAPI IsWindow(_In_opt_ HWND)
#define SW_HIDE
Definition: winuser.h:779
#define DT_NOPREFIX
Definition: winuser.h:537
#define SB_THUMBTRACK
Definition: winuser.h:573
#define GetWindowLongPtrW
Definition: winuser.h:4840
#define SB_LINEUP
Definition: winuser.h:564
#define WM_HSCROLL
Definition: winuser.h:1754
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define COLOR_WINDOW
Definition: winuser.h:929
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:932
#define WM_VSCROLL
Definition: winuser.h:1755
BOOL WINAPI GetWindowPlacement(_In_ HWND, _Inout_ WINDOWPLACEMENT *)
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
#define WM_CREATE
Definition: winuser.h:1619
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:1622
#define SB_VERT
Definition: winuser.h:553
#define WM_DROPFILES
Definition: winuser.h:1836
#define DT_SINGLELINE
Definition: winuser.h:540
#define WM_LBUTTONDBLCLK
Definition: winuser.h:1789
#define WM_COMMAND
Definition: winuser.h:1751
#define CS_HREDRAW
Definition: winuser.h:661
ATOM WINAPI RegisterClassW(_In_ CONST WNDCLASSW *)
#define IDC_ARROW
Definition: winuser.h:695
#define VK_CONTROL
Definition: winuser.h:2214
#define WM_RBUTTONUP
Definition: winuser.h:1791
HCURSOR WINAPI SetCursor(_In_opt_ HCURSOR)
#define WM_MOUSEMOVE
Definition: winuser.h:1786
#define SB_LINERIGHT
Definition: winuser.h:567
#define CS_DBLCLKS
Definition: winuser.h:659
#define WM_LBUTTONDOWN
Definition: winuser.h:1787
BOOL WINAPI MessageBeep(_In_ UINT uType)
#define WM_SYSCOLORCHANGE
Definition: winuser.h:1637
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2443
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
BOOL WINAPI IsIconic(_In_ HWND)
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_RBUTTONDOWN
Definition: winuser.h:1790
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:1651
#define WM_TIMER
Definition: winuser.h:1753
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:1243
#define HTCLIENT
Definition: winuser.h:2486
#define SendMessage
Definition: winuser.h:5863
#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:1788
#define MB_ICONWARNING
Definition: winuser.h:797
#define DT_VCENTER
Definition: winuser.h:543
#define PostMessage
Definition: winuser.h:5852
#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:1621
LRESULT WINAPI DispatchMessageW(_In_ const MSG *)
#define SIF_POS
Definition: winuser.h:1245
int WINAPI TranslateAcceleratorW(_In_ HWND, _In_ HACCEL, _In_ LPMSG)
#define WM_SETCURSOR
Definition: winuser.h:1647
BOOL WINAPI OffsetRect(_Inout_ LPRECT, _In_ int, _In_ int)
#define VK_SHIFT
Definition: winuser.h:2213
#define SW_SHOW
Definition: winuser.h:786
int WINAPI SetScrollInfo(_In_ HWND, _In_ int, _In_ LPCSCROLLINFO, _In_ BOOL)
#define WM_DESTROY
Definition: winuser.h:1620
#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:2501
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:5366
BOOL WINAPI InflateRect(_Inout_ LPRECT, _In_ int, _In_ int)
#define WM_MBUTTONUP
Definition: winuser.h:1794
struct _WINDOWPLACEMENT WINDOWPLACEMENT
#define GWL_STYLE
Definition: winuser.h:863
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:2413
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)
#define WM_MBUTTONDOWN
Definition: winuser.h:1793
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
#define IDC_TOOLBAR
Definition: wordpad.h:157
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