很久没写代码,一天几行的代码:
typedef int ( *PFUN)(HWND hWnd, LPCTSTR lpText, LPCTSTR lpCaption, UINT uType);
void CTestProcessMonitorDlg::OnBnClickedButton1()
{
// TODO: Add your control notification handler code here
//MessageBox(TEXT("Hello"), TEXT("Test"));
//typedef void (*pfv) ();
HMODULE hmod = ::LoadLibraryExW(TEXT("user32.dll"), NULL, 0);
if (hmod != NULL)
{
PFUN pFun= (PFUN)GetProcAddress(hmod, "MessageBoxW");
if (pFun != NULL)
{
pFun(m_hWnd, TEXT("Hello"), TEXT("Test"), MB_YESNO);
}