ReactOS  0.4.15-dev-489-g75a0787
HyperlinkCtrl Struct Reference

Hyperlink Controls. More...

#include <window.h>

Inheritance diagram for HyperlinkCtrl:
Collaboration diagram for HyperlinkCtrl:

Public Types

typedef SubclassedWindow super
 
- Public Types inherited from SubclassedWindow
typedef Window super
 
- Public Types inherited from Window
typedef map< HWND, Window * > WindowMap
 
typedef Window *(* CREATORFUNC) (HWND)
 
typedef Window *(* CREATORFUNC_INFO) (HWND, const void *)
 

Public Member Functions

 HyperlinkCtrl (HWND hwnd, COLORREF colorLink=RGB(0, 0, 255), COLORREF colorVisited=RGB(128, 0, 128))
 
 HyperlinkCtrl (HWND owner, int id, COLORREF colorLink=RGB(0, 0, 255), COLORREF colorVisited=RGB(128, 0, 128))
 
 ~HyperlinkCtrl ()
 
- Public Member Functions inherited from SubclassedWindow
 SubclassedWindow (HWND)
 
- Public Member Functions inherited from Window
 Window (HWND hwnd)
 
virtual ~Window ()
 
LRESULT SendParent (UINT nmsg, WPARAM wparam=0, LPARAM lparam=0)
 
LRESULT PostParent (UINT nmsg, WPARAM wparam=0, LPARAM lparam=0)
 
 Window (INT cx, INT cy, BOOL fAutoHide=FALSE)
 
virtual ~Window ()
 
virtual LRESULT CALLBACK WindowProcDx (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
void DoAction ()
 

Public Attributes

String _cmd
 
- Public Attributes inherited from Window
IAccessible IAccessible_iface
 
IOleWindow IOleWindow_iface
 
IEnumVARIANT IEnumVARIANT_iface
 
LONG ref
 

Protected Member Functions

LRESULT WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
 
void init ()
 
bool LaunchLink ()
 
- Protected Member Functions inherited from SubclassedWindow
virtual int Command (int id, int code)
 
virtual int Notify (int id, NMHDR *pnmh)
 
- Protected Member Functions inherited from Window
virtual LRESULT Init (LPCREATESTRUCT pcs)
 
void OnCommand (HWND hwnd, int id, HWND hwndCtl, UINT codeNotify)
 
void OnPaint (HWND hwnd)
 
void OnRButtonDown (HWND hwnd, BOOL fDoubleClick, int x, int y, UINT keyFlags)
 
void OnKey (HWND hwnd, UINT vk, BOOL fDown, int cRepeat, UINT flags)
 
void OnAppBarCallback (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
BOOL AppBar_Register (HWND hwnd)
 
BOOL AppBar_UnRegister (HWND hwnd)
 
BOOL AppBar_SetAutoHide (HWND hwnd, BOOL fHide)
 
BOOL AppBar_AutoHide (HWND hwnd)
 
BOOL AppBar_NoAutoHide (HWND hwnd)
 
BOOL AppBar_SetSide (HWND hwnd, UINT uSide)
 
void AppBar_SetAlwaysOnTop (HWND hwnd, BOOL fOnTop)
 
void AppBar_Hide (HWND hwnd)
 
void AppBar_UnHide (HWND hwnd)
 
void AppBar_SetAutoHideTimer (HWND hwnd)
 
void AppBar_SetAutoUnhideTimer (HWND hwnd)
 
void AppBar_Size (HWND hwnd)
 
void AppBar_QueryPos (HWND hwnd, LPRECT lprc)
 
void AppBar_QuerySetPos (UINT uEdge, LPRECT lprc, PAPPBARDATA pabd, BOOL fMove)
 
void AppBar_PosChanged (PAPPBARDATA pabd)
 
BOOL OnCreate (HWND hwnd, LPCREATESTRUCT lpCreateStruct)
 
void OnActivate (HWND hwnd, UINT state, HWND hwndActDeact, BOOL fMinimized)
 
void OnWindowPosChanged (HWND hwnd, const LPWINDOWPOS lpwpos)
 
void OnSize (HWND hwnd, UINT state, int cx, int cy)
 
void OnMove (HWND hwnd, int x, int y)
 
void OnNCDestroy (HWND hwnd)
 
void OnTimer (HWND hwnd, UINT id)
 
UINT OnNCHitTest (HWND hwnd, int x, int y)
 
void OnLButtonDown (HWND hwnd, BOOL fDoubleClick, int x, int y, UINT keyFlags)
 
void OnMouseMove (HWND hwnd, int x, int y, UINT keyFlags)
 
void OnLButtonUp (HWND hwnd, int x, int y, UINT keyFlags)
 

Protected Attributes

COLORREF _textColor
 
COLORREF _colorVisited
 
HFONT _hfont
 
HCURSOR _crsr_link
 
- Protected Attributes inherited from SubclassedWindow
WNDPROC _orgWndProc
 
- Protected Attributes inherited from Window
HWND m_hwnd
 
BOOL m_fAutoHide
 
BOOL m_fOnTop
 
BOOL m_fHiding
 
UINT m_uSide
 
LONG m_cxWidth
 
LONG m_cyHeight
 
LONG m_cxSave
 
LONG m_cySave
 
BOOL m_fAppBarRegd
 
BOOL m_fMoving
 
BOOL m_bDragged
 
POINT m_ptDragOn
 
RECT m_rcAppBar
 
RECT m_rcDrag
 

Additional Inherited Members

- Static Public Member Functions inherited from Window
static HWND Create (CREATORFUNC creator, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0)
 
static HWND Create (CREATORFUNC_INFO creator, const void *info, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0)
 
static Windowcreate_mdi_child (const ChildWndInfo &info, const MDICREATESTRUCT &mcs, CREATORFUNC_INFO creator)
 
static LRESULT CALLBACK WindowWndProc (HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
 
static INT_PTR CALLBACK DialogProc (HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
 
static Windowget_window (HWND hwnd)
 get window controller from window handle More...
 
template<typename CLASS >
static CLASS * get_window (HWND hwnd)
 
static void register_pretranslate (HWND hwnd)
 
static void unregister_pretranslate (HWND hwnd)
 
static BOOL pretranslate_msg (LPMSG pmsg)
 
static void register_dialog (HWND hwnd)
 
static void unregister_dialog (HWND hwnd)
 
static BOOL dispatch_dialog_msg (LPMSG pmsg)
 
static int MessageLoop ()
 
static void CancelModes ()
 
static BOOL DoRegisterClass (HINSTANCE hInstance)
 
static HWND DoCreateMainWnd (HINSTANCE hInstance, LPCTSTR pszText, INT cx, INT cy, DWORD style=WS_POPUP|WS_THICKFRAME|WS_CLIPCHILDREN, DWORD exstyle=WS_EX_WINDOWEDGE|WS_EX_TOOLWINDOW|WS_EX_TOPMOST, BOOL fAutoHide=FALSE)
 
static INT DoMainLoop ()
 
static WindowGetAppbarData (HWND hwnd)
 
static LRESULT CALLBACK WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static DWORD WINAPI ActionThreadFunc (LPVOID args)
 
- Static Protected Member Functions inherited from SubclassedWindow
static LRESULT CALLBACK SubclassedWndProc (HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
 
- Static Protected Member Functions inherited from Window
static Windowcreate_controller (HWND hwnd)
 create controller for a new window More...
 
static StaticWindowDataGetStaticWindowData ()
 
static LRESULT CALLBACK MDICBTHookProc (int code, WPARAM wparam, LPARAM lparam)
 
static LRESULT CALLBACK PropSheetCBTHookProc (int code, WPARAM wparam, LPARAM lparam)
 
- Static Protected Attributes inherited from Window
static WindowMap s_wnd_map
 
static const voids_new_info = NULL
 
static CREATORFUNC s_window_creator = NULL
 
static HHOOK s_hcbtHook = 0
 
static WindowSet s_pretranslate_windows
 
static WindowSet s_dialogs
 

Detailed Description

Hyperlink Controls.

Definition at line 816 of file window.h.

Member Typedef Documentation

◆ super

Definition at line 818 of file window.h.

Constructor & Destructor Documentation

◆ HyperlinkCtrl() [1/2]

HyperlinkCtrl::HyperlinkCtrl ( HWND  hwnd,
COLORREF  colorLink = RGB(0,0,255),
COLORREF  colorVisited = RGB(128,0,128) 
)

Definition at line 1186 of file window.cpp.

1187  : super(hwnd),
1189  _textColor(colorLink),
1190  _colorVisited(colorVisited),
1191  _hfont(0),
1192  _crsr_link(0)
1193 {
1194  init();
1195 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
int WINAPI GetDlgCtrlID(_In_ HWND)
String _cmd
Definition: window.h:825
COLORREF _colorVisited
Definition: window.h:829
HCURSOR _crsr_link
Definition: window.h:831
COLORREF _textColor
Definition: window.h:828
SubclassedWindow super
Definition: window.h:818
convenient loading of string resources
Definition: globals.h:303
void init()
Definition: window.cpp:1208
HFONT _hfont
Definition: window.h:830

◆ HyperlinkCtrl() [2/2]

HyperlinkCtrl::HyperlinkCtrl ( HWND  owner,
int  id,
COLORREF  colorLink = RGB(0,0,255),
COLORREF  colorVisited = RGB(128,0,128) 
)

Definition at line 1197 of file window.cpp.

1198  : super(GetDlgItem(owner, id)),
1199  _cmd(ResString(id)),
1200  _textColor(colorLink),
1201  _colorVisited(colorVisited),
1202  _hfont(0),
1203  _crsr_link(0)
1204 {
1205  init();
1206 }
String _cmd
Definition: window.h:825
COLORREF _colorVisited
Definition: window.h:829
HCURSOR _crsr_link
Definition: window.h:831
COLORREF _textColor
Definition: window.h:828
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
SubclassedWindow super
Definition: window.h:818
convenient loading of string resources
Definition: globals.h:303
void init()
Definition: window.cpp:1208
HFONT _hfont
Definition: window.h:830

◆ ~HyperlinkCtrl()

HyperlinkCtrl::~HyperlinkCtrl ( )

Definition at line 1216 of file window.cpp.

1217 {
1218  if (_hfont)
1220 }
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
HFONT _hfont
Definition: window.h:830

Member Function Documentation

◆ init()

void HyperlinkCtrl::init ( void  )
protected

Definition at line 1208 of file window.cpp.

1209 {
1210  if (_cmd.empty()) {
1211  TCHAR txt[BUFFER_LEN];
1212  _cmd.assign(txt, GetWindowText(_hwnd, txt, BUFFER_LEN));
1213  }
1214 }
#define GetWindowText
Definition: winuser.h:5773
String _cmd
Definition: window.h:825
#define BUFFER_LEN
Definition: utility.h:97
char TCHAR
Definition: xmlstorage.h:189

Referenced by HyperlinkCtrl().

◆ LaunchLink()

bool HyperlinkCtrl::LaunchLink ( )
inlineprotected

Definition at line 837 of file window.h.

838  {
839  if (!_cmd.empty()) {
840  HINSTANCE hinst = ShellExecute(GetParent(_hwnd), _T("open"), _cmd, 0, 0, SW_SHOWNORMAL);
841  return (INT_PTR)hinst > HINSTANCE_ERROR;
842  }
843 
844  return true;
845  }
int32_t INT_PTR
Definition: typedefs.h:63
String _cmd
Definition: window.h:825
#define ShellExecute
Definition: shellapi.h:689
#define _T(x)
Definition: vfdio.h:22
HWND WINAPI GetParent(_In_ HWND)
#define SW_SHOWNORMAL
Definition: winuser.h:764
#define HINSTANCE_ERROR
Definition: winbase.h:509
static HINSTANCE hinst
Definition: edit.c:551

Referenced by WndProc().

◆ WndProc()

LRESULT HyperlinkCtrl::WndProc ( UINT  nmsg,
WPARAM  wparam,
LPARAM  lparam 
)
protectedvirtual

Reimplemented from SubclassedWindow.

Definition at line 1222 of file window.cpp.

1223 {
1224  switch(nmsg) {
1225  case PM_DISPATCH_CTLCOLOR: {
1226  if (!_hfont) {
1227  HFONT hfont = (HFONT) SendMessage(_hwnd, WM_GETFONT, 0, 0);
1228  LOGFONT lf; GetObject(hfont, sizeof(lf), &lf);
1229  lf.lfUnderline = TRUE;
1230  _hfont = CreateFontIndirect(&lf);
1231  }
1232 
1233  HDC hdc = (HDC) wparam;
1234  SetTextColor(hdc, _textColor); //@@
1235  SelectFont(hdc, _hfont);
1238  }
1239 
1240  case WM_SETCURSOR:
1241  if (!_crsr_link)
1243 
1244  if (_crsr_link)
1246  return 0;
1247 
1248  case WM_NCHITTEST:
1249  return HTCLIENT; // Aktivierung von Maus-Botschaften
1250 
1251  case WM_LBUTTONDOWN:
1252  if (LaunchLink()) {
1254  InvalidateRect(_hwnd, NULL, FALSE);
1255  } else
1256  MessageBeep(0);
1257  return 0;
1258 
1259  default:
1260  return super::WndProc(nmsg, wparam, lparam);
1261  }
1262 }
HGDIOBJ WINAPI GetStockObject(_In_ int)
#define TRUE
Definition: types.h:120
#define WM_LBUTTONDOWN
Definition: winuser.h:1758
static HDC
Definition: imagelist.c:92
BYTE lfUnderline
Definition: dimm.idl:48
#define WM_NCHITTEST
Definition: winuser.h:1668
bool LaunchLink()
Definition: window.h:837
int WINAPI SetBkMode(_In_ HDC, _In_ int)
Definition: dc.c:1032
COLORREF _colorVisited
Definition: window.h:829
#define WM_SETCURSOR
Definition: winuser.h:1618
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
#define TRANSPARENT
Definition: wingdi.h:949
smooth NULL
Definition: ftsmooth.c:416
#define WM_GETFONT
Definition: winuser.h:1633
static HFONT hfont
HCURSOR _crsr_link
Definition: window.h:831
#define IDC_HAND
Definition: winuser.h:693
COLORREF _textColor
Definition: window.h:828
#define HOLLOW_BRUSH
Definition: wingdi.h:898
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
#define PM_DISPATCH_CTLCOLOR
Definition: window.h:593
#define GetObject
Definition: wingdi.h:4467
HDC hdc
Definition: main.c:9
#define LoadCursor
Definition: winuser.h:5787
#define SelectFont(hdc, hfont)
Definition: windowsx.h:491
BOOL WINAPI MessageBeep(_In_ UINT)
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
Definition: text.c:888
HCURSOR WINAPI SetCursor(_In_opt_ HCURSOR)
#define CreateFontIndirect
Definition: wingdi.h:4443
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
virtual LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
Definition: window.cpp:343
#define SendMessage
Definition: winuser.h:5818
#define HTCLIENT
Definition: winuser.h:2450
LONG_PTR LRESULT
Definition: windef.h:209
HFONT _hfont
Definition: window.h:830
static UINT WPARAM wparam
Definition: combo.c:716

Member Data Documentation

◆ _cmd

String HyperlinkCtrl::_cmd

Definition at line 825 of file window.h.

Referenced by init(), and LaunchLink().

◆ _colorVisited

COLORREF HyperlinkCtrl::_colorVisited
protected

Definition at line 829 of file window.h.

Referenced by WndProc().

◆ _crsr_link

HCURSOR HyperlinkCtrl::_crsr_link
protected

Definition at line 831 of file window.h.

Referenced by WndProc().

◆ _hfont

HFONT HyperlinkCtrl::_hfont
protected

Definition at line 830 of file window.h.

Referenced by WndProc(), and ~HyperlinkCtrl().

◆ _textColor

COLORREF HyperlinkCtrl::_textColor
protected

Definition at line 828 of file window.h.

Referenced by WndProc().


The documentation for this struct was generated from the following files: