Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
V

vladimir_india

@vladimir_india
About
Posts
7
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Getting the Image of a WIndow
    V vladimir_india

    Hats off! undoubtedly, its a great article. But something strange happened when i used WM_PRINT. None of the windows got printed, except my very own application window. Actually my application is kind of SPY++, so it identifies a window by mouse cursor position. The HWND is then send to the folowing function get_image(). following is the code snippet i'm using currently: BOOL CVenomDlg::get_image(HWND hwnd) { HBITMAP hBitmap ; HDC hdc,hdcMem; BITMAP bitmap ; RECT rc; ::GetWindowRect(hwnd,&rc);//get the bounding rectamgle hdc=::GetDC(hwnd);//get the dc hdcMem = ::CreateCompatibleDC (hdc) ;//create memory dc hBitmap = ::CreateCompatibleBitmap (hdc, rc.right-rc.left, rc.bottom-rc.top) ;//create bitmap ::GetObject (hBitmap, sizeof (BITMAP), &bitmap) ;//get bitmap info into bitmap struct ::SelectObject (hdcMem, hBitmap) ;//make the bitmap as the surface of memory dc ::SendMessage(hwnd, WM_PRINT , (WPARAM) hdcMem,PRF_CHILDREN | PRF_CLIENT | PRF_ERASEBKGND | PRF_NONCLIENT | PRF_OWNED); ::ReleaseDC(hwnd,hdc); //copy the data to clipboard also! ::OpenClipboard(hwnd); ::EmptyClipboard(); ::SetClipboardData(CF_BITMAP, hBitmap); ::CloseClipboard(); //the clipboard contains a black rectangle??? //copy the image to static control... //my own stuff to copy the hdcMem contents to a //static control . . . . ::DeleteObject(hdcMem); ::DeleteObject(hBitmap); return(TRUE); } -Vladimir India

    C / C++ / MFC performance question

  • Getting the Image of a WIndow
    V vladimir_india

    Sorry dear, i'm afraid but wm_paint doesnt solves the problem! -vladiir_india

    C / C++ / MFC performance question

  • converting an int to a hex String
    V vladimir_india

    Hey u can use this : long str2hex(char *str) { long hwnd=0; char ch; ::CharUpperBuff(str,8); for(int i=0;i<8;i++) { ch = str[i]; if(ch>=48 && ch<=57) hwnd+=(ch-48)*1<<(4*(7-i)); else if (ch>=65 && ch<=70) hwnd+=(ch-65+10)*1<<(4*(7-i)); } return hwnd; } -Vladimir India:)

    C / C++ / MFC question tutorial

  • Getting the Image of a WIndow
    V vladimir_india

    Hi All! Trying to get the image of a window using Hbitmap,DC,Memory DC and BitBlt. This works fine, but since the function BitBlt copies from the screen, I am having tough time gettin the image of a hidden or partially shadowed window. So is it possible to get the image of a window(even if its partially hidden) if we know its DC? I would also like to get more information on how does windows actually renders a DC. Can we force the rendering to a memory DC or memory buffer (instead to the screen) from where the image can be copied? Thanks! -Vladimir India

    C / C++ / MFC performance question

  • GetAncestor api in VC++ 6
    V vladimir_india

    HI! well, it me replying me...Nooo! its for others..for i got an alternate of the problem.. I called the function right from the dll, using LoadLibrary call and then GetProcAddress . But still, The main question persists. Anybody having any clue??? -Vladimir India

    C / C++ / MFC c++ help json

  • GetAncestor api in VC++ 6
    V vladimir_india

    Hi! Including winuser.h has got no effect. I still am not able to compile it! I tried it on both win2000 and win98,... Can you please try calling it and see... Thanks! -Vladimir India

    C / C++ / MFC c++ help json

  • GetAncestor api in VC++ 6
    V vladimir_india

    I'm unable to call the Win32 pai GetAncestor in a VC++ project. While other win32 API's like GetPaernt dont have any problem. The error that comes is: G:\VC++ progs\venom\venom.cpp(89) : error C2039: 'GetAncestor' : is not a member of '`global namespace'' G:\VC++ progs\venom\venom.cpp(89) : error C2065: 'GetAncestor' : undeclared identifier I call it as : GetAncestor(hwnd,1);//GA_PARENT = 1 -Vladimir India

    C / C++ / MFC c++ help json
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups