Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.
Keywords: Disable menu items on windows
After much headbanging we discovered that you need to disable the menu items before calling BoxesUp. (Naturally, the introduction of the function and the "Hey, what's that crud doing there?" observation were weeks apart, hence, a fairly brutal set of experiments looking for a culprit.)
The code below may be of use to others. Thanks again to Guido for the inner magic.
Mike Smith
Queen's University at Kingston
; Function DisableMenuItem(Handle, Item) ; ; Disable menu items on windows. Possible ItemCode combinations are: ; 1 - Maximize ; 2 - Minimize ; 4 - Size ; ; NOTE Call DisableMenuItem before calling BoxesUp. Otherwise, disabling the Size item means ; that crud gets left around the inside window border when another window overlaps your ; WinBatch box. #DefineFunction DisableMenuItem(dmiHandle,dmiItem) dmiUser32 = StrCat(DirWindows(1),"User32.DLL") GWL_STYLE = -16 dmiButton = 0 If (dmiItem & 1) dmiButton = dmiButton | 65536 ; WS_MAXIMIZEBOX EndIf If (dmiItem & 2) dmiButton = dmiButton | 131072 ; WS_MINIMIZEBOX EndIf If (dmiItem & 4) dmiButton = dmiButton | 262144 ; WS_SIZEBOX (WS_THICKFRAME) EndIf dmiPrevStyle = DllCall(dmiUser32, long:"GetWindowLongA", long:dmiHandle, long:GWL_STYLE) dmiDesStyle = dmiPrevStyle & ~dmiButton DllCall(dmiUser32, long:"SetWindowLongA", long:dmiHandle, long:GWL_STYLE, long:dmiDesStyle) return #EndFunction
Article ID: W15728
File Created: 2003:05:13:11:29:52
Last Updated: 2003:05:13:11:29:52