在Windows目錄下一般只有system32目錄,但是如果是64位元的作業系統,Windows目錄下就會多出一個SysWoW64目錄。
一般32位元系統下system32是存放32位元的元件但是到了64位元系統就不一樣了。
Windows\System32 目錄放置所有 64位元的元件。
Windows\SysWOW64 目錄放置所有 32位元的元件。
WOW64其實是 Windows-on-Windows 64bit 的縮寫,主要的目的在於讓64位元的 Windows 可以執行32位元的應用程式。所有舉凡64位元的Windows版本中都有支援,像是 Windows XP x64 Edition、Windows Vista、Windows 7、Windows Server 2003、Windows Server 2008等。
所以以後在64位元系統上如果有32位元程式需要放置或呼叫DLL,就到這裡就對了。
2016年5月30日 星期一
2016年5月5日 星期四
[MFC] Single app execute
檢查應用程式是否已經執行,已執行則將該程序顯示到最前面。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BOOL CMyApp::InitInstance() | |
{ | |
HANDLE hMutex = NULL; | |
hMutex = CreateMutex(NULL, true, m_pszAppName); | |
if (GetLastError() == ERROR_ALREADY_EXISTS) | |
{ | |
CWnd* pFirstWnd = (CWnd::FindWindow(NULL, "My App Full Name")); | |
if (pFirstWnd != NULL) | |
{ | |
pFirstWnd->ShowWindow(SW_SHOWNORMAL); | |
pFirstWnd->BringWindowToTop(); | |
pFirstWnd->GetLastActivePopup()->BringWindowToTop(); | |
} | |
return(false); | |
} | |
} |
[MFC] Close all popup modal dialog
關閉應用程式的時候需要順便把DoModal dialog一起順便關閉,不然應用程式會等待dialog的Close事件才會結束應用程式。
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void ClosePopupDialog() | |
{ | |
HWND hWndParent = NULL; | |
HWND hWndChild = ::GetWindow(this->m_hWnd, GW_ENABLEDPOPUP); | |
if (hWndChild) | |
{ | |
do | |
{ | |
hWndParent = ::GetParent(hWndChild); | |
CWnd *pWnd = CWnd::FromHandle(hWndChild); | |
pWnd->EndModalLoop(0); // stop modal thread | |
::EndDialog(hWndChild, 0); // close dialog | |
hWndChild = hWndParent; | |
} while (hWndParent != this->m_hWnd); | |
} | |
} |
訂閱:
文章 (Atom)