FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for CA-Clipper VISTA BETA 2- ShowWindow
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
VISTA BETA 2- ShowWindow
Posted: Wed Jul 26, 2006 06:07 PM

SW_SHOWMAXIMIZED = 3

ShowWindow(hWnd,3)

System hangs.

SW_RESTORE = 9
Works.

Regards
Otto

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
VISTA BETA 2- ShowWindow
Posted: Thu Jul 27, 2006 09:31 AM
Otto,

This code is properly working on Vista Beta 2 (5384):
#include "FiveWin.ch"

function Main()

   local oWnd
   
   DEFINE WINDOW oWnd TITLE "Test for Otto"
   
   ACTIVATE WINDOW oWnd MAXIMIZED
   
return nil

MAXIMIZED uses ShowWindow(). Please provide a self contained sample to reproduce the error that you mention, thanks.
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
VISTA BETA 2- ShowWindow
Posted: Thu Jul 27, 2006 06:20 PM

Here is my code.
Regards
Otto

func ziRechnung
LOCAL cHSTIni := ".\INI\WINHOTEL.INI"
LOCAL WIN_HOT_VER := ""
LOCAL nPos := ""
LOCAL hWnd := GetWindow( GetActiveWindow(), GHW_HWNDFIRST )
LOCAL cTask :=""
LOCAL ktowahlaufruf := 0
local cTest :=""
*--------------------------------------------

WIN_HOT_VER   := GetPvProfString( "SETUPDATEN","VerzeichnisWinHotel" , "C:\WINHOT96"  ,cHSTIni )
nPos          := len(WIN_HOT_VER+"WHRG.EXE")

// cTest := UPPER(left(cTask,nPos))
// msginfo( cTest )

while hWnd != 0
    cTask = GetModuleFileName( GetWindowWord( hWnd, GWW_HINSTANCE ) )

// msginfo( cTask )

    if UPPER(left(cTask,nPos)) = UPPER(WIN_HOT_VER + "WHRG.EXE")
        //msginfo("Vor show  9" + UPPER(left(cTask,nPos)))
        ShowWindow(hWnd,9)
        setFocus(hWnd)
        SETFOREGRO(hWnd)
        RETURN NIL
    endif
    hWnd = GetWindow( hWnd, GHW_HWNDNEXT )
end
winexec("WHRG.exe")

RETURN NIL

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
VISTA BETA 2- ShowWindow
Posted: Thu Jul 27, 2006 06:33 PM

Otto,

Please provide a reduced and self contained sample. A PRG that can be copied, compiled and executed as it is with no changes. Its the only way to provide efficient tech support. Thanks.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
VISTA BETA 2- ShowWindow
Posted: Thu Jul 27, 2006 08:16 PM
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
VISTA BETA 2- ShowWindow
Posted: Fri Jul 28, 2006 08:59 AM

Otto,

Thanks. Would you mind to explain whats the purpouse of your code ?

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
VISTA BETA 2- ShowWindow
Posted: Fri Jul 28, 2006 09:23 AM

If the programm is allready runnig to bring it in the foreground.

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
VISTA BETA 2- ShowWindow
Posted: Fri Jul 28, 2006 12:36 PM
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
VISTA BETA 2- ShowWindow
Posted: Fri Jul 28, 2006 02:03 PM

BringWindowToTop(hWnd)

does not resolve the problem.

Regards
Otto

Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
VISTA BETA 2- ShowWindow
Posted: Fri Jul 28, 2006 02:24 PM

Otto,

>If the programm is allready running to bring it in the foreground.

Try this:

DLL32 FUNCTION SETFOREGROUNDWINDOW( hWnd AS LONG ) AS BOOL;
PASCAL FROM "SetForegroundWindow" LIB "user32.dll"

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 6983
Joined: Fri Oct 07, 2005 07:07 PM
VISTA BETA 2- ShowWindow
Posted: Fri Jul 28, 2006 02:47 PM

Thank you James. I have this code in my testprg.

But does not work.
Regards
Otto

Posts: 160
Joined: Tue Oct 18, 2005 10:21 AM
VISTA BETA 2- ShowWindow
Posted: Sun Aug 13, 2006 08:01 AM

Otto,

Try with StopUntil( <bCondition> ).

Regards,

Badara Thiam
http://www.icim.fr
Posts: 160
Joined: Tue Oct 18, 2005 10:21 AM
VISTA BETA 2- ShowWindow
Posted: Mon Aug 14, 2006 07:50 AM

I have revisited my Windows 2000 API SuperBible,
and it's appear than "ShowWindow does not make sure the window is in the foreground. Use SetWindowPos or SetActiveWindow function to bring a window to the foreground."

Also, there is LockSetForegroundWindow function who
"...disable or enables the calls to the SetForegroundWindow
function for the calling process.

By default, the system automatically enables calls to SetForegroundWindow if the user press the Alt key or takes some
action that causes the system itself to change the foreground window.
This function allows applications to prevent other applications from
making a foreground change that can interrupt its interaction with the user."

Hope this help :wink:

Badara Thiam
http://www.icim.fr

Continue the discussion