home *** CD-ROM | disk | FTP | other *** search
/ ftp.sberbank.sumy.ua / 2014.11.ftp.sberbank.sumy.ua.tar / ftp.sberbank.sumy.ua / incoming / 1 / tester.c < prev    next >
C/C++ Source or Header  |  2014-02-08  |  3KB  |  119 lines

  1. /*@@ Wedit generated application. Written Thu Jul 04 16:19:38 2013
  2.  @@header: c:\a_all\22\testerres.h
  3.  @@resources: c:\a_all\22\tester.rc
  4.  Do not edit outside the indicated areas */
  5. /*<---------------------------------------------------------------------->*/
  6. /*<---------------------------------------------------------------------->*/
  7. #include <windows.h>
  8. #include <windowsx.h>
  9. #include <commctrl.h>
  10. #include <string.h>
  11. #include "testerres.h"
  12. /*<---------------------------------------------------------------------->*/
  13. HINSTANCE hInst;        // Instance handle
  14. HWND hwndMain;        //Main window handle
  15.  
  16. LRESULT CALLBACK MainWndProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam);
  17.  
  18. typedef void ( *DLLMESSAGE)( char*, char*);
  19.  
  20. static BOOL InitApplication(void)
  21. {
  22.     WNDCLASS wc;
  23.  
  24.     memset(&wc,0,sizeof(WNDCLASS));
  25.     wc.style = CS_HREDRAW|CS_VREDRAW ;
  26.     wc.lpfnWndProc = (WNDPROC)MainWndProc;
  27.     wc.hInstance = hInst;
  28.     wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
  29.     wc.lpszClassName = "testerWndClass";
  30.     wc.lpszMenuName = MAKEINTRESOURCE(IDMAINMENU);
  31.     wc.hCursor = LoadCursor(NULL,IDC_ARROW);
  32.     wc.hIcon = LoadIcon(NULL,IDI_APPLICATION);
  33.     if (!RegisterClass(&wc))
  34.         return 0;
  35. /*@@0<-@@*/
  36.     // ---TODO--- Call module specific initialization routines here
  37.  
  38.     return 1;
  39. }
  40.  
  41. /*<---------------------------------------------------------------------->*/
  42. /*@@1->@@*/
  43. HWND CreatetesterWndClassWnd(void)
  44. {
  45.     return CreateWindow("testerWndClass","tester",
  46.         WS_MINIMIZEBOX|WS_VISIBLE|WS_CLIPSIBLINGS|WS_CLIPCHILDREN|WS_MAXIMIZEBOX|WS_CAPTION|WS_BORDER|WS_SYSMENU|WS_THICKFRAME,
  47.         100,100,500,200,
  48.         NULL,
  49.         NULL,
  50.         hInst,
  51.         NULL);
  52. }
  53. /*@@1<-@@*/
  54. /*<---------------------------------------------------------------------->*/
  55. /* --- The following code comes from C:\a_C\lcc\lib\wizard\defOnCmd.tpl. */
  56. void MainWndProc_OnCommand(HWND hwnd, int id, HWND hwndCtl, UINT codeNotify)
  57. {
  58.     switch(id) {
  59.         // ---TODO--- Add new menu commands here
  60.         /*@@NEWCOMMANDS@@*/
  61.         case IDM_EXIT:
  62.         PostMessage(hwnd,WM_CLOSE,0,0);
  63.         break;
  64.     }
  65. }
  66.  
  67. /*<---------------------------------------------------------------------->*/
  68. /*@@2->@@*/
  69. LRESULT CALLBACK MainWndProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam)
  70. {
  71.   HINSTANCE hinstLib;
  72.   DLLMESSAGE DllMessage;
  73.  
  74.     switch (msg) {
  75.     case WM_CREATE:
  76.         hinstLib = LoadLibrary("JTBknv01.dll");
  77.        if( hinstLib == NULL) MessageBox( hwnd,"Load","Load",0);
  78.         DllMessage = (DLLMESSAGE)GetProcAddress( hinstLib, "JpgInToBmpOut");
  79.        if( DllMessage == NULL) MessageBox( hwnd,"Proc","Proc",0);
  80.  
  81.         DllMessage( "IMG3592A.jpg","Konved5.bmp");
  82.  
  83.         return 0;
  84.     case WM_COMMAND:
  85.  
  86.         break;
  87.     case WM_DESTROY:
  88.         PostQuitMessage(0);
  89.         break;
  90.     default:
  91.         return DefWindowProc(hwnd,msg,wParam,lParam);
  92.     }
  93. /*@@3<-@@*/
  94.     return 0;
  95. }
  96. /*@@2<-@@*/
  97.  
  98. /*<---------------------------------------------------------------------->*/
  99. int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, INT nCmdShow)
  100. {
  101.     MSG msg;
  102.     HANDLE hAccelTable;
  103.  
  104.     hInst = hInstance;
  105.     if (!InitApplication())
  106.         return 0;
  107.     hAccelTable = LoadAccelerators(hInst,MAKEINTRESOURCE(IDACCEL));
  108.     if ((hwndMain = CreatetesterWndClassWnd()) == (HWND)0)
  109.         return 0;
  110.     ShowWindow(hwndMain,SW_SHOW);
  111.     while (GetMessage(&msg,NULL,0,0)) {
  112.         if (!TranslateAccelerator(msg.hwnd,hAccelTable,&msg)) {
  113.             TranslateMessage(&msg);
  114.             DispatchMessage(&msg);
  115.         }
  116.     }
  117.     return msg.wParam;
  118. }
  119.