home *** CD-ROM | disk | FTP | other *** search
/ HTBasic 9.3 / HTBasic 9.3.iso / 93win / data1.cab / DLL_Toolkit / Source / BitmapDLL / TouchBitmap.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2005-03-02  |  1.0 KB  |  50 lines

  1. /////////////////////////////////////////////
  2. //  File is: TouchBitmap.cpp
  3. /////////////////////////////////////////////
  4.  
  5. #include "StdAfx.h"
  6. #include "TouchBitmap.h"
  7. #include "PromptDlg.h"
  8. #include "export.h"
  9.  
  10.  
  11. void TouchBitmap()
  12. {
  13.     AFX_MANAGE_STATE(AfxGetStaticModuleState());
  14.  
  15.     CPromptDlg Prompt;
  16.  
  17.     Prompt.DoModal();
  18.  
  19.     {
  20.     HBITMAP hBasicMap;
  21.     HBITMAP    oldBitMap;
  22.     CDC BasicDC;
  23.     HDC hBasicHandle;
  24.     RECT BasicRect;
  25.  
  26.         hBasicHandle = GetDC(g_hBasicWindow);
  27.         BasicDC.CreateCompatibleDC(CDC::FromHandle(hBasicHandle));
  28.         ReleaseDC(g_hBasicWindow, hBasicHandle);
  29.  
  30.         hBasicMap = GetBasicBitmapHandle();
  31.  
  32.         oldBitMap = (HBITMAP)BasicDC.SelectObject(hBasicMap);
  33.  
  34.         BasicDC.FillSolidRect(350, 350, 100, 100, (COLORREF)(0x004488CC));
  35.  
  36.         /****/
  37.             GetClientRect(g_hBasicWindow, &BasicRect);
  38.             InvalidateRect(g_hBasicWindow, &BasicRect, TRUE);
  39.             UpdateWindow(g_hBasicWindow);
  40.         /****/
  41.  
  42.  
  43.         BasicDC.SelectObject(oldBitMap);
  44.  
  45. ////        CWnd::FromHandle(g_hBasicWindow)->UpdateWindow();
  46.         
  47.  
  48.     }    // play with the handle block
  49.  
  50. }    // TouchBitmap