myWinAttrib.cpp
上传用户:hyb6888
上传日期:2016-01-24
资源大小:5186k
文件大小:1k
源码类别:

输入法编程

开发平台:

Visual C++

  1. #include "stdafx.h"
  2. #include "myWinAttrib.h"
  3. myWinAttrib::myWinAttrib()
  4. {
  5. hUser32 = GetModuleHandle("user32.dll"); 
  6. SetLayeredWindowAttributes = (lpfnSetLayeredWindowAttributes)GetProcAddress(hUser32,"SetLayeredWindowAttributes"); 
  7. myWinAttrib::~myWinAttrib()
  8. {
  9. FreeLibrary(hUser32);//卸载TranChiDll.dll文件;
  10. int myWinAttrib::mySetWindow(HWND hWnd, long crKey, BYTE bAlpha, DWORD dwFlags)
  11. {
  12. SetWindowLong(hWnd, GWL_EXSTYLE, GetWindowLong(hWnd, GWL_EXSTYLE) | 0x080000L);
  13. SetLayeredWindowAttributes(hWnd, crKey , bAlpha, dwFlags);
  14. return 0;
  15. }