FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Pocket PC Window close
Posts: 126
Joined: Thu Oct 06, 2005 10:18 PM
Window close
Posted: Mon Mar 13, 2006 07:45 AM
Antonio,

This is simple two window app code. When button '>>' in main window is pressed next window is create, but when press 'OK' button in next window, which will close window, next window stay visible. Second press 'OK' button destroy window. Use 'OK' button in right upper window corner move window in background mode.

Regards
Pawel

#Include 'FwCe.Ch'

Function TestClose ()

   Local oWnd := Nil

   Define Window oWnd Title 'Test Close'
   @ 100,  10 Say 'This is main window' Size 150, 15 Pixel
   @ 200, 178 Button '>>' Size 60, 20 Pixel Action IIf (NextWindow (), Nil, oWnd : End ())
   Activate Window oWnd On Init EmptyMenu (oWnd : hWnd)

Return .T.

Function NextWindow ()

   Local oWnd := Nil
   Local lRet := .F.

   Define Window oWnd Title 'Next Window'
   @ 100,  10 Say 'This is next window' Size 150, 15 Pixel
   @ 200, 178 Button 'OK' Size 60, 20 Pixel Action (lRet := .T., oWnd : End ())
   Activate Window oWnd On Init EmptyMenu (oWnd : hWnd)

Return lRet

#pragma BEGINDUMP

#include <hbapi.h>
#include <windows.h>
#include <aygshell.h>
#include <uniqueid.h>
#include <objbase.h>

HB_FUNC (EMPTYMENU)
{
   SHINITDLGINFO shidi;
   HWND hWnd = (HWND) hb_parnl (1);
   SHMENUBARINFO mbi;

   shidi.dwMask  = SHIDIM_FLAGS;
   shidi.hDlg    = hWnd;
   shidi.dwFlags = SHIDIF_DONEBUTTON;
   SHInitDialog (&shidi);

   memset(&mbi, 0, sizeof (SHMENUBARINFO));
   mbi.cbSize = sizeof (SHMENUBARINFO);
   mbi.hwndParent = hWnd;
   mbi.dwFlags = SHCMBF_EMPTYBAR;
   SHCreateMenuBar (&mbi);

}

#pragma ENDDUMP
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Window close
Posted: Mon Mar 13, 2006 09:32 AM
Pawel,

The button in the second window is somehow firing again the main window button action. It can be checked doing this:
   @ 200, 178 Button oBtn PROMPT '>>' Size 60, 20 Pixel ;
      Action ( oBtn:bAction := nil, NextWindow() )

We are searching what may be the reason for this curious behavior. Thanks.
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Window close
Posted: Mon Mar 13, 2006 10:16 AM

Pawel,

Fixed. It was a bug in Class TButton. Please download FWPPC again.

Thanks for your feedback,

regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion