-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathabout.cpp
More file actions
91 lines (72 loc) · 2.98 KB
/
about.cpp
File metadata and controls
91 lines (72 loc) · 2.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
/*-----------------------------------------------------------------------------
This is a part of the Microsoft Source Code Samples.
Copyright (C) 1995 Microsoft Corporation.
All rights reserved.
This source code is only intended as a supplement to
Microsoft Development Tools and/or WinHelp documentation.
See these sources for detailed information regarding the
Microsoft samples programs.
MODULE: About.c
PURPOSE: Implement the About dialog box for the program.
FUNCTIONS:
CmdAbout - Creates the About dialog in response to menu selection
AboutDlgProc - Processes messages for the About dialog
InitAboutDlg - Initialzes about dialog controls
-----------------------------------------------------------------------------*/
#include <windows.h>
#include <tchar.h> // required for version.h
#include "resource.h"
#include "version.h"
#include "hyperlinks.h"
// window.mgr.cpp
extern HINSTANCE g_hinst ;
// extern OSVERSIONINFO gOSV;
/*-----------------------------------------------------------------------------
FUNCTION: AboutDlgProc(HWND, UINT, WPARAM, LPARAM)
PURPOSE: Dialog procedure for the "About Box"
PARAMETERS:
hdlg - dialog window handle
uMessage - window message
wparam - message parameter (depends on message value)
lparam - message prarmeter (depends on message value)
HISTORY: Date: Author: Comment:
10/27/95 AllenD Wrote it
-----------------------------------------------------------------------------*/
//static BOOL CALLBACK AboutDlgProc(HWND hdlg, UINT uMessage, WPARAM wparam, LPARAM lparam)
static INT_PTR CALLBACK AboutDlgProc(HWND hdlg, UINT uMessage, WPARAM wparam, LPARAM lparam)
{
#define BUF_LEN 255
wchar_t buf[BUF_LEN+1];
switch(uMessage) {
case WM_INITDIALOG:
SetWindowText(GetDlgItem(hdlg, IDC_VERNUM), VerNum) ;
ConvertStaticToHyperlink(hdlg, IDC_WEBLINK);
break;
case WM_COMMAND:
switch (LOWORD(wparam)) {
case IDC_WEBLINK:
GetDlgItemText(hdlg, LOWORD(wparam), buf, BUF_LEN);
ShellExecute(hdlg, L"open", buf, L"", L"", SW_SHOW);
return TRUE;
case IDOK:
case IDCANCEL:
EndDialog(hdlg, TRUE);
return TRUE;
} //lint !e744 switch with no default
break;
} //lint !e744 switch with no default
return FALSE;
} //lint !e715
/*-----------------------------------------------------------------------------
FUNCTION: CmdAbout( HWND )
PARAMETERS:
hwnd - Owner of the window
PURPOSE: Creates the modal About dialog
-----------------------------------------------------------------------------*/
BOOL CmdAbout(HWND hwnd)
{
// syslog("WM_COMMAND: IDM_ABOUT\n");
// DialogBox(g_hinst, MAKEINTRESOURCE(IDD_ABOUT), hwnd, AboutDlgProc);
DialogBox(g_hinst, MAKEINTRESOURCE(IDD_ABOUT), 0, AboutDlgProc);
return 0;
} //lint !e715 hwnd