- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
i have recently been working with the win32 platform, i was working with quickwin and have no problem with the output to child windows. Now I have problems working with handles and it result confuse. I have a dialog box, and i want to display data that i get from that dialog in a child window but i dot know whats the handle or how it does. I have been trying and i only obtain a line in my dialog box when i want it in the child window, there's some code of my program that i believe help you undestand the problem. Tanks for your help
there's the function to the dialog box:
integer(4) function vigaDlgProc(hdlg, message, wParam, lParam)
! Processes messages for "viga" dialog box
!DEC$ IF DEFINED(_X86_)
!DEC$ ATTRIBUTES STDCALL, ALIAS : '_vigaDlgProc@16' :: vigaDlgProc
!DEC$ ELSE
!DEC$ ATTRIBUTES STDCALL, ALIAS : 'vigaDlgProc' :: vigaDlgProc
!DEC$ ENDIF
use dfwin
use dfwina
use CPFGlobals
use variables
implicit none
integer hDlg ! window handle of the dialog box
integer message ! type of message
integer wParam ! message-specific information
integer lParam
INTEGER(4) I
integer(4) hPenLine, hDC
integer hWndEdit
logical(4) result
include 'resource.fd'
! Variables
integer(4) iret
type (T_PAINTSTRUCT) ps
select case (message)
case (WM_INITDIALOG)
! Center the dialog over the application window
call CenterWindow (hDlg, GetWindow (hDlg, &
GW_OWNER))
vigaDlgProc = 1
return
case (WM_COMMAND)
if ((LoWord(wParam) .EQ. IDOK) ) then
NELEM = GetDlgItemInt(hDlg, IDC_EDIT1, LOC(result) ,.TRUE.)
IRET = GetDlgItemInt(hDlg, IDC_EDIT2, LOC(result) ,.TRUE.)
NPOIN = NELEM +1
XI(1)=0
YI(1)=0
DO I=2,NPOIN
XI(I)=XI(I)+IRET
YI(I)=0
END DO
iret = EndDialog(hDlg, TRUE) ! Exit the dialog
vigaDlgProc = 1
return
end if
case(WM_CREATE)
hpenline= CreatePen(ps_solid,1,rgb(0,0,0))
vigadlgproc=1
case(WM_PAINT)
hdc=beginpaint(hWndEdit,ps)
iret=selectobject(hdc,hpenline)
iret=movetoex(hdc,100,120,null_point)
iret = LineTo(hdc, 500,120)
vigadlgproc=1
case(wm_destroy)
!call postquitmessage(0)
iret= deleteobject(hpenline)
vigadlgproc=1
return
end select
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If I understand you correctly, then you have to place your WM_PAINT handling in the window procedure tied to your child window. WM_PAINT is triggered when the child window is to be painted. Hope this helps.
Joerg Kuthe
www.qtsoftware.de

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page