ReactOS  0.4.12-dev-51-ge94618b
tray.c File Reference
#include "sndvol32.h"
Include dependency graph for tray.c:

Go to the source code of this file.

Functions

static VOID OnTrayInitDialog (HWND hwnd, WPARAM wParam, LPARAM lParam)
 
INT_PTR CALLBACK TrayDlgProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 

Function Documentation

◆ OnTrayInitDialog()

static VOID OnTrayInitDialog ( HWND  hwnd,
WPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 11 of file tray.c.

Referenced by TrayDlgProc().

15 {
16  POINT ptCursor;
17  RECT rcWindow;
18  RECT rcScreen;
19  LONG x, y, cx, cy;
20 
21  GetCursorPos(&ptCursor);
22 
23  GetWindowRect(hwnd, &rcWindow);
24 
25  GetWindowRect(GetDesktopWindow(), &rcScreen);
26 
27  cx = rcWindow.right - rcWindow.left;
28  cy = rcWindow.bottom - rcWindow.top;
29 
30  if (ptCursor.y + cy > rcScreen.bottom)
31  y = ptCursor.y - cy;
32  else
33  y = ptCursor.y;
34 
35  if (ptCursor.x + cx > rcScreen.right)
36  x = ptCursor.x - cx;
37  else
38  x = ptCursor.x;
39 
40  SetWindowPos(hwnd, HWND_TOPMOST, x, y, 0, 0, SWP_NOSIZE);
41 
42  /* Disable the controls for now */
45 }
#define IDC_LINE_SLIDER_VERT
Definition: resources.h:25
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
LONG top
Definition: windef.h:297
#define HWND_TOPMOST
Definition: winuser.h:1194
LONG left
Definition: windef.h:296
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
Definition: cursoricon.c:2635
LONG right
Definition: windef.h:298
INT INT y
Definition: msvc.h:62
long LONG
Definition: pedump.c:60
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:570
HWND WINAPI GetDesktopWindow(void)
Definition: window.c:622
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
#define SWP_NOSIZE
Definition: winuser.h:1230
INT x
Definition: msvc.h:62
_Out_opt_ int * cx
Definition: commctrl.h:570
LONG bottom
Definition: windef.h:299
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
#define IDC_LINE_SWITCH
Definition: resources.h:23

◆ TrayDlgProc()

INT_PTR CALLBACK TrayDlgProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 50 of file tray.c.

Referenced by _tWinMain().

55 {
56  switch (uMsg)
57  {
58  case WM_INITDIALOG:
59  OnTrayInitDialog(hwndDlg, wParam, lParam);
60  break;
61 
62  case WM_ACTIVATE:
63  if (LOWORD(wParam) == WA_INACTIVE)
64  EndDialog(hwndDlg, IDOK);
65  break;
66  }
67 
68  return 0;
69 }
#define IDOK
Definition: winuser.h:824
BOOL WINAPI EndDialog(_In_ HWND, _In_ INT_PTR)
WPARAM wParam
Definition: combotst.c:138
static VOID OnTrayInitDialog(HWND hwnd, WPARAM wParam, LPARAM lParam)
Definition: tray.c:11
#define WM_ACTIVATE
Definition: winuser.h:1594
#define WA_INACTIVE
Definition: winuser.h:2576
#define WM_INITDIALOG
Definition: winuser.h:1715
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82