HMODULE hUser32 = GetModuleHandle(_T("USER32.DLL"));
下面这句该怎么写????
....=....GetProcAddress(hUser32, "UpdateLayeredWindow");
SetWindowLong(GetSafeHwnd(), GWL_EXSTYLE, GetWindowLong(GetSafeHwnd(), GWL_EXSTYLE) | WS_EX_LAYERED);UpdateLayeredWindow(NULL,NULL,&size,&dcMem,&ptSrc,RGB(0,0,0),&blend,ULW_COLORKEY|ULW_ALPHA);
  FreeLibrary(hUser32);

解决方案 »

  1.   

    HMODULE hUser32 = GetModuleHandle(_T("USER32.DLL"));
    m_pUpdateLayeredWindow = (lpfnUpdateLayeredWindow)GetProcAddress(hUser32, "UpdateLayeredWindow");
      

  2.   

    通不过:m_pUpdateLayeredWindow<-这个没定义
      

  3.   

    lpfnUpdateLayeredWindow m_pUpdateLayeredWindow;
      

  4.   

    http://msdn.microsoft.com/library/chs/default.asp?url=/library/CHS/vccore/html/_core_getprocaddress.asp
      

  5.   

    还是通不过lpfnUpdateLayeredWindow m_pUpdateLayeredWindow;lpfnUpdateLayeredWindow' : undeclared identifier
      

  6.   

    这个原因已找到要在开头申明一下:typedef BOOL (WINAPI *UpdateLayeredWindowFunc)(HWND,HDC,POINT*,SIZE*,HDC,POINT*,COLORREF,BLENDFUNCTION*,DWORD);
    UpdateLayeredWindowFunc UpdateLayeredWindow;这样就正常了
    HMODULE hUser32 = GetModuleHandle(_T("USER32.DLL"));
    UpdateLayeredWindow= (UpdateLayeredWindowFunc)GetProcAddress(hUser32, "UpdateLayeredWindow");
    好不容易在国外的网站上发现个源码正是我想要的。。
    可是里面也是漏洞百出,不能顺利的编绎。
    现在只剩最后一个错误了还没解决,而且这错误却是最重要的一个。。唉。。郁闷编译到这里出错:
     UpdateLayeredWindow(m_hWnd, NULL, NULL, &ptWindowScreenPosition, dcMemory, &ptSrc, 0,
                &blendPixelFunction, ULW_ALPHA);    借误信息: error C2059: syntax error : '='实在找不出这里哪出错了了,谁知道??,如果把这句屏蔽了,就可以顺利编译成功。。
    可以做非常漂亮的半透明窗体
    http://www.codeproject.com/gdi/pxalphablend/img.gif
    http://www.codeproject.com/gdi/pxalphablend/img2.gif网址:里面有个188k的源码,谁能帮偶编绎一下,偶好困了。。http://www.codeproject.com/gdi/pxalphablend.asp
      

  7.   

    HINSTANCE hInst = LoadLibrary("User32.DLL"); 
    if(hInst) 

    typedef BOOL(WINAPI *UpdateLayeredWindow)(HWND,HDC,POINT *,SIZE *,HDC,POINT *,COLORREF,BLENDFUNCTION *,DWORD);
    UpdateLayeredWindow ulw = NULL;    //取得UpdateLayeredWindow函数指针 
    ulw=(UpdateLayeredWindow)GetProcAddress(hInst, "UpdateLayeredWindow"); if(ulw)ulw(m_hWnd, NULL, NULL, NULL, NULL, NULL,NULL, &blend, 2);
    FreeLibrary(hInst); 
    }