Page 1 of 1

CODE: Transparencies and movements

Posted: Mon Apr 14, 2008 3:39 am
by Rochinha
Friends,

Compile, run and click on left corner on top.

Here the code:

Code: Select all

/*
 *
 * *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
 * Descricao..: Modulo de PDV
 * Programador: Jose Carlos da Rocha
 * CopyRights.: 5Volution.COM
 * *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
 *
 */
#include "fivewin.ch"

#define SRCPAINT       15597702
#define SRCAND         8913094

function main()
   PUBLIC lNoPaint := .f.
   DEFINE BRUSH oBrush STYLE NULL
   DEFINE DIALOG oWnd TITLE "Transparence" SIZE 800,600 BRUSH oBrush STYLE WS_POPUP
                                        
   @ 0,0 BITMAP filename "" OF oWnd NOBORDER PIXEL SIZE 10,10 ON LEFT CLICK WindowMove()

   ACTIVATE DIALOG oWnd CENTERED ;
               ON PAINT ShowBmp( oWnd, "transpr1.bmp", "transpr2.bmp" ) ;
               VALID iif(MsgYesNo('Certeza?','Atencao'),.t.,.f.) 

function ShowBmp( oDlg, cBmp1, cBmp2 )
   local hDC  := oDlg:hDC
   local oBmp1, oBmp2
   DEFINE BITMAP oBmp1 FILENAME cBmp1
   DEFINE BITMAP oBmp2 FILENAME cBmp2
   DrawBitmap( hDC, oBmp2:hBitmap, 0, 0, 0, 0, SRCPAINT )
   DrawBitmap( hDC, oBmp1:hBitmap, 0, 0, 0, 0, SRCAND )
   oBmp1:End()
   oBmp2:End()
   return nil

function WindowMove()
   Do while GetKeyState(VK_LBUTTON)
      onde:=GetCursorpos()
      MoveWindow( oWnd:hWnd, onde[1], onde[2], 20, 20, .t. )
      SysRefresh()
      If !GetKeyState(VK_LBUTTON)
         Exit
      Endif
   Enddo
   MoveWindow( oWnd:hWnd, onde[1], onde[2], 800, 600, .t. )
   Return nil
Here the bitmaps:
http://www.5volution.com/forum/transpr.zip

Posted: Mon Apr 14, 2008 5:51 am
by Antonio Linares
Rochinha,

have you tested it in Vista ?

Posted: Mon Apr 14, 2008 7:04 am
by richard-service
Hi Rochinha,

In Vista OS, I saw it same transpr2.bmp

Regards,

richard

Posted: Mon Apr 14, 2008 1:01 pm
by Rochinha
Friends,

Yes, tested in Windows server 2003 and Windows Vista ultimate.

The bitmaps have a background diference.

Works fine.

Posted: Wed Apr 16, 2008 8:23 am
by Antonio Linares
Rochinha,

Could you please post a screenshot of it running in Vista ? Thanks

Here it is not working fine,

Posted: Fri Apr 18, 2008 12:48 am
by Rochinha
Here,

Image

Posted: Fri Apr 18, 2008 1:40 am
by Rochinha
Here,

One more sample:

Download

Press a mouse on top and left corner to hide and move on screen.

Posted: Fri Apr 18, 2008 5:43 am
by Otto
Attached a screen shot from my VISTA PC business.

The left is compiled on my PC the right is your exe.
Regards,
Otto


Image

Posted: Fri Apr 18, 2008 12:08 pm
by Antonio Linares
Rochinha,

Please notice in Otto's screenshots that the lower left corner is black.

Have you done some modifications in your classes ? Thanks,