/*************************************************************************** $RCSfile: chipcardd.c,v $ ------------------- cvs : $Id: chipcardd.c,v 1.2 2003/04/22 22:59:27 aquamaniac Exp $ begin : Mon Apr 21 2003 copyright : (C) 2003 by Martin Preuss email : martin@libchipcard.de **************************************************************************** * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the Free Software * * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ****************************************************************************/ #ifdef HAVE_CONFIG_H # include #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include LRESULT CALLBACK WndProc(HWND, UINT, UINT, LONG) ; int WINAPI WinMain(HINSTANCE hInstance , HINSTANCE hPrevInstance , LPSTR lpszCmdParam , int nCmdShow) { MSG msg ; HWND hwnd ; WNDCLASS wndclass ; if (!hPrevInstance) { wndclass.style = CS_HREDRAW | CS_VREDRAW ; wndclass.lpfnWndProc = WndProc ; wndclass.cbClsExtra = 0 ; wndclass.cbWndExtra = 0 ; wndclass.hInstance = hInstance ; wndclass.hIcon = LoadIcon (NULL , IDI_APPLICATION) ; wndclass.hCursor = LoadCursor (NULL , IDC_ARROW) ; wndclass.hbrBackground = GetStockObject (LTGRAY_BRUSH) ; wndclass.lpszMenuName = NULL ; wndclass.lpszClassName = "ChipcarddWindow" ; RegisterClass (&wndclass) ; } hwnd = CreateWindow ("ChipcarddWindow" , "Chipcard Server" , WS_OVERLAPPEDWINDOW , CW_USEDEFAULT , CW_USEDEFAULT , CW_USEDEFAULT , CW_USEDEFAULT , NULL , NULL , hInstance , NULL) ; ShowWindow (hwnd , nCmdShow) ; UpdateWindow (hwnd) ; /* Main Message Loop */ while (GetMessage (&msg , NULL , 0 , 0)) { TranslateMessage (&msg) ; DispatchMessage (&msg) ; } /* while */ return msg.wParam ; } LRESULT CALLBACK WndProc(HWND hwnd , UINT message , UINT wParam , LONG lParam) { switch (message) { case WM_DESTROY: PostQuitMessage (0) ; return 0 ; break; default: break; } return DefWindowProc (hwnd , message , wParam , lParam) ; }