//Login Screen using Dailog Box
#include"windows.h"
#include"resource.h"
int i=0;
char str1[20],str2[20];
HANDLE hInst;
LRESULT CALLBACK WndProc(HWND,UINT,WPARAM,
LRESULT CALLBACK login(HWND,UINT,WPARAM,LPARAM)
int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,PSTR
szCmdLine,int iCmdShow)
{
HWND hwnd;
MSG msg;
WNDCLASS wc;
static char szAppName[]="USERNAME AND PASSWORD";
wc.cbClsExtra =0;
wc.cbWndExtra =0;
wc.hbrBackground =(HBRUSH)GetStockObject(WHITE_
wc.hCursor =LoadCursor(NULL,IDC_ARROW);
wc.hIcon =LoadIcon(NULL,IDI_
wc.lpfnWndProc=WndProc;
wc.lpszClassName=szAppName;
wc.lpszMenuName=NULL;
wc.hInstance =hInstance;
wc.style =CS_HREDRAW|CS_VREDRAW;
RegisterClass(&wc);
hwnd=CreateWindow(szAppName,
WS_VISIBLE, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance, NULL);
UpdateWindow(hwnd);
while(GetMessage(&msg,NULL,0,
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam ;
}
LRESULT CALLBACK WndProc(HWND hwnd,UINT message,WPARAM wParam,
LPARAM lParam)
{
static HINSTANCE hInstance;
DLGPROC dlgProc;
switch(message)
{
case WM_SIZE:
dlgProc=(DLGPROC)
DialogBox((
MAKEINTRESOU
return 0;
case WM_DESTROY:
PostQuitMessage(0)
return 0;
}
return DefWindowProc(hwnd,message,
}
LRESULT CALLBACK login(HWND hdlg,UINT message,WPARAM wParam,
LPARAM lParam)
{
switch(message)
{
case WM_COMMAND:
switch(
{
case IDC_EDIT1:
case IDC_EDIT2:
return 0;
case IDOK:
MessageBox(hdlg,"Login Successful","Message",
MessageBox(hdlg,"Login Failed", “Message",
MB_OK|MB_
"Message",MB_OK|MB_
case WM_DESTROY:
}
break;
}
return 0l;
}
No comments:
Post a Comment