Get window handle in PB/cc 
Author Message
 Get window handle in PB/cc

Hi,

  How does one obtain the WINDOW handle for the window created/used by PB/cc.
I'd like to be able to have more control over it but can't seem to come up
with the proper number! I'm specifically attempting to close (minimize) the
window automatically.

TIA,

   ____    _    ____      ____  _____
  |  _ \  / \  / ___) __ | ___)(_   _) Don Schullian

  |____//_/ \_\(____/\__/|_|     |_|    www.DASoftVSS.com
  ___________________________________   www.basicguru.com
      Vertical Software Solutions



Sat, 09 Jun 2001 03:00:00 GMT  
 Get window handle in PB/cc

Quote:
>   How does one obtain the WINDOW handle for the window created/used by PB/cc.
> I'd like to be able to have more control over it but can't seem to come up
> with the proper number! I'm specifically attempting to close (minimize) the
> window automatically.

Look in the SCRNIO.INC example file.  I think there is a function called
GetConsolehWnd().

--Dave



Sat, 09 Jun 2001 03:00:00 GMT  
 Get window handle in PB/cc

Quote:

> >   How does one obtain the WINDOW handle for the window created/used by PB/cc.
> > I'd like to be able to have more control over it but can't seem to come up
> > with the proper number! I'm specifically attempting to close (minimize) the
> > window automatically.

> Look in the SCRNIO.INC example file.  I think there is a function called
> GetConsolehWnd().

Here it is:

'----------------------------------------------------------------------------
'
FUNCTION GetTitle() AS STRING

  LOCAL x AS ASCIIZ * 256

  GetConsoleTitle x, 256

  FUNCTION = x

END FUNCTION

'----------------------------------------------------------------------------
'
SUB SetTitle(BYVAL x AS STRING)

  SetConsoleTitle BYVAL STRPTR(x)

END SUB

'----------------------------------------------------------------------------
' Return the hWnd handle of the console window
'
FUNCTION GetConsolehWnd() AS LONG

  LOCAL x AS STRING
  LOCAL y AS ASCIIZ * 256

  x = GetTitle
  y = STR$(TIMER)
  SetTitle y
  Sleep 10
  FUNCTION = FindWindow(BYVAL %NULL, y)
  SetTitle x

END FUNCTION

--Dave



Sun, 10 Jun 2001 03:00:00 GMT  
 Get window handle in PB/cc

<snip>

Quote:
>'----------------------------------------------------------------------------
>' Return the hWnd handle of the console window
>'
>FUNCTION GetConsolehWnd() AS LONG

>  LOCAL x AS STRING
>  LOCAL y AS ASCIIZ * 256

>  x = GetTitle
>  y = STR$(TIMER)
>  SetTitle y
>  Sleep 10
>  FUNCTION = FindWindow(BYVAL %NULL, y)
>  SetTitle x

>END FUNCTION

BINGO!!!  Would you believe it was the SLEEP 10 that did it!

Thanks & Merry Christmass or Bah Humbug whichever suits the mood ;)

C'ya,

   ____    _    ____      ____  _____
  |  _ \  / \  / ___) __ | ___)(_   _) Don Schullian

  |____//_/ \_\(____/\__/|_|     |_|    www.DASoftVSS.com
  ___________________________________   www.basicguru.com
      Vertical Software Solutions



Mon, 11 Jun 2001 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. MX Lookup with PB/CC or PB/DLL

2. TCPADDR for PB/DLL & PB/CC

3. Info on new PB/CC and PB/DLL

4. Announcing the JazzAge COM Wizard for PB/DLL and PB/CC

5. animated characters, speech input/output in PB/DLL and PB/CC

6. email enable PB/DLL-PB/CC using Outlook

7. SQL, ADO/OLE-DB programming in PB/DLL and PB/CC

8. Windows - getting Tkinter or wxPython window handle?

9. getting window handle (MS Windows) from PPST

10. NUL device not working in PB/CC?

11. dir_trav.bas pb/cc 2.11 directory traverse program

12. pb/cc REGEXPR example misleading

 

 
Powered by phpBB® Forum Software