亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? window.c

?? 遠程登陸工具軟件源碼 用于遠程登陸unix
?? C
?? 第 1 頁 / 共 5 頁
字號:
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <time.h>
#include <assert.h>

#define PUTTY_DO_GLOBALS	       /* actually _define_ globals */
#include "putty.h"
#include "terminal.h"
#include "storage.h"
#include "win_res.h"

#ifndef NO_MULTIMON
#if WINVER < 0x0500
#define COMPILE_MULTIMON_STUBS
#include <multimon.h>
#endif
#endif

#include <imm.h>
#include <commctrl.h>
#include <richedit.h>
#include <mmsystem.h>

#define IDM_SHOWLOG   0x0010
#define IDM_NEWSESS   0x0020
#define IDM_DUPSESS   0x0030
#define IDM_RECONF    0x0040
#define IDM_CLRSB     0x0050
#define IDM_RESET     0x0060
#define IDM_HELP      0x0140
#define IDM_ABOUT     0x0150
#define IDM_SAVEDSESS 0x0160
#define IDM_COPYALL   0x0170
#define IDM_FULLSCREEN	0x0180
#define IDM_PASTE     0x0190

#define IDM_SESSLGP   0x0250	       /* log type printable */
#define IDM_SESSLGA   0x0260	       /* log type all chars */
#define IDM_SESSLGE   0x0270	       /* log end */

#define IDM_SPECIAL_MIN 0x0400
#define IDM_SPECIAL_MAX 0x0800

#define IDM_SAVED_MIN 0x1000
#define IDM_SAVED_MAX 0x2000

#define WM_IGNORE_CLIP (WM_XUSER + 2)
#define WM_FULLSCR_ON_MAX (WM_XUSER + 3)
#define WM_AGENT_CALLBACK (WM_XUSER + 4)

/* Needed for Chinese support and apparently not always defined. */
#ifndef VK_PROCESSKEY
#define VK_PROCESSKEY 0xE5
#endif

/* Mouse wheel support. */
#ifndef WM_MOUSEWHEEL
#define WM_MOUSEWHEEL 0x020A	       /* not defined in earlier SDKs */
#endif
#ifndef WHEEL_DELTA
#define WHEEL_DELTA 120
#endif

static Mouse_Button translate_button(Mouse_Button button);
static LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
static int TranslateKey(UINT message, WPARAM wParam, LPARAM lParam,
			unsigned char *output);
static void cfgtopalette(void);
static void systopalette(void);
static void init_palette(void);
static void init_fonts(int, int);
static void another_font(int);
static void deinit_fonts(void);
static void set_input_locale(HKL);

static int is_full_screen(void);
static void make_full_screen(void);
static void clear_full_screen(void);
static void flip_full_screen(void);

/* Window layout information */
static void reset_window(int);
static int extra_width, extra_height;
static int font_width, font_height, font_dualwidth;
static int offset_width, offset_height;
static int was_zoomed = 0;
static int prev_rows, prev_cols;
  
static int pending_netevent = 0;
static WPARAM pend_netevent_wParam = 0;
static LPARAM pend_netevent_lParam = 0;
static void enact_pending_netevent(void);
static void flash_window(int mode);
static void sys_cursor_update(void);
static int is_shift_pressed(void);
static int get_fullscreen_rect(RECT * ss);

static time_t last_movement = 0;

static int caret_x = -1, caret_y = -1;

static int kbd_codepage;

static void *ldisc;
static Backend *back;
static void *backhandle;

static struct unicode_data ucsdata;
static int session_closed;

static const struct telnet_special *specials;

static struct {
    HMENU menu;
    int specials_submenu_pos;
} popup_menus[2];
enum { SYSMENU, CTXMENU };

Config cfg;			       /* exported to windlg.c */

extern struct sesslist sesslist;       /* imported from windlg.c */

struct agent_callback {
    void (*callback)(void *, void *, int);
    void *callback_ctx;
    void *data;
    int len;
};

#define FONT_NORMAL 0
#define FONT_BOLD 1
#define FONT_UNDERLINE 2
#define FONT_BOLDUND 3
#define FONT_WIDE	0x04
#define FONT_HIGH	0x08
#define FONT_NARROW	0x10

#define FONT_OEM 	0x20
#define FONT_OEMBOLD 	0x21
#define FONT_OEMUND 	0x22
#define FONT_OEMBOLDUND 0x23

#define FONT_MAXNO 	0x2F
#define FONT_SHIFT	5
static HFONT fonts[FONT_MAXNO];
static LOGFONT lfont;
static int fontflag[FONT_MAXNO];
static enum {
    BOLD_COLOURS, BOLD_SHADOW, BOLD_FONT
} bold_mode;
static enum {
    UND_LINE, UND_FONT
} und_mode;
static int descent;

#define NCOLOURS 24
static COLORREF colours[NCOLOURS];
static HPALETTE pal;
static LPLOGPALETTE logpal;
static RGBTRIPLE defpal[NCOLOURS];

static HWND hwnd;

static HBITMAP caretbm;

static int dbltime, lasttime, lastact;
static Mouse_Button lastbtn;

/* this allows xterm-style mouse handling. */
static int send_raw_mouse = 0;
static int wheel_accumulator = 0;

static char *window_name, *icon_name;

static int compose_state = 0;

static UINT wm_mousewheel = WM_MOUSEWHEEL;

/* Dummy routine, only required in plink. */
void ldisc_update(void *frontend, int echo, int edit)
{
}

int WINAPI WinMain(HINSTANCE inst, HINSTANCE prev, LPSTR cmdline, int show)
{
    WNDCLASS wndclass;
    MSG msg;
    int guess_width, guess_height;

    hinst = inst;
    flags = FLAG_VERBOSE | FLAG_INTERACTIVE;

    sk_init();

    InitCommonControls();

    /* Ensure a Maximize setting in Explorer doesn't maximise the
     * config box. */
    defuse_showwindow();

    if (!init_winver())
    {
	char *str = dupprintf("%s Fatal Error", appname);
	MessageBox(NULL, "Windows refuses to report a version",
		   str, MB_OK | MB_ICONEXCLAMATION);
	sfree(str);
	return 1;
    }

    /*
     * If we're running a version of Windows that doesn't support
     * WM_MOUSEWHEEL, find out what message number we should be
     * using instead.
     */
    if (osVersion.dwMajorVersion < 4 ||
	(osVersion.dwMajorVersion == 4 && 
	 osVersion.dwPlatformId != VER_PLATFORM_WIN32_NT))
	wm_mousewheel = RegisterWindowMessage("MSWHEEL_ROLLMSG");

    /*
     * See if we can find our Help file.
     */
    {
        char b[2048], *p, *q, *r;
        FILE *fp;
        GetModuleFileName(NULL, b, sizeof(b) - 1);
        r = b;
        p = strrchr(b, '\\');
        if (p && p >= r) r = p+1;
        q = strrchr(b, ':');
        if (q && q >= r) r = q+1;
        strcpy(r, "putty.hlp");
        if ( (fp = fopen(b, "r")) != NULL) {
            help_path = dupstr(b);
            fclose(fp);
        } else
            help_path = NULL;
        strcpy(r, "putty.cnt");
        if ( (fp = fopen(b, "r")) != NULL) {
            help_has_contents = TRUE;
            fclose(fp);
        } else
            help_has_contents = FALSE;
    }

    /*
     * Process the command line.
     */
    {
	char *p;
	int got_host = 0;

	default_protocol = be_default_protocol;
	/* Find the appropriate default port. */
	{
	    int i;
	    default_port = 0; /* illegal */
	    for (i = 0; backends[i].backend != NULL; i++)
		if (backends[i].protocol == default_protocol) {
		    default_port = backends[i].backend->default_port;
		    break;
		}
	}
	cfg.logtype = LGTYP_NONE;

	do_defaults(NULL, &cfg);

	p = cmdline;

	/*
	 * Process a couple of command-line options which are more
	 * easily dealt with before the line is broken up into
	 * words. These are the soon-to-be-defunct @sessionname and
	 * the internal-use-only &sharedmemoryhandle, neither of
	 * which are combined with anything else.
	 */
	while (*p && isspace(*p))
	    p++;
	if (*p == '@') {
	    int i = strlen(p);
	    while (i > 1 && isspace(p[i - 1]))
		i--;
	    p[i] = '\0';
	    do_defaults(p + 1, &cfg);
	    if (!*cfg.host && !do_config()) {
		cleanup_exit(0);
	    }
	} else if (*p == '&') {
	    /*
	     * An initial & means we've been given a command line
	     * containing the hex value of a HANDLE for a file
	     * mapping object, which we must then extract as a
	     * config.
	     */
	    HANDLE filemap;
	    Config *cp;
	    if (sscanf(p + 1, "%p", &filemap) == 1 &&
		(cp = MapViewOfFile(filemap, FILE_MAP_READ,
				    0, 0, sizeof(Config))) != NULL) {
		cfg = *cp;
		UnmapViewOfFile(cp);
		CloseHandle(filemap);
	    } else if (!do_config()) {
		cleanup_exit(0);
	    }
	} else {
	    /*
	     * Otherwise, break up the command line and deal with
	     * it sensibly.
	     */
	    int argc, i;
	    char **argv;
	    
	    split_into_argv(cmdline, &argc, &argv, NULL);

	    for (i = 0; i < argc; i++) {
		char *p = argv[i];
		int ret;

		ret = cmdline_process_param(p, i+1<argc?argv[i+1]:NULL,
					    1, &cfg);
		if (ret == -2) {
		    cmdline_error("option \"%s\" requires an argument", p);
		} else if (ret == 2) {
		    i++;	       /* skip next argument */
		} else if (ret == 1) {
		    continue;	       /* nothing further needs doing */
		} else if (!strcmp(p, "-cleanup")) {
		    /*
		     * `putty -cleanup'. Remove all registry
		     * entries associated with PuTTY, and also find
		     * and delete the random seed file.
		     */
		    char *s1, *s2;
		    s1 = dupprintf("This procedure will remove ALL Registry\n"
				   "entries associated with %s, and will\n"
				   "also remove the random seed file.\n"
				   "\n"
				   "THIS PROCESS WILL DESTROY YOUR SAVED\n"
				   "SESSIONS. Are you really sure you want\n"
				   "to continue?", appname);
		    s2 = dupprintf("%s Warning", appname);
		    if (MessageBox(NULL, s1, s2,
				   MB_YESNO | MB_ICONWARNING) == IDYES) {
			cleanup_all();
		    }
		    sfree(s1);
		    sfree(s2);
		    exit(0);
		} else if (*p != '-') {
		    char *q = p;
		    if (got_host) {
			/*
			 * If we already have a host name, treat
			 * this argument as a port number. NB we
			 * have to treat this as a saved -P
			 * argument, so that it will be deferred
			 * until it's a good moment to run it.
			 */
			int ret = cmdline_process_param("-P", p, 1, &cfg);
			assert(ret == 2);
		    } else if (!strncmp(q, "telnet:", 7)) {
			/*
			 * If the hostname starts with "telnet:",
			 * set the protocol to Telnet and process
			 * the string as a Telnet URL.
			 */
			char c;

			q += 7;
			if (q[0] == '/' && q[1] == '/')
			    q += 2;
			cfg.protocol = PROT_TELNET;
			p = q;
			while (*p && *p != ':' && *p != '/')
			    p++;
			c = *p;
			if (*p)
			    *p++ = '\0';
			if (c == ':')
			    cfg.port = atoi(p);
			else
			    cfg.port = -1;
			strncpy(cfg.host, q, sizeof(cfg.host) - 1);
			cfg.host[sizeof(cfg.host) - 1] = '\0';
			got_host = 1;
		    } else {
			/*
			 * Otherwise, treat this argument as a host
			 * name.
			 */
			while (*p && !isspace(*p))
			    p++;
			if (*p)
			    *p++ = '\0';
			strncpy(cfg.host, q, sizeof(cfg.host) - 1);
			cfg.host[sizeof(cfg.host) - 1] = '\0';
			got_host = 1;
		    }
		} else {
		    cmdline_error("unknown option \"%s\"", p);
		}
	    }
	}

	cmdline_run_saved(&cfg);

	if (!*cfg.host && !do_config()) {
	    cleanup_exit(0);
	}

	/*
	 * Trim leading whitespace off the hostname if it's there.
	 */
	{
	    int space = strspn(cfg.host, " \t");
	    memmove(cfg.host, cfg.host+space, 1+strlen(cfg.host)-space);
	}

	/* See if host is of the form user@host */
	if (cfg.host[0] != '\0') {
	    char *atsign = strchr(cfg.host, '@');
	    /* Make sure we're not overflowing the user field */
	    if (atsign) {
		if (atsign - cfg.host < sizeof cfg.username) {
		    strncpy(cfg.username, cfg.host, atsign - cfg.host);
		    cfg.username[atsign - cfg.host] = '\0';
		}
		memmove(cfg.host, atsign + 1, 1 + strlen(atsign + 1));
	    }
	}

	/*
	 * Trim a colon suffix off the hostname if it's there.
	 */
	cfg.host[strcspn(cfg.host, ":")] = '\0';

	/*
	 * Remove any remaining whitespace from the hostname.
	 */
	{
	    int p1 = 0, p2 = 0;
	    while (cfg.host[p2] != '\0') {
		if (cfg.host[p2] != ' ' && cfg.host[p2] != '\t') {
		    cfg.host[p1] = cfg.host[p2];
		    p1++;
		}
		p2++;
	    }
	    cfg.host[p1] = '\0';
	}
    }

    /*
     * Select protocol. This is farmed out into a table in a
     * separate file to enable an ssh-free variant.
     */
    {
	int i;
	back = NULL;
	for (i = 0; backends[i].backend != NULL; i++)
	    if (backends[i].protocol == cfg.protocol) {
		back = backends[i].backend;
		break;
	    }
	if (back == NULL) {
	    char *str = dupprintf("%s Internal Error", appname);
	    MessageBox(NULL, "Unsupported protocol number found",
		       str, MB_OK | MB_ICONEXCLAMATION);
	    sfree(str);
	    cleanup_exit(1);
	}
    }

    /* Check for invalid Port number (i.e. zero) */
    if (cfg.port == 0) {
	char *str = dupprintf("%s Internal Error", appname);
	MessageBox(NULL, "Invalid Port Number",

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
久久午夜国产精品| 一区二区三区中文字幕精品精品 | 老司机精品视频线观看86| 粉嫩av一区二区三区| 欧美日韩精品欧美日韩精品一 | 欧美久久免费观看| 国产免费观看久久| 久久精品久久99精品久久| 欧美中文字幕久久| 国产精品每日更新| 国产乱码精品1区2区3区| 91麻豆精品国产91久久久使用方法| 国产精品欧美一区喷水| 精品伊人久久久久7777人| 欧美日韩高清影院| 一区二区成人在线视频| www.66久久| 亚洲国产高清在线观看视频| 久久精品72免费观看| 4438成人网| 偷拍日韩校园综合在线| 欧美色图第一页| 樱花影视一区二区| 色菇凉天天综合网| 亚洲日本在线a| av亚洲精华国产精华精| 国产精品久久久久久久久晋中 | 国产精品1024| 精品国产成人在线影院| 日本欧美大码aⅴ在线播放| 欧美日韩一区二区三区高清| 亚洲欧美国产77777| 91在线观看免费视频| 国产精品国产自产拍高清av王其 | 亚洲第一福利一区| 欧美伊人久久久久久午夜久久久久| 亚洲视频免费在线观看| 99久久精品免费| 亚洲天堂福利av| 一本色道久久综合精品竹菊| 亚洲视频免费观看| 日本高清不卡一区| 午夜婷婷国产麻豆精品| 欧美一区二区在线观看| 免费观看在线色综合| 久久综合久久鬼色中文字| 狠狠色丁香婷婷综合久久片| 国产欧美综合在线| 91麻豆免费观看| 亚洲综合免费观看高清在线观看| 欧美精品一二三| 男女男精品网站| 国产日产欧美一区二区三区| 白白色亚洲国产精品| 一区二区三区欧美视频| 欧美久久免费观看| 国产乱一区二区| 亚洲欧美日韩一区二区| 欧美日本乱大交xxxxx| 麻豆一区二区在线| 国产精品丝袜黑色高跟| 日本韩国一区二区| 青青草国产成人99久久| 国产欧美1区2区3区| 在线免费观看一区| 精品夜夜嗨av一区二区三区| 亚洲国产精华液网站w| 欧洲国产伦久久久久久久| 免费成人在线观看视频| 国产精品免费久久久久| 91精品国产色综合久久| 成人久久视频在线观看| 偷拍亚洲欧洲综合| 国产精品福利影院| 欧美一级日韩不卡播放免费| 99riav一区二区三区| 97久久精品人人做人人爽| 亚洲综合一区二区精品导航| 久久影院视频免费| 日本韩国欧美在线| 国产高清亚洲一区| 日韩精品一区第一页| 中文字幕第一区综合| 欧美一级夜夜爽| 欧洲精品一区二区三区在线观看| 国产高清在线精品| 日本成人中文字幕在线视频| 自拍偷拍亚洲综合| 久久精品人人做| 欧美一级片在线| 欧美中文字幕一区二区三区 | 欧美午夜免费电影| 成人福利电影精品一区二区在线观看 | 懂色av一区二区夜夜嗨| 日韩福利电影在线观看| 一区二区三区国产精华| 中文字幕高清一区| 久久综合九色综合久久久精品综合 | 成人av高清在线| 国产一区二区三区在线观看免费 | 韩国成人在线视频| 日本成人在线一区| 亚洲国产日韩在线一区模特| 裸体一区二区三区| 亚洲一区二区三区四区五区黄| 国产欧美一区二区精品婷婷| 欧美一级欧美三级在线观看| 欧美人与性动xxxx| 欧美日韩你懂得| 在线一区二区三区四区五区 | 久久国产乱子精品免费女| 性做久久久久久免费观看欧美| 亚洲欧美一区二区久久 | 一本大道久久精品懂色aⅴ| 成人黄色在线看| www.欧美亚洲| 97aⅴ精品视频一二三区| voyeur盗摄精品| aaa亚洲精品| 一本色道久久加勒比精品| 色狠狠桃花综合| 欧美日韩黄色一区二区| 欧美日韩精品专区| 欧美一区二区三区精品| 精品国产一区a| 欧美韩国日本一区| 亚洲色大成网站www久久九九| 亚洲免费在线视频一区 二区| 亚洲免费观看高清| 亚洲成a人片综合在线| 日韩av一区二区三区四区| 久久99热国产| 国产jizzjizz一区二区| aa级大片欧美| 欧美女孩性生活视频| 日韩视频免费直播| 久久精品综合网| 亚洲品质自拍视频| 日本欧美一区二区三区| 国产乱人伦偷精品视频免下载| gogo大胆日本视频一区| 欧美日韩视频在线观看一区二区三区| 91精品国产综合久久福利| 国产午夜亚洲精品理论片色戒| 国产精品美女久久久久久久网站| 亚洲另类在线视频| 蜜桃av噜噜一区| 不卡av免费在线观看| 欧美日本不卡视频| 日本一区二区免费在线 | 91国偷自产一区二区使用方法| 538prom精品视频线放| 日本一区二区三区久久久久久久久不| 一区二区三区在线视频免费 | 亚洲成人在线观看视频| 麻豆精品在线播放| 99久久免费国产| 日韩免费观看高清完整版 | 欧美v日韩v国产v| 亚洲人吸女人奶水| 老汉av免费一区二区三区| 91美女蜜桃在线| www日韩大片| 亚洲国产综合在线| 国产99久久久精品| 日韩午夜激情av| 亚洲激情图片一区| 国产91精品入口| 欧美一区永久视频免费观看| 中文字幕一区视频| 精品一区二区在线免费观看| 欧美综合一区二区三区| 国产欧美一区二区精品性色| 秋霞电影网一区二区| 欧美婷婷六月丁香综合色| 久久99久久久久| 欧美色中文字幕| 亚洲视频在线一区观看| 国产成人亚洲综合a∨婷婷图片 | 欧洲亚洲国产日韩| 中文字幕欧美激情| 国产一区在线不卡| 日韩精品中文字幕在线不卡尤物| 亚洲成在线观看| 欧美性淫爽ww久久久久无| 国产精品国产三级国产普通话蜜臀 | 日韩亚洲欧美一区| 亚洲v中文字幕| 91成人免费在线| 国产精品成人一区二区三区夜夜夜| 国产在线国偷精品免费看| 日韩欧美激情四射| 日本午夜精品一区二区三区电影| 欧洲生活片亚洲生活在线观看| 国产精品久久久久一区二区三区 | 国产一区二区三区四 | 91精品国产综合久久精品app| 一区二区三区.www| 在线日韩一区二区| 亚洲成在人线免费|