#include <windows.h>
#include <stdio.h>
#include "vfdtypes.h"
#include "vfdapi.h"
#include "vfdlib.h"
#include "vfdmsg.h"
#include "vfdguirc.h"
Go to the source code of this file.
|
static PSTR | FormatSizeBytes (ULONG size, PSTR buf) |
|
static PSTR | FormatSizeUnits (ULONG size, PSTR buf) |
|
DWORD WINAPI | VfdGuiClose (HWND hParent, ULONG nDevice) |
|
DWORD WINAPI | VfdGuiFormat (HWND hParent, ULONG nDevice) |
|
void | SetControlText (HWND hWnd, UINT nCtrl, DWORD nMsg) |
|
void WINAPI | VfdMakeFileDesc (PSTR pBuffer, ULONG nBufSize, VFD_FILETYPE nFileType, ULONG nFileSize, DWORD nFileAttr) |
|
void | ShowContextMenu (HWND hDlg, HWND hCtl, LPARAM lParam) |
|
void | ShowHelpWindow (HWND hDlg, UINT nCtl) |
|
◆ IDCONTINUE
◆ IDTRYAGAIN
◆ MB_CANCELTRYCONTINUE
#define MB_CANCELTRYCONTINUE 0x00000006L |
◆ WIN32_LEAN_AND_MEAN
◆ FormatSizeBytes()
Definition at line 48 of file vfdguiut.c.
49{
52
53 while ((comma * 1000) <
size) {
54 comma *= 1000;
55 }
56
58
59 while (comma > 1) {
61 comma /= 1000;
63 }
64
66}
GLenum GLuint GLenum GLsizei const GLchar * buf
#define sprintf(buf, format,...)
Referenced by FormatSizeUnits(), and VfdMakeFileDesc().
◆ FormatSizeUnits()
Definition at line 68 of file vfdguiut.c.
69{
70 static const char *
name[3] = {
71 " KB", " MB", " GB"
72 };
74 double dsize;
75
77#ifndef __REACTOS__
79#else
81#endif
83 }
84
86 dsize /= 1024;
88
89 while (unit < 2 && dsize >= 1000) {
90 dsize /= 1000;
92 }
93
94 if (dsize < 10) {
96 }
97 else if (dsize < 100) {
99 }
100 else if (dsize < 1000) {
102 }
103 else {
106 }
107
109}
char * strcat(char *DstString, const char *SrcString)
png_const_structrp png_const_inforp int * unit
static PSTR FormatSizeBytes(ULONG size, PSTR buf)
Referenced by VfdMakeFileDesc().
◆ SetControlText()
◆ ShowContextMenu()
Definition at line 456 of file vfdguiut.c.
460{
464
467
468 if (
pt.x == -1 ||
pt.y == -1) {
470
474
476 }
477 else {
479
481
484 }
485
488 return;
489 }
490
492
494
497 {
499 }
500
502}
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
#define IDC_IMAGEFILE_LABEL
void ShowHelpWindow(HWND hDlg, UINT nCtl)
HWND WINAPI ChildWindowFromPoint(_In_ HWND, _In_ POINT)
HMENU WINAPI CreatePopupMenu(void)
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI DestroyMenu(_In_ HMENU)
int WINAPI GetDlgCtrlID(_In_ HWND)
BOOL WINAPI TrackPopupMenu(_In_ HMENU, _In_ UINT, _In_ int, _In_ int, _Reserved_ int, _In_ HWND, _Reserved_ LPCRECT)
BOOL WINAPI ScreenToClient(_In_ HWND, _Inout_ LPPOINT)
◆ ShowHelpWindow()
Definition at line 507 of file vfdguiut.c.
510{
514
515 switch (nCtl) {
518 msg = MSG_HELP_IMAGEFILE;
519 break;
522 msg = MSG_HELP_IMAGEDESC;
523 break;
526 msg = MSG_HELP_TARGETFILE;
527 break;
532 msg = MSG_HELP_DISKTYPE;
533 break;
536 msg = MSG_HELP_MEDIATYPE;
537 break;
539 msg = MSG_HELP_PROTECT_NOW;
540 break;
542 msg = MSG_HELP_PROTECT_OPEN;
543 break;
545 msg = MSG_HELP_BROWSE;
546 break;
549 break;
552 break;
554 msg = MSG_HELP_CLOSE;
555 break;
557 msg = MSG_HELP_FORMAT;
558 break;
560 msg = MSG_HELP_CONTROL;
561 break;
563 msg = MSG_HELP_OVERWRITE;
564 break;
566 msg = MSG_HELP_TRUNCATE;
567 break;
568 default:
569 return;
570 }
571
573
575
579 }
580}
void WINAPI VfdToolTip(HWND hParent, PCSTR sText, int pos_x, int pos_y, BOOL stick)
#define IDC_MEDIATYPE_LABEL
#define IDC_WRITE_PROTECTED
#define IDC_DISKTYPE_LABEL
#define IDC_DISKTYPE_FILE
#define IDC_OPEN_PROTECTED
#define IDC_IMAGEFILE_DESC
#define IDC_TARGETFILE_LABEL
#define IDC_IMAGEDESC_LABEL
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
Referenced by OpenDialogProc(), SaveDialogProc(), ShowContextMenu(), and VfdPageDlgProc().
◆ VfdGuiClose()
Definition at line 114 of file vfdguiut.c.
117{
123 int reply;
124
126
128
131 }
132
133
134
136 hDevice,
143
147 }
148
149 param.hDevice = hDevice;
151
152
153
156
157 for (;;) {
160
161 if (reply !=
IDYES) {
162 break;
163 }
164
166 break;
167 }
168 }
169
172 }
173
177 }
178 }
179
180
181
183
184 for (;;) {
185
186
187
189
190
191
193
194
195
197
199
200 break;
201 }
202
204
205
206
207
209
213
216 }
217 }
218 else {
219
220
221
222
224
228
231 }
232
234
235
236
238 }
239 }
240
243 break;
244 }
246
247
248
250 break;
251 }
252 }
253
255
257}
#define INVALID_HANDLE_VALUE
#define ERROR_ACCESS_DENIED
DWORD WINAPI VfdGetImageInfo(HANDLE hDevice, PSTR sFileName, PVFD_DISKTYPE pDiskType, PVFD_MEDIA pMediaType, PVFD_FLAGS pMediaFlags, PVFD_FILETYPE pFileType, PULONG pImageSize)
HANDLE WINAPI VfdOpenDevice(ULONG nTarget)
#define VFDTRACE(LEVEL, STRING)
VOID VfdCloseImage(IN PDEVICE_EXTENSION DeviceExtension)
DWORD GuiSaveParam(HWND hParent, PCSAVE_PARAM pParam)
#define MB_CANCELTRYCONTINUE
#define VFD_FLAG_DATA_MODIFIED
DWORD WINAPI GetLastError(void)
HCURSOR WINAPI SetCursor(_In_opt_ HCURSOR)
#define MB_ICONEXCLAMATION
Referenced by CVfdShExt::DoVfdClose().
◆ VfdGuiFormat()
Definition at line 262 of file vfdguiut.c.
265{
269
271
276
279 }
280
285
287 }
288
290
293 }
294 else {
296
297retry:
299
301
304 int reply;
305
307
309
313
316 }
317
319 goto retry;
320 }
323 }
324 else {
327 }
328 }
329
332 }
333
335
337 }
338
343
345}
DWORD WINAPI VfdFormatMedia(HANDLE hDevice)
DWORD WINAPI VfdDismountVolume(HANDLE hDevice, BOOL bForce)
PCSTR SystemMessage(DWORD nError)
#define MB_ICONINFORMATION
Referenced by VfdPageDlgProc().
◆ VfdMakeFileDesc()
Definition at line 376 of file vfdguiut.c.
382{
388
390
391 switch (nFileType) {
394 break;
395
398 break;
399
400 default:
402 }
403
406 }
407 else {
412 }
413
417
421 }
422
425 }
426
429 }
430 }
431
433 type_str ? type_str : "",
434 size_str ? size_str : "",
435 attr_ro ? attr_ro : "",
437 attr_enc ? attr_enc : "");
438
439 if (type_str) {
441 }
442 if (size_str) {
444 }
445 if (attr_ro) {
447 }
450 }
451 if (attr_enc) {
453 }
454}
int attr_cmp(struct attr_cache_entry *lhs, struct attr_cache_entry *rhs)
#define FILE_ATTRIBUTE_READONLY
#define FILE_ATTRIBUTE_COMPRESSED
#define FILE_ATTRIBUTE_ENCRYPTED
#define INVALID_FILE_ATTRIBUTES
static PSTR FormatSizeUnits(ULONG size, PSTR buf)
#define INVALID_FILE_SIZE
Referenced by OnImage(), OnTarget(), PrintImageInfo(), UpdateImageInfo(), and VfdImageTip().