Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Resizing Window

marshallc
Beginner
500 Views
Hi,
Has anyone worked with resizing Win32 objects within a QuickWin application? I was able to create a statusbar (with help from the developers in the forum), but I noticed that when I click on the maximize or minimize button the statusbar does not want to adjust according to the size of the window. If the window is reduced, it disappears from the screen. If it is maximized, it displays normally.
I found some code that did adjust the status bar a little, but it does some weird things on the screen... like take up half the screen when minimized. I think I'm referencing something incorrectly, but I could use some expert advice.
The other option is to freeze/lock the window in the size that it is originally created. Can this be done?
Here is the code that calls the creation of the statusbar in Main...
hWndProc = SetWindowLong (hFrame, GWL_WNDPROC, LOC(FrameWndProc))
istatus = SendMessage (hFrame, WM_APP+1, 0, 0)
Here is the code that I currently have for creating the statusbar:
integer function FrameWndProc (hWnd, mesg, wParam, lParam)
!DEC$ IF DEFINED(_X86_)
!DEC$ ATTRIBUTES STDCALL, ALIAS :
'_FrameWndProc@16':: FrameWndProc
!DEC$ ELSE
!DEC$ ATTRIBUTES STDCALL, ALIAS : 'FrameWndProc' :: FrameWndProc
!DEC$ ENDIF

use dflib
use dfwin
use comctl32
implicit none
interface
integer*4 function setstatusbar (msg)
!DEC$ IF DEFINED (_X86_)
!DEC$ ATTRIBUTES C, ALIAS: "__QWINTSetStatusBar" :: setstatusbar
!DEC$ ELSE
!DEC$ ATTRIBUTES C, ALIAS: "_QWINTSetStatusBar" :: setstatusbar
!DEC$ ENDIF
integermsg! to hold address of string
end function setstatusbar
end interface
common /handletoproc/ hWndProc
integer*4 hWnd, hWndloc, hWndProc, hWndcapture, hStatus
integer*4 isbfieldpos(5), jwidth, iStatus
integer*4mesg, mesgloc
integer*4 wParam, wParamloc
integer*4 lParam, lParamloc
integer*4 pHI! pointer to HelpInfo structure needed by WM_HELP command
character*20hWndchar, hFramechar
character*20ictypchar, ictrlchar, itemhandchar, contidchar
character($maxpath) message
integer*4retint, rethelp, ctrlid, hWndframe
integer*4 cxClient, cyClient
integer*2 iParts, cxWidth, iStep, i
integer*4, dimension(0:3) :: lpParts
character*30 szStatusText
logical*4 :: redraw = .true.
integer*4 iret
integer*2 iSBHeight
type (T_RECT) RectStatus
type (T_RECT) rcClient
select case(mesg)

case (WM_APP+1)

hStatus = CreateStatusWindow(IOR(WS_CHILD, WS_VISIBLE), &
' 'c, hWnd, 0)
iParts = 3

!jwidth = 900
!iSBFieldPos(5) = jWidth-20
!iSBFieldPos(4) = jWidth-100
!iSBFieldPos(3) = jWidth-180
!iSBFieldPos(2) = jWidth-260
!iSBFieldPos(1) = 300!
!iStatus = SendMessage (hStatus, SB_SETPARTS, 5, LOC(iSBFieldPos))
!iStatus = ShowWindow (hStatus, SW_SHOW)
FrameWndProc = 0
return

case (WM_SIZE)

cxClient = loword(lParam)
cyClient = hiword(lParam)
iret = GetWindowRect(hStatus, RectStatus)
iSBheight = Abs(RectStatus%bottom - RectStatus%top)
iret = GetClientRect(hWnd, rcClient)
cxWidth = rcClient%right/iParts
iStep = cxWidth
do i = 0, iParts-1
lpParts(i) = cxWidth
cxWidth = cxWidth + iStep
end do
iret = SendMessage(hStatus, SB_SETPARTS, iParts, &
loc(lpParts))
iret = MoveWindow(hStatus, 0, cyClient - iSBheight, &
cxClient, cyClient, redraw)
szStatusText = 'Popout Style'C
iret = SendMessage(hStatus, SB_SETTEXTA, &
ior(1, SBT_POPOUT), loc(szStatusText))
szStatusText = ' Ready'C
iret = SendMessage(hStatus, SB_SETTEXTA, 0, &
loc(szStatusText))
return
case DEFAULT
FrameWndProc = CallWindowProc (hWndProc, hWnd, mesg, wParam, lParam)
end select
return
end function FrameWndProc
Regards,
Chad
0 Kudos
0 Replies
Reply