user-0 提问: 纯API 超链接...

回复:
user: user-1
content: Resource.h  #define	DLG_MAIN	   1000 #define	IDC_WEBPAGE 1101 #define	IDC_EMAIL   1102  Hyperlink.rc  #include	<Winres.h> #include "Resource.h"  DLG_MAIN	DIALOGEX 160, 160, 236, 185 STYLE		DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION		"对话框模板" FONT		9, "宋体" BEGIN	    CONTROL         "<a>Goto Replace</a>",IDC_WEBPAGE,                     "SysLink",WS_TABSTOP,25,85,174,10    CONTROL         "<a>Goto E-Mail</a>",IDC_EMAIL,                     "SysLink",WS_TABSTOP,25,55,174,10    CONTROL		   "",-1,"Static",SS_ETCHEDHORZ,7,155,222,1    DEFPUSHBUTTON	"退出",IDOK,177,163,50,14 END  ID_ICON ICON "bulbs.ico"  Hyperlink.c  #define STRICT   #include <Windows.h> #include <tchar.h>   #include <commctrl.h> #include <Shellapi.h> #include "Resource.h"  #pragma comment(lib, "gdi32.lib") #pragma comment(lib, "user32.lib")  //#pragma comment(lib, "comctl32.lib") #pragma comment(lib, "Shell32.lib")  #pragma comment(linker, "/subsystem:windows,5.1.2600 /entry:WinMainCRTStartup")   // 设置入口地址   INT_PTR CALLBACK AboutDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam);  int WINAPI _tWinMain(HINSTANCE hInstance,                      HINSTANCE hPrevInstance,                      LPTSTR szCmdLine,                      INT iCmdShow) {    DialogBoxParam(hInstance, MAKEINTRESOURCE(DLG_MAIN), NULL, AboutDlgProc,0);    return 0;    //InitCommonControls(); }  INT_PTR CALLBACK AboutDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam) {    switch (umsg)    {    case WM_INITDIALOG:        SendMessage(hwnd, WM_SETICON, ICON_BIG, (LPARAM)LoadIcon(GetModuleHandle(NULL), TEXT("ID_ICON")));       break;     case WM_COMMAND:       if (IDOK == LOWORD(wParam))          EndDialog(hwnd, 0);       return TRUE;     case WM_CLOSE:       EndDialog(hwnd, 0);       return TRUE;     case WM_NOTIFY:       {          LPNMHDR pnmhdr = (LPNMHDR)lParam;          switch (pnmhdr->code)           {          case NM_CLICK:          case NM_RETURN:             {                if (pnmhdr->idFrom == IDC_WEBPAGE)                 {                   ShellExecute(hwnd, TEXT("open"), TEXT("http://www.flos-freeware.ch"), NULL, NULL, SW_SHOWNORMAL);                }                else if (pnmhdr->idFrom == IDC_EMAIL)                 {                   ShellExecute(hwnd, TEXT("open"), TEXT("mailto:florian.balmer@gmail.com"), NULL, NULL, SW_SHOWNORMAL);                }             }             break;           }       }       return TRUE;    }    return FALSE;     }

user: user-0
content: 引用 1 楼 user-1 的回复:Resource.h  #define	DLG_MAIN	   1000 #define	IDC_WEBPAGE 1101 #define	IDC_EMAIL   1102  Hyperlink.rc  #include	<Winres.h> #include "Resource.h"  DLG_MAIN	DIALOGEX 160, 160, 236, 185 STYLE		DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU CAPTION		"对话框模板" FONT		9, "宋体" BEGIN	    CONTROL         "<a>Goto Replace</a>",IDC_WEBPAGE,                     "SysLink",WS_TABSTOP,25,85,174,10    CONTROL         "<a>Goto E-Mail</a>",IDC_EMAIL,                     "SysLink",WS_TABSTOP,25,55,174,10    CONTROL		   "",-1,"Static",SS_ETCHEDHORZ,7,155,222,1    DEFPUSHBUTTON	"退出",IDOK,177,163,50,14 END  ID_ICON ICON "bulbs.ico"  Hyperlink.c  #define STRICT   #include <Windows.h> #include <tchar.h>   #include <commctrl.h> #include <Shellapi.h> #include "Resource.h"  #pragma comment(lib, "gdi32.lib") #pragma comment(lib, "user32.lib")  //#pragma comment(lib, "comctl32.lib") #pragma comment(lib, "Shell32.lib")  #pragma comment(linker, "/subsystem:windows,5.1.2600 /entry:WinMainCRTStartup")   // 设置入口地址   INT_PTR CALLBACK AboutDlgProc(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam);  int WINAPI _tWinMain(HINSTANCE hInstance,                      HINSTANCE hPrevInstance,                      LPTSTR szCmdLine,                      INT iCmdShow) {    DialogBoxParam(hInstance, MAKEINTRESOURCE(DLG_MAIN), NULL, AboutDlgProc,0);    return 0;    //InitCommonControls(); }  INT_PTR CALLBACK AboutDlgProc(HWND hwnd,UINT umsg,WPARAM wParam,LPARAM lParam) {    switch (umsg)    {    case WM_INITDIALOG:        SendMessage(hwnd, WM_SETICON, ICON_BIG, (LPARAM)LoadIcon(GetModuleHandle(NULL), TEXT("ID_ICON")));       break;     case WM_COMMAND:       if (IDOK == LOWORD(wParam))          EndDialog(hwnd, 0);       return TRUE;     case WM_CLOSE:       EndDialog(hwnd, 0);       return TRUE;     case WM_NOTIFY:       {          LPNMHDR pnmhdr = (LPNMHDR)lParam;          switch (pnmhdr->code)           {          case NM_CLICK:          case NM_RETURN:             {                if (pnmhdr->idFrom == IDC_WEBPAGE)                 {                   ShellExecute(hwnd, TEXT("open"), TEXT("http://www.flos-freeware.ch"), NULL, NULL, SW_SHOWNORMAL);                }                else if (pnmhdr->idFrom == IDC_EMAIL)                 {                   ShellExecute(hwnd, TEXT("open"), TEXT("mailto:florian.balmer@gmail.com"), NULL, NULL, SW_SHOWNORMAL);                }             }             break;           }       }       return TRUE;    }    return FALSE;     } 好吧...先谢谢2L的朋友啦..