1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-14 01:27:35 -05:00

Fix double-keystrokes by wrapping CreateDialog

[originally from svn r3267]
This commit is contained in:
Owen Dunn
2003-06-16 23:55:26 +00:00
parent 68da549341
commit 27d54e8f96
3 changed files with 54 additions and 6 deletions

View File

@ -6,6 +6,7 @@
#include <stdio.h>
#include <stdlib.h>
#include "putty.h"
#include "winstuff.h"
void platform_get_x11_auth(char *display, int *proto,
unsigned char *data, int *datalen)
@ -36,6 +37,31 @@ int filename_is_null(Filename fn)
return !*fn.path;
}
int SaneDialogBox(HINSTANCE hinst,
LPCTSTR tmpl,
HWND hwndparent,
DLGPROC lpDialogFunc)
{
HWND boxhwnd;
MSG msg;
boxhwnd = CreateDialog(hinst, tmpl, hwndparent, lpDialogFunc);
while (GetMessage(&msg, NULL, 0, 0)) {
if (!(boxinfo.flags & DF_END) && !IsDialogMessage(boxhwnd, &msg))
DispatchMessage(&msg);
if (boxinfo.flags & DF_END) break;
}
boxinfo.flags=0;
return boxinfo.result;
}
void SaneEndDialog(HWND hwnd, int ret)
{
boxinfo.result = ret;
boxinfo.flags |= DF_END;
DestroyWindow(hwnd);
}
#ifdef DEBUG
static FILE *debug_fp = NULL;
static HANDLE debug_hdl = INVALID_HANDLE_VALUE;