Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: "Karl-Heinz" Newsgroups: comp.lang.clipper.visual-objects Subject: Re: Show(Shownormal) not working on 2nd monitor Date: Fri, 8 Sep 2017 13:03:22 +0200 Lines: 45 Message-ID: References: <6rh0qc5a3s8rnt6jtv41fsdhlugkorsq39@4ax.com> Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 8bit X-Trace: individual.net X/uEm6pZKELjuvkIgVOtIgiRI7dHk8TyL5Q5SBOoHKmPCjSe8= Cancel-Lock: sha1:xQWbbT9bDhXnhn6oZfYIhqOi4+Q= In-Reply-To: <6rh0qc5a3s8rnt6jtv41fsdhlugkorsq39@4ax.com> X-Priority: 3 X-MSMail-Priority: Normal Importance: Normal X-Newsreader: Microsoft Windows Live Mail 16.4.3564.1216 X-MimeOLE: Produced By Microsoft MimeOLE V16.4.3564.1216 Xref: csiph.com comp.lang.clipper.visual-objects:10956 Hi Dick, > SELF:Show(SHOWNORMAL) > PrintReport(.....) > SELF:Show(SHOWZOOMED) > SELF:SetFocus() > > This works - however for one client using Remote Desktop on 2 monitors > it only works on the primary monitor. On the second monitor the > windows keeps the maximized size (and the print hangs) but it can be > done manually. On my 2 monitors it works for both from the program. > > Does anyone have an idea why SELF:Show(SHOWNORMAL) could fail on a > secondairy monitor? I never had the need to distinguish between a primary and second monitor, but a search using the keywords "SHOWNORMAL api secondary monitor" gave some hints: 1. ShowWindow() isnīt designed to support a primary monitor. 2. But - from my understanding - you might try these steps: // get number of attached monitors nNumbers := GetSystemMetrics(SM_CMONITORS) // if nNumbers > 1 detect the monitor the window is shown. hMonitor := MonitorFromWindow( , MONITOR_DEFAULTTONEAREST ) tmi := TAGMONITORINFO tmi.Sizeof ( _sizeof ( TAGMONITORINFO ) ) GetMonitorInfo( hmonitor, @tmi) study the results the tmi structure returns and use a SetWindowPos() call instead of ShowWindow() to position regards Karl-Heinz