Results 1 to 5 of 5

Thread: Can it be done?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Feb 2000
    Posts
    22

    Can it be done?

    Is it possible (using only the class name and window text) to change the bitmap/picture in another program by using it's the API and the window's DC??

    [Edited by OB1 on 03-26-2000 at 06:39 PM]

  2. #2
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089

    Yes, But not just yes, a little sprinkling of no too.

    Yes and No, The API can't get at the bitmap in the form's background, it's something vb Does all by itself without telling windows,(it might be possible to find the process handle, set up a pipe etc but that's pretty much impossible even if it's possible.)

    What you can do is Get the window handle and subclass the window, trap it's paint event and put your own bitmap there, This'd still be pretty hard but not quite as impossible as other methods.

    In conclusion VB is a language of impossible contradiction.

    hope this helps

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Feb 2000
    Posts
    22

    Lightbulb Thanks

    Thanks. I think I got it.

  4. #4
    Hyperactive Member
    Join Date
    Jan 2000
    Posts
    355
    that's weird - VB ignores Windows normal painting methods?
    so how does it do it behind the scenes?

    cos in C++ its like:


    GetWindowDC(hWnd)

    BeginPaint(wnddc);

    //draw..

    EndPaint(wnddc);

    or something
    buzzwords are the language of fools

  5. #5
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    I don't think VB ignores them, It just overwrites them, If you set autoredraw to true and check the value of

    Code:
    CBool(  (Object.hDC)  = (GetWindowDC(Object.hWnd)   )
    It will return a false when you'd think It would always be true, If AutoRedraw is true then the hDC property is a handle to a Memory DC containing a persistant bitmap for the window, when VB recieves a WM_PAINT (ie just before it fires the paint event) it blits the persistant bitmap onto the window in question.

    I hope this answers your question (It's quite a useful thing to know anyway)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width