mirror of
https://github.com/reactos/reactos.git
synced 2025-04-04 20:50:41 +00:00
launch sound control panel applet
svn path=/trunk/; revision=8751
This commit is contained in:
parent
fda8c77b11
commit
dcb0a46bfe
3 changed files with 23 additions and 18 deletions
|
@ -241,7 +241,7 @@ LRESULT DesktopBar::WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
|
|||
case WM_TIMER:
|
||||
if (wparam == ID_TRAY_VOLUME) {
|
||||
KillTimer(_hwnd, wparam);
|
||||
WinExec("sndvol32.exe -t", SW_SHOWNORMAL); // launch volume control in small mode
|
||||
launch_file(_hwnd, TEXT("sndvol32.exe"), SW_SHOWNORMAL, TEXT("-t")); // launch volume control in small mode
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -323,7 +323,11 @@ int DesktopBar::Command(int id, int code)
|
|||
break;}
|
||||
|
||||
case ID_TRAY_VOLUME:
|
||||
WinExec("sndvol32.exe", SW_SHOWNORMAL);
|
||||
launch_file(_hwnd, TEXT("sndvol32.exe"), SW_SHOWNORMAL); // launch volume control application
|
||||
break;
|
||||
|
||||
case ID_VOLUME_PROPERTIES:
|
||||
RunDLL(_hwnd, TEXT("shell32"), "Control_RunDLL", TEXT("mmsys.cpl"), SW_SHOWNORMAL);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -394,7 +398,7 @@ void DesktopBar::TrayDblClick(UINT id, int btn)
|
|||
switch(id) {
|
||||
case ID_TRAY_VOLUME:
|
||||
KillTimer(_hwnd, ID_TRAY_VOLUME); // finish one-click timer
|
||||
WinExec("sndvol32.exe", SW_SHOWNORMAL);
|
||||
launch_file(_hwnd, TEXT("sndvol32.exe"), SW_SHOWNORMAL); // launch volume control application
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -176,11 +176,11 @@ BOOL time_to_filetime(const time_t* t, FILETIME* ftime)
|
|||
}
|
||||
|
||||
|
||||
BOOL launch_file(HWND hwnd, LPCTSTR cmd, UINT nCmdShow)
|
||||
BOOL launch_file(HWND hwnd, LPCTSTR cmd, UINT nCmdShow, LPCTSTR parameters)
|
||||
{
|
||||
CONTEXT("launch_file()");
|
||||
|
||||
HINSTANCE hinst = ShellExecute(hwnd, NULL/*operation*/, cmd, NULL/*parameters*/, NULL/*dir*/, nCmdShow);
|
||||
HINSTANCE hinst = ShellExecute(hwnd, NULL/*operation*/, cmd, parameters, NULL/*dir*/, nCmdShow);
|
||||
|
||||
if ((int)hinst <= 32) {
|
||||
display_error(hwnd, GetLastError());
|
||||
|
@ -191,9 +191,9 @@ BOOL launch_file(HWND hwnd, LPCTSTR cmd, UINT nCmdShow)
|
|||
}
|
||||
|
||||
#ifdef UNICODE
|
||||
BOOL launch_fileA(HWND hwnd, LPSTR cmd, UINT nCmdShow)
|
||||
BOOL launch_fileA(HWND hwnd, LPSTR cmd, UINT nCmdShow, LPCSTR parameters)
|
||||
{
|
||||
HINSTANCE hinst = ShellExecuteA(hwnd, NULL/*operation*/, cmd, NULL/*parameters*/, NULL/*dir*/, nCmdShow);
|
||||
HINSTANCE hinst = ShellExecuteA(hwnd, NULL/*operation*/, cmd, parameters, NULL/*dir*/, nCmdShow);
|
||||
|
||||
if ((int)hinst <= 32) {
|
||||
display_error(hwnd, GetLastError());
|
||||
|
|
|
@ -146,17 +146,6 @@ extern BOOL time_to_filetime(const time_t* t, FILETIME* ftime);
|
|||
// search for windows of a specific classname
|
||||
extern int find_window_class(LPCTSTR classname);
|
||||
|
||||
// launch a program or document file
|
||||
extern BOOL launch_file(HWND hwnd, LPCTSTR cmd, UINT nCmdShow);
|
||||
#ifdef UNICODE
|
||||
extern BOOL launch_fileA(HWND hwnd, LPSTR cmd, UINT nCmdShow);
|
||||
#else
|
||||
#define launch_fileA launch_file
|
||||
#endif
|
||||
|
||||
// call an DLL export like rundll32
|
||||
BOOL RunDLL(HWND hwnd, LPCTSTR dllname, LPCSTR procname, LPCTSTR cmdline, UINT nCmdShow);
|
||||
|
||||
// create a directory with all missing parent directories
|
||||
BOOL RecursiveCreateDirectory(LPCTSTR path_in);
|
||||
|
||||
|
@ -197,6 +186,18 @@ using namespace _com_util;
|
|||
#endif // _MSC_VER && !_NO_COMUTIL
|
||||
|
||||
|
||||
// launch a program or document file
|
||||
extern BOOL launch_file(HWND hwnd, LPCTSTR cmd, UINT nCmdShow, LPCTSTR parameters=NULL);
|
||||
#ifdef UNICODE
|
||||
extern BOOL launch_fileA(HWND hwnd, LPSTR cmd, UINT nCmdShow, LPCSTR parameters=NULL);
|
||||
#else
|
||||
#define launch_fileA launch_file
|
||||
#endif
|
||||
|
||||
// call an DLL export like rundll32
|
||||
BOOL RunDLL(HWND hwnd, LPCTSTR dllname, LPCSTR procname, LPCTSTR cmdline, UINT nCmdShow);
|
||||
|
||||
|
||||
/// initialization of windows common controls
|
||||
struct CommonControlInit
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue