Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
guolisen committed Apr 24, 2013
1 parent d53fa6d commit e1617e7
Show file tree
Hide file tree
Showing 9 changed files with 33 additions and 123 deletions.
Binary file modified OfficeVol2.ncb
Binary file not shown.
Binary file modified OfficeVol2.suo
Binary file not shown.
119 changes: 6 additions & 113 deletions OfficeVol2/DlgModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,7 @@ LRESULT VolMainForm::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_TIMER: lRes = OnTimer(uMsg, wParam, lParam, bHandled); break;
case WM_HOTKEY: lRes = OnHotKey(uMsg, wParam, lParam, bHandled); break;
case MSG_DISMISS_OPTION: lRes = OnOptDismiss(uMsg, wParam, lParam, bHandled); break;
case MSG_SHOW_PAD: lRes = OnShowPad(uMsg, wParam, lParam, bHandled); break;

default:
bHandled = FALSE;
Expand All @@ -335,124 +336,16 @@ LRESULT VolMainForm::OnHotKey(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHa
return OFF_OK;
}

#if 0
LRESULT VolMainForm::OnKeyHook(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
//KBDLLHOOKSTRUCT *Key_Info = (KBDLLHOOKSTRUCT*)v_lParam;

if (wParam==0xbe && GetAsyncKeyState(
VK_CONTROL)<0 && GetAsyncKeyState(
VK_MENU)<0) {
if (lParam & 0x80000000) {
//组合键弹起

}
else {
//组合键被按下
OfficeVolModule::GetInstance()->VolUp();
mProgress->SetValue(OfficeVolModule::GetInstance()->GetCurrentVolume());
ShowPad();

}
}
else if (wParam==0xbc && GetAsyncKeyState(
VK_CONTROL)<0 && GetAsyncKeyState(
VK_MENU)<0)
{
if (lParam & 0x80000000) {
//组合键弹起

}
else {
//组合键被按下
OfficeVolModule::GetInstance()->VolDown();
mProgress->SetValue(OfficeVolModule::GetInstance()->GetCurrentVolume());
ShowPad();
}
}
else if (wParam=='1' && GetAsyncKeyState(
VK_CONTROL)<0 && GetAsyncKeyState(
VK_MENU)<0)
{
if (lParam & 0x80000000) {
//组合键弹起

}
else {
OfficeVolModule::GetInstance()->ChangeVolType(MASTER_VOL);
mProgress->SetValue(OfficeVolModule::GetInstance()->GetCurrentVolume());
ShowPad();
}

}
else if (wParam=='2' && GetAsyncKeyState(
VK_CONTROL)<0 && GetAsyncKeyState(
VK_MENU)<0)
{
if (lParam & 0x80000000) {
//组合键弹起

}
else {
OfficeVolModule::GetInstance()->ChangeVolType(WAVE_VOL);
mProgress->SetValue(OfficeVolModule::GetInstance()->GetCurrentVolume());
ShowPad();
}
}
else if (wParam=='Q' && GetAsyncKeyState(
VK_CONTROL)<0 && GetAsyncKeyState(
VK_MENU)<0)
{
if (lParam & 0x80000000) {
//组合键弹起

}
else {
::MessageBox(m_hWnd, "再见!", "Create By Guolisen", MB_OK);
SetKeyHook(FALSE, 0, m_hWnd);
OfficeVolModule::GetInstance()->UnInit();

::PostMessage(m_hWnd, WM_DESTROY, 0, 0);
}
}

else if (wParam=='O' && GetAsyncKeyState(
VK_CONTROL)<0 && GetAsyncKeyState(
VK_MENU)<0)
{
if (lParam & 0x80000000) {
//组合键弹起

}
else {
OfficeVolModule::GetInstance()->Enable();
ShowPad();
}

}
else if (wParam=='F' && GetAsyncKeyState(
VK_CONTROL)<0 && GetAsyncKeyState(
VK_MENU)<0)
{
if (lParam & 0x80000000) {
//组合键弹起

}
else {
OfficeVolModule::GetInstance()->Disable();
ShowPad();
}

}

return 0;
}
#endif
LRESULT VolMainForm::OnTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
HidePad();
return 0;
}
LRESULT VolMainForm::OnShowPad(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
ShowPad();
return 0;
}

LRESULT VolMainForm::SetVolLogo(DWORD vol_level)
{
Expand Down
2 changes: 2 additions & 0 deletions OfficeVol2/DlgModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
using namespace DuiLib;


#define MSG_SHOW_PAD WM_USER + 123 // ¼üÅÌÏûÏ¢

typedef std::map<ATOM, std::string> HOTKEY_MAP;

Expand Down Expand Up @@ -38,6 +39,7 @@ class VolMainForm : public CWindowWnd, public INotifyUI, public OfficeVolDelegat
LRESULT OnOptDismiss(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
LRESULT OnHotKey(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
LRESULT OnTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
LRESULT OnShowPad(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);

LRESULT HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam);

Expand Down
22 changes: 12 additions & 10 deletions OfficeVol2/WinMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,19 @@ BOOL IfAppExist()
HWND hProgramWnd = ::FindWindow(NULL, _T("OfficeVol"));
if (hProgramWnd)
{
WINDOWPLACEMENT* pWndpl = NULL;
WINDOWPLACEMENT wpm;
pWndpl =&wpm;
GetWindowPlacement(hProgramWnd,&wpm);
if (pWndpl)
{
::PostMessage(hProgramWnd, MSG_SHOW_PAD, 0, 0);

//WINDOWPLACEMENT* pWndpl = NULL;
//WINDOWPLACEMENT wpm;
//pWndpl =&wpm;
//GetWindowPlacement(hProgramWnd,&wpm);
//if (pWndpl)
//{
//将运行的程序窗口还原成正常状态
pWndpl->showCmd = SW_SHOWNORMAL;
::SetWindowPlacement(hProgramWnd,pWndpl);
SetWindowPos(hProgramWnd,HWND_NOTOPMOST,0,0,0,0,SWP_NOSIZE|SWP_NOMOVE);
}
// pWndpl->showCmd = SW_SHOWNORMAL;
// ::SetWindowPlacement(hProgramWnd,pWndpl);
// SetWindowPos(hProgramWnd,HWND_NOTOPMOST,0,0,0,0,SWP_NOSIZE|SWP_NOMOVE);
//}
}
//关闭进程互斥体
CloseHandle(hMutex);
Expand Down
13 changes: 13 additions & 0 deletions bin/Microsoft.VC90.DebugCRT.manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!-- Copyright (c) Microsoft Corporation. All rights reserved. -->
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<noInheritable/>
<assemblyIdentity
type="win32"
name="Microsoft.VC90.DebugCRT"
version="9.0.21022.8"
processorArchitecture="x86"
publicKeyToken="1fc8b3b9a1e18e3b"
/>
<file name="msvcr90d.dll" /> <file name="msvcp90d.dll" /> <file name="msvcm90d.dll" />
</assembly>
Binary file added bin/msvcm90d.dll
Binary file not shown.
Binary file added bin/msvcp90d.dll
Binary file not shown.
Binary file added bin/msvcr90d.dll
Binary file not shown.

0 comments on commit e1617e7

Please sign in to comment.