VC++ MessageBox的使用

voidButton_Click(System::Object ^sender, System::EventArgs ^e)
{
void* p = Handle.ToPointer();
HWNDhwnd = (HWND)p;
if(::IsWindow(hwnd))
System::Windows::Forms::MessageBox::Show(L"是的");
else
System::Windows::Forms::MessageBox::Show(L"不是");
System::String ^ stringObject = sender->ToString();
pin_ptr <constwchar_t> wszString = PtrToStringChars(stringObject);
::MessageBoxW(hwnd, (LPCWSTR)wszString, L"info", MB_OK);
}

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章