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:
26
winmisc.c
26
winmisc.c
@ -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;
|
||||
|
Reference in New Issue
Block a user