summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/windows/winmain.c61
1 files changed, 29 insertions, 32 deletions
diff --git a/apps/windows/winmain.c b/apps/windows/winmain.c
index d59aa069..c02bd173 100644
--- a/apps/windows/winmain.c
+++ b/apps/windows/winmain.c
@@ -346,20 +346,17 @@ void winopen()
CW_USEDEFAULT, CW_USEDEFAULT, // initial position
300, // initial x size
300, // initial y size
- NULL, // parent window handle
- NULL, // window menu handle
- 0,//hInstance, // program instance handle
- NULL); // creation parameters
+ 0, // parent window handle
+ 0, // window menu handle
+ 0, // program instance handle
+ 0); // creation parameters
hwndview = CreateWindow("ViewWindow", // window class name
- NULL, // window caption
+ NULL,
WS_VISIBLE | WS_CHILD,
CW_USEDEFAULT, CW_USEDEFAULT,
CW_USEDEFAULT, CW_USEDEFAULT,
- hwndframe, // parent window handle
- NULL, // window menu handle
- 0,//hInstance, // program instance handle
- NULL); // creation parameters
+ hwndframe, 0, 0, 0);
hdc = NULL;
@@ -623,6 +620,23 @@ frameproc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
SetFocus(hwndview);
return 0;
+ case WM_DESTROY:
+ PostQuitMessage(0);
+ return 0;
+
+ case WM_SYSCOMMAND:
+ if (wParam == ID_ABOUT)
+ {
+ help();
+ return 0;
+ }
+ if (wParam == ID_DOCINFO)
+ {
+ info();
+ return 0;
+ }
+ break;
+
case WM_SIZE:
{
// More generally, you should use GetEffectiveClientRect
@@ -634,11 +648,15 @@ frameproc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
}
return 0;
+ case WM_SIZING:
+ gapp.shrinkwrap = 0;
+ break;
+
case WM_NOTIFY:
case WM_COMMAND:
- case WM_SYSCOMMAND:
return SendMessage(hwndview, message, wParam, lParam);
}
+
return DefWindowProc(hwnd, message, wParam, lParam);
}
@@ -652,34 +670,13 @@ viewproc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
switch (message)
{
- case WM_DESTROY:
- PostQuitMessage(0);
- return 0;
-
- case WM_SYSCOMMAND:
- if (wParam == ID_ABOUT)
- {
- help();
- return 0;
- }
- if (wParam == ID_DOCINFO)
- {
- info();
- return 0;
- }
- break;
-
case WM_SIZE:
if (wParam == SIZE_MINIMIZED)
return 0;
if (wParam == SIZE_MAXIMIZED)
gapp.shrinkwrap = 0;
pdfapp_onresize(&gapp, LOWORD(lParam), HIWORD(lParam));
- return 0;
-
- case WM_SIZING:
- gapp.shrinkwrap = 0;
- return 0;
+ break;
/* Paint events are low priority and automagically catenated
* so we don't need to do any fancy waiting to defer repainting.