WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Dialog Editor version 6.X
plus
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Maximized Dialog Hides Taskbar


Question:

I created a dialog, then in the initialization event handler, I put a WinZoom. It works OK if it's WinZoom(""), but if I give a (partial or full) window name or a window ID, as from cWinIdConvert(hwndDialog), the maximized dialog fills the entire screen including the taskbar.

Answer:

This workaround function simulates maximization by resizing non-maximized window to fill work area (screen minus application toolbars, which includes taskbar).

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; dlgZoom - Use like WinZoom for dialogs.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
#DefineFunction dlgZoom (window)

;SysParamInfo 48 (GetWorkArea) Retrieves the size of the work area on the primary display monitor. 
;The work area is the portion of the screen not obscured by the system taskbar or by application desktop toolbars.
;Returns:(s) comma-delimited coordinates of the work area, expressed in virtual screen coordinates, 
;in the format: "left,top,right,bottom".
coordinates = SysParamInfo(48, 0, 0)

;plug the coordinates in a an array
@_workPix = Arrayize (coordinates, "," )

dllUser = StrCat(DirWindows(1), "User32.dll")

hwnd = DllHwnd(window)

width = @_workPix[2] - @_workPix[0]
height = @_workPix[3] - @_workPix[1]

params = StrCat("long:", hwnd)
params = ItemInsert(StrCat("long:", @_workPix[0]), -1, params, ",")
params = ItemInsert(StrCat("long:", @_workPix[1]), -1, params, ",")
params = ItemInsert(StrCat("long:", width), -1, params, ",")
params = ItemInsert(StrCat("long:", height), -1, params, ",")
params = ItemInsert(StrCat("long:", 1), -1, params, ",")

DllCall(dllUser, long:"MoveWindow", %params%)

#EndFunction 

Article ID:   W16411
File Created: 2005:02:18:12:20:26
Last Updated: 2005:02:18:12:20:26