shareaza (BT 源代码)


shareaza shareaza BT
资源截图
代码片段和文件信息
/*
 * This is a part of the BugTrap package.
 * Copyright (c) 2005-2009 IntelleSoft.
 * All rights reserved.
 *
 * Description: About dialog.
 * Author: Maksim Pyatkovskiy.
 *
 * This source code is only intended as a supplement to the
 * BugTrap package reference and related electronic documentation
 * provided with the product. See these sources for detailed
 * information regarding the BugTrap package.
 */

#include “StdAfx.h“
#include “resource.h“
#include “AboutDlg.h“
#include “BugTrapUI.h“
#include “BugTrapUtils.h“

#ifdef _DEBUG
#define new DEBUG_NEW
#endif

/**
 * @addtogroup BugTrapUI BugTrap Graphical User Interface
 * @{
 */

/// E-mail hyper-link control.
static CHyperlink g_hlURL;

/**
 * @brief WM_COMMAND handler of About dialog.
 * @param hwnd - window handle.
 * @param id - control ID.
 * @param hwndCtl - control handle.
 * @param codeNotify - notification code.
 */
static void AboutDlg_OnCommand(HWND hwnd int id HWND hwndCtl UINT codeNotify)
{
codeNotify; hwndCtl;
switch (id)
{
case IDOK:
case IDCANCEL:
EndDialog(hwnd FALSE);
break;
}
}

/**
 * @brief WM_INITDIALOG handler of About dialog.
 * @param hwnd - window handle.
 * @param hwndFocus - system-defined focus window.
 * @param lParam - user-defined parameter.
 * @return true to setup focus to system-defined control.
 */
static BOOL AboutDlg_OnInitDialog(HWND hwnd HWND hwndFocus LPARAM lParam)
{
lParam; hwndFocus;

CenterWindow(hwnd GetParent(hwnd));
HWND hwndCtl = GetDlgItem(hwnd IDCANCEL);
SetFocus(hwndCtl);

hwndCtl = GetDlgItem(hwnd IDC_URL);
TCHAR szlinkURL[MAX_PATH];
GetWindowText(hwndCtl szlinkURL countof(szlinkURL));
g_hlURL.SetlinkURL(szlinkURL);
g_hlURL.Attach(hwndCtl);

return FALSE;
}

/**
 * @brief WM_DESTROY handler of About dialog.
 * @param hwnd - window handle.
 */
static void AboutDlg_OnDestroy(HWND hwnd)
{
hwnd;
g_hlURL.Detach();
}

/**
 * @brief Dialog procedure of About dialog.
 * @param hwndDlg - window handle.
 * @param uMsg - message identifier.
 * @param wParam - 1st message parameter.
 * @param lParam - 2nd message parameter.
 * @return message result.
 */
INT_PTR CALLBACK AboutDlgProc(HWND hwndDlg UINT uMsg WPARAM wParam LPARAM lParam)
{
switch (uMsg)
{
HANDLE_MSG(hwndDlg WM_INITDIALOG AboutDlg_OnInitDialog);
HANDLE_MSG(hwndDlg WM_COMMAND AboutDlg_OnCommand);
HANDLE_MSG(hwndDlg WM_DESTROY AboutDlg_OnDestroy);
default: return FALSE;
}
}

/** @} */

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)