foobar2000 SDK  2015-01-14
Data Structures | Namespaces | Functions
win-objects.h File Reference

Go to the source code of this file.

Data Structures

class  CClipboardOpenScope
 
class  CGlobalLockScope
 
class  CGlobalLockScopeT< TItem >
 
class  CoTaskMemObject< TPtr >
 
class  DCStateScope
 
class  exception_com
 
struct  exception_win32
 
class  format_hresult
 
class  format_win32_error
 
class  ImplementCOMRefCounter< TBase >
 
class  LastErrorRevertScope
 
class  OffsetWindowOrgScope
 
class  SelectObjectScope
 
class  win32_accelerator
 
class  win32_event
 
class  win32_icon
 
class  win32_menu
 

Namespaces

 pfc
 

Functions

unsigned GetHotkeyModifierFlags ()
 
WORD GetWindowsVersionCode () throw ()
 
bool pfc::isAltKeyPressed ()
 
bool pfc::isCtrlKeyPressed ()
 
bool IsKeyPressed (unsigned vk)
 
bool IsPointInsideControl (const POINT &pt, HWND wnd)
 
bool pfc::isShiftKeyPressed ()
 
bool IsWindowChildOf (HWND child, HWND parent)
 
unsigned MapDialogWidth (HWND p_dialog, unsigned p_value)
 
void uAddWindowExStyle (HWND p_wnd, LONG p_style)
 
void uAddWindowStyle (HWND p_wnd, LONG p_style)
 
void uRemoveWindowExStyle (HWND p_wnd, LONG p_style)
 
void uRemoveWindowStyle (HWND p_wnd, LONG p_style)
 
void uSleepSeconds (double p_time, bool p_alertable)
 
BOOL pfc::winFormatSystemErrorMessage (pfc::string_base &p_out, DWORD p_code)
 
void pfc::winPrefixPath (pfc::string_base &out, const char *p_path)
 
void pfc::winUnPrefixPath (pfc::string_base &out, const char *p_path)
 

Function Documentation

unsigned GetHotkeyModifierFlags ( )

Returns current modifier keys pressed, using win32 MOD_* flags.

Definition at line 127 of file win-objects.cpp.

127  {
128  unsigned ret = 0;
129  if (IsKeyPressed(VK_CONTROL)) ret |= MOD_CONTROL;
130  if (IsKeyPressed(VK_SHIFT)) ret |= MOD_SHIFT;
131  if (IsKeyPressed(VK_MENU)) ret |= MOD_ALT;
132  if (IsKeyPressed(VK_LWIN) || IsKeyPressed(VK_RWIN)) ret |= MOD_WIN;
133  return ret;
134 }
bool IsKeyPressed(unsigned vk)
WORD GetWindowsVersionCode ( )
throw (
)

Definition at line 285 of file win-objects.cpp.

285  {
286  const DWORD ver = GetVersion();
287  return (WORD)HIBYTE(LOWORD(ver)) | ((WORD)LOBYTE(LOWORD(ver)) << 8);
288 }
bool IsKeyPressed ( unsigned  vk)

Definition at line 122 of file win-objects.cpp.

122  {
123  return (GetKeyState(vk) & 0x8000) ? true : false;
124 }
bool IsPointInsideControl ( const POINT &  pt,
HWND  wnd 
)

Definition at line 162 of file win-objects.cpp.

162  {
163  HWND walk = WindowFromPoint(pt);
164  for(;;) {
165  if (walk == NULL) return false;
166  if (walk == wnd) return true;
167  if (GetWindowLong(walk,GWL_STYLE) & WS_POPUP) return false;
168  walk = GetParent(walk);
169  }
170 }
bool IsWindowChildOf ( HWND  child,
HWND  parent 
)

Definition at line 172 of file win-objects.cpp.

172  {
173  HWND walk = child;
174  while(walk != parent && walk != NULL && (GetWindowLong(walk,GWL_STYLE) & WS_CHILD) != 0) {
175  walk = GetParent(walk);
176  }
177  return walk == parent;
178 }
unsigned MapDialogWidth ( HWND  p_dialog,
unsigned  p_value 
)

Definition at line 115 of file win-objects.cpp.

115  {
116  RECT temp;
117  temp.left = 0; temp.right = p_value; temp.top = temp.bottom = 0;
118  if (!MapDialogRect(p_dialog,&temp)) return 0;
119  return temp.right;
120 }
void uAddWindowExStyle ( HWND  p_wnd,
LONG  p_style 
)

Definition at line 107 of file win-objects.cpp.

107  {
108  SetWindowLong(p_wnd,GWL_EXSTYLE, GetWindowLong(p_wnd,GWL_EXSTYLE) | p_style);
109 }
void uAddWindowStyle ( HWND  p_wnd,
LONG  p_style 
)

Definition at line 99 of file win-objects.cpp.

99  {
100  SetWindowLong(p_wnd,GWL_STYLE, GetWindowLong(p_wnd,GWL_STYLE) | p_style);
101 }
void uRemoveWindowExStyle ( HWND  p_wnd,
LONG  p_style 
)

Definition at line 111 of file win-objects.cpp.

111  {
112  SetWindowLong(p_wnd,GWL_EXSTYLE, GetWindowLong(p_wnd,GWL_EXSTYLE) & ~p_style);
113 }
void uRemoveWindowStyle ( HWND  p_wnd,
LONG  p_style 
)

Definition at line 103 of file win-objects.cpp.

103  {
104  SetWindowLong(p_wnd,GWL_STYLE, GetWindowLong(p_wnd,GWL_STYLE) & ~p_style);
105 }
void uSleepSeconds ( double  p_time,
bool  p_alertable 
)

Definition at line 219 of file nix-objects.cpp.

219  {
220  pfc::nixSleep( seconds );
221 }
void nixSleep(double seconds)