On Wed, 5 Jan 2005 10:28:22 +0100, "Catalin Lungu" <[EMAIL PROTECTED]> wrote:

Can anybody help me to implement the following VB code in Python. Thanks in advance.



Do you have the rest of the application converted? This is just one small part of a GUI-based application. This one subroutine is responding to a button press, and in response is asking a grid control to refresh itself, and then print itself. If you already have an app with a grid control and some kind of image control, then you need to tell us what you used for that (wxPython? tkinter? Qt?) before we can advise you on this routine.


Private Declare Function SendMessage Lib "user32.dll" Alias _
  "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, _
  ByVal wParam As Long, ByVal lParam As Long) As Long

Private Const WM_PAINT = &HF
Private Const WM_PRINT = &H317
Private Const PRF_CLIENT = &H4&
Private Const PRF_CHILDREN = &H10&
Private Const PRF_OWNED = &H20&

Private Sub Command1_Click()
SendMessage grid.hwnd, WM_PAINT, picture.hDC, 0
SendMessage grid.hwnd, WM_PRINT, picture.hDC, PRF_CHILDREN Or PRF_CLIENT Or PRF_OWNED
picture.Picture = picture.Image
picture.Refresh
End Sub



-- - Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc.

_______________________________________________
Python-win32 mailing list
Python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to