M
MBeynon
Guest
Hi, Thanks for the response.I finally cracked it with this code (which I've adapted from code I found on the progresstalk website and on the OE KB); Get the screens on the PC and store them DEFINE VARIABLE oScreenList AS "System.Windows.Forms.Screen[]" NO-UNDO. DEFINE VARIABLE oScreen AS System.Windows.Forms.Screen NO-UNDO. oScreenList = System.Windows.Forms.Screen:AllScreens. DO vl_int = 0 TO oScreenList:LENGTH - 1 WITH FRAME default-frame: oScreen = CAST(oScreenList:GetValue(vl_int), System.Windows.Forms.Screen). END. Pass to a procedure as myScreen for a form; DEFINE VARIABLE bounds AS CLASS System.Drawing.Rectangle NO-UNDO. bounds = myScreen:Bounds. myForm:SetBounds(bounds:X, bounds:Y, bounds:Width, bounds:Height). myForm:StartPosition = System.Windows.Forms.FormStartPosition:Manual. and for a window; DEFINE VARIABLE bounds AS CLASS System.Drawing.Rectangle NO-UNDO. bounds = myScreen:Bounds. RUN VALUE("NewWindow.w") PERSISTENT SET lvhWindowHandle. ASSIGN lvhWindowHandle:CURRENT-WINDOW:X = bounds:X lvhWindowHandle:CURRENT-WINDOW:Y = bounds:Y lvhWindowHandle:CURRENT-WINDOW:Width-pixels = bounds:Width lvhWindowHandle:CURRENT-WINDOW:Width-pixels = bounds:Height. ASSIGN lvhWindowHandle:CURRENT-WINDOW:HIDDEN = FALSE lvhWindowHandle:CURRENT-WINDOW:VISIBLE = TRUE. Hope this is of some use to somebody. It's not yet a polished solution but it's got me up and running
Cheers, Mark.
Continue reading...
Continue reading...