else
if
(wParam
==
ID_LOGIN) {
GetDlgItemText(hWnd,
IDC_USER,
szuserbuf,sizeof(szuserbuf)/sizeof(WCHAR));
GetDlgItemText(hWnd,
IDC_PASS,
szpassbuf,sizeof(szpassbuf)/sizeof(WCHAR));
if
(wcscmp(szuserbuf,L"123")
== 0 &&
wcscmp(szpassbuf,
L"1234") ==0 )
{
//SendMessage(hWnd,
WM_CLOSE, 0, 0);
ShowWindow(hWnd,
SW_HIDE);
//隱藏窗口
DialogBox(hInst,
MAKEINTRESOURCE(IDD_REGIST),
hWnd,
About);
// DialogBox(hInst,
MAKEINTRESOURCE(IDD_Show), hWnd, About);
}
////
[System.Runtime.InteropServices.DllImportAttribute("user32.dll", EntryPoint="ShowWindow")]
public static extern bool ShowWindow(System.IntPtr hWnd, int nCmdShow) ;
public const int SW_SHOW = 5;
public const int SW_HIDE = 0;
顯示窗體
ShowWindow(handler,SW_SHOW );
隱藏窗體
ShowWindow(handler,SW_HIDE );
handler是窗體句柄