📄 vncabout.cpp
字号:
// Copyright (C) 2002 RealVNC Ltd. All Rights Reserved.
// Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
//
// This file is part of TeamViewer.
//
// TeamViewer is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
//
// If the source code for TeamViewer is not available from the place
// whence you received this file, check http://www.teamviewer.com
// for information on obtaining it.
// vncAbout.cpp
// Implementation of the About dialog!
#include "stdhdrs.h"
#include "vncAbout.h"
#include "Localization.h"
#include "vncserver.h"
#include "roGateway.h"
#include "buildnumber.inc"
#ifndef ROVNC // Sonst Doppeldefinition, siehe AboutBox.cpp
HBITMAP
DoGetBkGndBitmap(IN CONST UINT uBmpResId )
{
static HBITMAP hbmBkGnd = NULL;
if (NULL == hbmBkGnd)
{
/*char szFileName[MAX_PATH];
if (GetModuleFileName(NULL, szFileName, MAX_PATH))
{
char* p = strrchr(szFileName, '\\');
if (p == NULL) return false;
*p = '\0';
strcat (szFileName,"\\background2.bmp");
}
hbmBkGnd = (HBITMAP)LoadImage( NULL, szFileName, IMAGE_BITMAP, 0, 0,
LR_CREATEDIBSECTION | LR_DEFAULTSIZE | LR_LOADFROMFILE );*/
hbmBkGnd = (HBITMAP)LoadImage(
GetModuleHandle(NULL), MAKEINTRESOURCE(uBmpResId),
IMAGE_BITMAP, 0, 0, LR_CREATEDIBSECTION);
if (NULL == hbmBkGnd)
hbmBkGnd = (HBITMAP)-1;
}
return (hbmBkGnd == (HBITMAP)-1)
? NULL : hbmBkGnd;
}
BOOL
DoSDKEraseBkGnd(
IN CONST HDC hDC,
IN CONST COLORREF crBkGndFill
)
{
HBITMAP hbmBkGnd = DoGetBkGndBitmap(IDB_BITMAP1);
if (hDC && hbmBkGnd)
{
RECT rc;
if ((ERROR != GetClipBox(hDC, &rc)) && !IsRectEmpty(&rc))
{
HDC hdcMem = CreateCompatibleDC(hDC);
if (hdcMem)
{
HBRUSH hbrBkGnd = CreateSolidBrush(crBkGndFill);
if (hbrBkGnd)
{
HGDIOBJ hbrOld = SelectObject(hDC, hbrBkGnd);
if (hbrOld)
{
SIZE size = {
(rc.right-rc.left), (rc.bottom-rc.top)
};
if (PatBlt(hDC, rc.left, rc.top, size.cx, size.cy, PATCOPY))
{
HGDIOBJ hbmOld = SelectObject(hdcMem, hbmBkGnd);
if (hbmOld)
{
BitBlt(hDC, rc.left, rc.top, size.cx, size.cy,
hdcMem, rc.left, rc.top, SRCCOPY);
SelectObject(hdcMem, hbmOld);
}
}
SelectObject(hDC, hbrOld);
}
DeleteObject(hbrBkGnd);
}
DeleteDC(hdcMem);
}
}
}
return TRUE;
}
#endif
// Constructor/destructor
vncAbout::vncAbout()
{
m_dlgvisible = FALSE;
}
vncAbout::~vncAbout()
{
}
// Initialisation
BOOL
vncAbout::Init()
{
return TRUE;
}
// Dialog box handling functions
void
vncAbout::Show(BOOL show)
{
if (show)
{
if (!m_dlgvisible)
{
DialogBoxParam(hAppInstance,
MAKEINTRESOURCE(IDD_ABOUT),
NULL,
(DLGPROC) DialogProc,
(LONG) this);
}
}
}
BOOL CALLBACK
vncAbout::DialogProc(HWND hwnd,
UINT uMsg,
WPARAM wParam,
LPARAM lParam )
{
// We use the dialog-box's USERDATA to store a _this pointer
// This is set only once WM_INITDIALOG has been recieved, though!
vncAbout *_this = (vncAbout *) GetWindowLong(hwnd, GWL_USERDATA);
switch (uMsg)
{
case WM_INITDIALOG:
{
// Retrieve the Dialog box parameter and use it as a pointer
// to the calling vncProperties object
SetWindowLong(hwnd, GWL_USERDATA, lParam);
_this = (vncAbout *) lParam;
// Insert the build time information
extern char buildtime[];
char buildstring[255];
sprintf(buildstring, "%s (%s)", BUILDNUMBER, buildtime);
SetDlgItemText(hwnd, IDC_BUILDTIME, buildstring);
SetDlgItemText(hwnd, IDC_VERSION_NUMBER, TEAMVIEWER_VERSION);
CroGateway *roGateway = CroGateway::Instance();
SetDlgItemText(hwnd, IDC_LICENSE, roGateway->getLicenseName().c_str());
// Show the dialog
SetForegroundWindow(hwnd);
_this->m_dlgvisible = TRUE;
return TRUE;
}
case WM_ERASEBKGND:
return EraseBkgnd(hwnd, wParam);
case WM_CTLCOLORBTN:
return CtlColorBtn(wParam);
case WM_CTLCOLORSTATIC:
return CtlColorStatic(hwnd, wParam, lParam);
case WM_COMMAND:
switch (LOWORD(wParam))
{
case IDCANCEL:
case IDOK:
// Close the dialog
EndDialog(hwnd, TRUE);
_this->m_dlgvisible = FALSE;
return TRUE;
}
case ID_Homepage:
//char myHome[100];
//myHome[0]=0;
//strcat(myHome,"http://www.");
//strcat(myHome,VNC_HOMESITE);
ShellExecute(0,"open",sz_IDS_HOMEPAGE_LINK,0,0,SW_SHOW);
//ShellExecute(0,"open",myHome,0,0,SW_SHOW);
break;
break;
case WM_DESTROY:
EndDialog(hwnd, FALSE);
_this->m_dlgvisible = FALSE;
return TRUE;
}
return 0;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -