X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/putty/blobdiff_plain/c0a8159289da8df577cc28be1f0c9f7f5c8d33c1..e8e8d6e2aaec02b9687ca8f2029bb6473acb0ec7:/window.c diff --git a/window.c b/window.c index 987a8450..aa6b6809 100644 --- a/window.c +++ b/window.c @@ -312,7 +312,7 @@ int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show) int argc, i; char **argv; - split_into_argv(cmdline, &argc, &argv); + split_into_argv(cmdline, &argc, &argv, NULL); for (i = 0; i < argc; i++) { char *p = argv[i]; @@ -2061,6 +2061,17 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, colours[(ATTR_DEFBG>>ATTR_BGSHIFT)*2]); oldpen = SelectObject(hdc, edge); + /* + * Jordan Russell reports that this apparently + * ineffectual IntersectClipRect() call masks a + * Windows NT/2K bug causing strange display + * problems when the PuTTY window is taller than + * the primary monitor. It seems harmless enough... + */ + IntersectClipRect(hdc, + p.rcPaint.left, p.rcPaint.top, + p.rcPaint.right, p.rcPaint.bottom); + ExcludeClipRect(hdc, offset_width, offset_height, offset_width+font_width*cols, @@ -3393,6 +3404,12 @@ static int TranslateKey(UINT message, WPARAM wParam, LPARAM lParam, *p++ = 0; return -2; } + if (wParam == VK_BACK && shift_state == 1) { /* Shift Backspace */ + /* We do the opposite of what is configured */ + *p++ = (cfg.bksp_is_delete ? 0x08 : 0x7F); + *p++ = 0; + return -2; + } if (wParam == VK_TAB && shift_state == 1) { /* Shift tab */ *p++ = 0x1B; *p++ = '['; @@ -3806,6 +3823,16 @@ static int TranslateKey(UINT message, WPARAM wParam, LPARAM lParam, return -1; } +void request_paste(void) +{ + /* + * In Windows, pasting is synchronous: we can read the + * clipboard with no difficulty, so request_paste() can just go + * ahead and paste. + */ + term_do_paste(); +} + void set_title(char *title) { sfree(window_name); @@ -4191,6 +4218,22 @@ void fatalbox(char *fmt, ...) } /* + * Print a modal (Really Bad) message box and perform a fatal exit. + */ +void modalfatalbox(char *fmt, ...) +{ + va_list ap; + char stuff[200]; + + va_start(ap, fmt); + vsprintf(stuff, fmt, ap); + va_end(ap); + MessageBox(hwnd, stuff, "PuTTY Fatal Error", + MB_SYSTEMMODAL | MB_ICONERROR | MB_OK); + cleanup_exit(1); +} + +/* * Manage window caption / taskbar flashing, if enabled. * 0 = stop, 1 = maintain, 2 = start */