A custom taskBar scanning all desktop windows

Published on by Yousfi Benameur

         

this code builds a similar tool as windows taskbar and with a to level form to be located on desktop.
it gathers all visible windows in a cursor rowsource of a comboBox.
a timer refreshes the cursor with interval=5 seconds (note there is some flickers on refreshing/updating the combo).
selecting a window (there is the window title and the window class to select efficiently the wanted window).can set other selection criteria of windows.
(Actual criteria: window visible and the list except this running form).
a contextuel menu at the right of the toolbar select if you want to :
  .maximize/restore the window
  .minimize it
  .extract available informations on window  (infos in clipboard at each snap)
  .close it
(first select a window in the combo)

all these are made with SendMessage API and relative constants.
the windows present at time 't' are gathered in a cursor as a hierarchy of desktop windows.warning the list is variable all time.all VFP child windows are also captured in the list.
the form is made as top level and alwaysOnTop=.t. to dont be covered by any window.its movable by mousedown on any point of the desktop.
another contextuel menu can be customized to fire some applications,utilities...
can also  set the form backcolor.
Note: for making navigators executed without paths can see previous posts how to set that with set command.
(see setx path "%path%;C:\Program Files\Mozilla Firefox"   for ex.)
can build a projedt with this code and add a config.fpw to compile an executable.
*some system windows cannot manipulated with the contextuel menu.
*original idea from  news2news: http://www.news2news.com/vfp/index.php?example=45
*important: if want to restrict the enumerated  windows to vfp only replace getWindowDesktop() handle with _screen.hwnd and use a simple toolbar in vfp environment.the top of hierarchy in vfp is _screen.can enumerate all its childs.

[post 264]


Click on code to select [then copy] -click outside to deselect


*1* created on wednesday 28 of february 2018
*builds a similar windows taskbar on a top level form with a toolbar.
If !_vfp.StartMode=0
  On Shutdown Quit
Endi


_Screen.WindowState=1
Set Date Long

Publi oform
oform=Newobject("ytbar")
oform.Show
Read Events
Return
*
Define Class ytbar As Form
  Top = 0
  Left = 259
  Height = 32+25
  Width = 930
  ShowWindow=2
  ShowTips=.T.
  BorderStyle=0
  TitleBar=1
  AlwaysOnTop=.T.
  MaxButton=.F.
  Caption = "Desktop Windows"
  BackColor=Rgb(212,210,208)
  ywin=0
  ycl=0
  otoolbar = .F.
  ypos=1
  Name = "ytbar"
  oformref=Null

  Add Object ytime As ytime With Left=100,Top=3
  Add Object shp0 As Shape With Left= 300,Top=3,BackColor=Rgb(0,0,128),Curvature=99,MousePointer=15 ,Width=13,Height=13 ,ToolTipText="Background"

  Add Object yclose As CommandButton With ;
    fontbold=.T.,;
    fontsize=9,;
    caption="Exit",;
    top=1,;
    width=50,;
    left=3,;
    ForeColor = Rgb(128,0,64), ;
    mousepointer=15,;
    Name = "yclose"

  Procedure yclose.Click
    Thisform.Release
  Endproc

  Procedure Init
    With    Thisform
      .TitleBar=0
      .yclose.Left=(.Width-.yclose.Width)/2
    Endwith
  Endproc

  Procedure Activate
    If Type("thisform.oToolbar")="O" And !Isnull(Thisform.otoolbar) Or Upper(oform.BaseClass) # "FORM"
      Return
    Endif
    This.oformref=oform
    Thisform.otoolbar=Create("ywinToolbar",Thisform)
    Thisform.otoolbar.Dock(0)
    Thisform.otoolbar.Show
    Thisform.yposition()
  Endproc

  Procedure shp0.Click
    Local m.xcolor
    m.xcolor=Getcolor()
    If m.xcolor=-1
      Return.F.
    Endi
    Thisform.BackColor=m.xcolor
    Thisform.otoolbar.BackColor=m.xcolor
  Endproc

  Procedure MouseDown
    Lparameters nButton, nShift, nXCoord, nYCoord
    *DECLARE INTEGER GetFocus IN WIN32API
    lnHandle = Thisform.HWnd    &&getFocus()
    param1 = 274
    param2 = 0xF012
    Declare Integer ReleaseCapture In WIN32API
    Declare Integer SendMessage In WIN32API Integer, Integer, Integer, Integer
    Thisform.MousePointer=15
    bb=ReleaseCapture()
    bb=SendMessage(lnHandle, param1, param2,0)
    Thisform.MousePointer=0
  Endproc
  Procedure yposition
    With Thisform
      If .ypos=0
        .Top=0
      Else
        .Top=Sysmetric(2)-.Height-Sysmetric(9)-2*Sysmetric(4)-20
      Endi
    Endwith
  Endproc

  Procedure KeyPress
    Lparameters nKeyCode, nShiftAltCtrl
    If nKeyCode=27
      Thisform.Release
    Endi
  Endproc

  Procedure _5551dnkg8
    Sele ycurs
    #Define WM_ACTIVATE	0x0006
    #Define WA_ACTIVE	1
    #Define SC_MINIMIZE			0xF020
    #Define SC_MAXIMIZE			0xF030
    #Define SC_RESTORE			0xF120
    #Define SC_CLOSE			0xF060
    #Define WM_SYSCOMMAND		0x0112
    bringWindowtotop(Thisform.ywin)
    If Thisform.ycl=1
      Thisform.ycl=0
      =SendMessage(Thisform.ywin, WM_SYSCOMMAND, SC_RESTORE, 0)
      =SendMessage(Thisform.ywin, WM_ACTIVATE, WA_ACTIVE, 0)
    Else
      Thisform.ycl=1
      =SendMessage(Thisform.ywin, WM_SYSCOMMAND, SC_MAXIMIZE	, 0)
      Thisform.ycl=0
    Endi
    bringWindowtotop(Thisform.HWnd)
  Endproc


  Procedure _5551dnkgc
    Sele ycurs
    #Define WM_ACTIVATE	0x0006
    #Define WA_ACTIVE	1
    #Define SC_MINIMIZE			0xF020
    #Define SC_MAXIMIZE			0xF030
    #Define SC_RESTORE			0xF120
    #Define SC_CLOSE			0xF060
    #Define WM_SYSCOMMAND		0x0112
    bringWindowtotop(Thisform.ywin)
    =SendMessage(Thisform.ywin, WM_SYSCOMMAND,SC_MINIMIZE,0)
  Endproc

  Procedure _5551dnkg4
    Sele ycurs
    Locate For winhandle=Thisform.ywin
    If Found()
      Local m.myvar
      TEXT to m.myvar textmerge noshow
-Window title :<<allt( winTitle)>>
-Window classname:<<allt(winClass)>>
-Window Handle: <<winHandle>>
-Window corners coord: x0=<<x0>> y0=<<y0>>   x1=<<x1>>   y1=<<y1>>
      ENDTEXT
      _Cliptext=m.myvar
      Messagebox(m.myvar,0+32+4096,"Infos in clipboard")
    Endi
  Endproc


  Procedure _5551dnkgf
    #Define WM_ACTIVATE	0x0006
    #Define WA_ACTIVE	1
    #Define SC_MINIMIZE			0xF020
    #Define SC_MAXIMIZE			0xF030
    #Define SC_RESTORE			0xF120
    #Define SC_CLOSE			0xF060
    #Define WM_SYSCOMMAND		0x0112
    Sele ycurs
    bringWindowtotop(Thisform.ywin)
    =SendMessage(Thisform.ywin, WM_SYSCOMMAND, SC_CLOSE, 0)
  Endproc
  *
  Procedure _5560ptn1z
    Local oshell
    oshell=Newobject("shell.application")
    oshell.toggleDesktop()
    oshel=Null
  Endproc

  Procedure _5560ptn22
    Try
      shellexecute(0,"open","explorer.exe" ," shell:::{4234d49b-0245-4df3-b780-3893943456e1}","",1)
    Catch
    Endtry
  Endproc

  *
  Procedure _5560ptn24
    Try
      shellexecute(0,"open","iexplore.exe","","",1)
    Catch
    Endtry
  Endproc
  *
  Procedure _5560ptn26
    Try
      shellexecute(0,"open","firefox.exe","","",1)
    Catch
    Endtry
  Endproc

  *
  Procedure _5560ptn27
    Try
      shellexecute(0,"open","chrome.exe","","",1)
    Catch
    Endtry
  Endproc

  Procedure _ytaskmgr
    Try
      shellexecute(0,"open","taskmgr.exe","","",1)
    Catch
    Endtry
  Endproc

  Procedure yshow_hide
    #Define WM_COMMAND 	0x0111
    hWindow = FindWindowEx(0, 0, "Progman", 0)
    hWindow = FindWindowEx(hWindow, 0, "SHELLDLL_DefView", 0)
    SendMessage(hWindow, WM_COMMAND, 0x7402,0)
  Endproc

  Procedure Destroy
    Clea Dlls
    Thisform.otoolbar=Null
    oform=Null
    Release oform

    Clea Events
  Endproc


Enddefine
*
*-- EndDefine: ytbar
*-----------------------------------------------------------*
*toolbar class
Define Class ywinToolBar As Toolbar
  Caption = "Toolbar1"
  Height = 30
  Left = 0
  Top = 0
  Width = 930
  BackColor=Rgb(212,210,208)
  ShowWindow=1
  Movable=.F.   &&important
  Name = "ywinToolBar"
  oformref=.F.

  Add Object ylab As Label With ;
    AutoSize = .T., ;
    FontBold = .T., ;
    FontSize = 10, ;
    BackStyle = 0, ;
    Caption = "Count=    =", ;
    Height = 22, ;
    Left = 0, ;
    Top = 6, ;
    Width = 60, ;
    ForeColor = Rgb(255,0,0), ;
    Name = "ylab"

  Add Object shp As Shape With Top=6,BackColor=255,Curvature=99,MousePointer=15 ,Width=13,Height=13 ,ToolTipText="position"

  Add Object separator1 As Separator With ;
    Top = 3, ;
    Left = 51, ;
    Height = 0, ;
    Width = 0, ;
    Name = "Separator1"

  Add Object combo1 As ComboBox With ;
    Height = 24, ;
    Left = 60, ;
    Top = 10, ;
    Width = 718, ;
    displaycount=25, ;
    columnCount=1, ;
    boundcolumn=1, ;
    Name = "Combo1"

  Add Object timer1 As Timer With ;
    Top = 3, ;
    Left = 722, ;
    Height = 23, ;
    Width = 23, ;
    Interval = 5000, ;
    Name = "Timer1"

  Add Object separator2 As Separator With ;
    Top = 3, ;
    Left = 752, ;
    Height = 0, ;
    Width = 0, ;
    Name = "Separator2"

  Add Object ymenu As Label With ;
    AutoSize = .T., ;
    FontBold = .T., ;
    FontSize = 10, ;
    BackStyle = 0, ;
    Caption = "Menu", ;
    Height = 22, ;
    Left = 0, ;
    Top = 6, ;
    Width = 60, ;
    ForeColor = Rgb(255,0,0), ;
    mousepointer=15,;
    Name = "ymenu"

  Add Object separator3 As Separator With ;
    Top = 3, ;
    Left = 752, ;
    Height = 0, ;
    Width = 0, ;
    Name = "Separator3"

  Add Object yApps As Label With ;
    AutoSize = .T., ;
    FontBold = .T., ;
    FontSize = 10, ;
    BackStyle = 0, ;
    Caption = "Apps", ;
    Height = 22, ;
    Left = 0, ;
    Top = 6, ;
    Width = 60, ;
    ForeColor = Rgb(128,0,64), ;
    mousepointer=15,;
    Name = "yApps"

  Add Object separator4 As Separator With ;
    Top = 3, ;
    Left = 752, ;
    Height = 0, ;
    Width = 0, ;
    Name = "Separator4"

  Add Object yhelp As Label With ;
    AutoSize = .T., ;
    FontBold = .T., ;
    FontSize = 12, ;
    BackStyle = 0, ;
    Caption = "?", ;
    Height = 22, ;
    Left = 0, ;
    Top = 6, ;
    Width = 60, ;
    ForeColor = Rgb(128,0,64), ;
    mousepointer=15,;
    Name = "yhelp"

  Procedure shp.Click
    With  _Screen.ActiveForm
      .ypos=Iif(.ypos=0,1,0)
      .yposition()
    Endwith
  Endproc

  Procedure yApps.Click
    Set Color Of Scheme 1 To N+/w*,R/w+*,,,,w+/R
    Define Popup raccourci SHORTCUT Relative From Mrow(),Mcol() Color Scheme 1
    Define Bar 1 Of raccourci Prompt "ToggleDesktop"
    Define Bar 2 Of raccourci Prompt "Std Executables"
    Define Bar 3 Of raccourci Prompt " Windows AppsFolder"
    Define Bar 4 Of raccourci Prompt "Navigators"
    Define Bar 5 Of raccourci Prompt "Show/hide desktop icons"
    On Selection Bar 1 Of raccourci _Screen.ActiveForm. _5560ptn1z
    On Bar 2 Of raccourci Activate Popup stdexecuta
    On Selection Bar 3 Of raccourci _Screen.ActiveForm. _5560ptn22
    On Bar 4 Of raccourci Activate Popup navigators
    On Selection Bar 5 Of raccourci _Screen.ActiveForm.yshow_hide()

    Define Popup stdexecuta SHORTCUT Relative  Color Scheme 1
    Define Bar 1 Of stdexecuta Prompt "explorer"
    Define Bar 2 Of stdexecuta Prompt "cmd"
    Define Bar 3 Of stdexecuta Prompt "mspaint"
    Define Bar 4 Of stdexecuta Prompt "notepad"
    Define Bar 5 Of stdexecuta Prompt "Task manager "
    On Selection Bar 1 Of stdexecuta Run/N explorer
    On Selection Bar 2 Of stdexecuta Run/N cmd
    On Selection Bar 3 Of stdexecuta Run/N mspaint
    On Selection Bar 4 Of stdexecuta Run/N notepad
    On Selection Bar 5 Of stdexecuta _Screen.ActiveForm._ytaskmgr

    Define Popup navigators SHORTCUT Relative  Color Scheme 1
    Define Bar 1 Of navigators Prompt "Internet explorer"
    Define Bar 2 Of navigators Prompt "firefox"
    Define Bar 3 Of navigators Prompt "chrome"
    On Selection Bar 1 Of navigators 	_Screen.ActiveForm. _5560ptn24
    On Selection Bar 2 Of navigators 	_Screen.ActiveForm._5560ptn26
    On Selection Bar 3 Of navigators 	_Screen.ActiveForm. _5560ptn27

    Activate Popup raccourci
  Endproc

  Procedure yhelp.Click
    Local m.myvar
    TEXT to m.myvar pretext 7 noshow
    this code builds a similar tool as windows taskbar.
it gathers all visible windows in a cursor rowsource of a comboBox.
a timer refreshes the cursor with interval=5 seconds.(there is some flickers on refreshing/updating)
selecting a window (there is the window title and the window class to select efficiently the wanted window).can set other selection criteria of windows.
(Actual criteria: window visible and the list except this running form).
a contextuel menu at the right of the toolbar select if you want to :
  .maximize/restore the window
  .minimize it
  .extract available informations on window  (infos in clipboard at each snap)
  .close it

all these are made with SendMessage API and relative constants.
the windows present at time 't' are gathered in a cursor as a hierarchy of desktop windows.waring the list is variable all time.
the form is made as top level and alwaysOnTop=.t. to dont be covered by any window.its movable by mousedown on any point of the desktop.
another contexuel menu can be customized to fire some applications,utilities...
can also  set the form backcolor.
Note: for making navigators executed without paths can see previous posts how to set that with set command.
(see setx path "%path%;C:\Program Files\Mozilla Firefox"   for ex.)
    ENDTEXT
    Local oshell
    oshell = Createobject('WScript.Shell')
    oshell.Popup(m.myvar,0, 'Summary help', 0+32+4096)  &&4,16,48,64...
    oshell=Null

  Procedure  Init()
    #Define ERR_NOFORMPARM_LOC	"You must pass a form reference to create this toolbar."
    Parameter oform

    If Type("m.oForm")#"O" Or Isnull(m.oform) Or Upper(oform.BaseClass) # "FORM"
      Messagebox(ERR_NOFORMPARM_LOC)
      Return .F.
    Endif

    This.oformref = oform
    This.timer1.Timer
    Sele ycurs
    Locate
  Endproc

  Procedure timer1.Timer
    Do  yhierarchyDk

    With This.Parent.combo1
      .RowSource="ycurs.wintitle"
      .RowSourceType=6
      Sele ycurs
      Locate
      .Value=wintitle
    Endwith
    This.Parent.ylab.Caption="Count="+Trans(Reccount())
  Endproc

  Procedure ymenu.Click

    Define Popup raccourci SHORTCUT Relative From Mrow(),Mcol()
    Define Bar 1 Of raccourci Prompt "maximize/restore"
    Define Bar 2 Of raccourci Prompt "minimize"
    Define Bar 3 Of raccourci Prompt "Window Info"
    Define Bar 4 Of raccourci Prompt "close"

    On Selection Bar 1 Of raccourci 	_Screen.ActiveForm._5551dnkg8 ()
    On Selection Bar 2 Of raccourci 	_Screen.ActiveForm._5551dnkgc ()
    On Selection Bar 3 Of raccourci 	_Screen.ActiveForm._5551dnkg4  ()
    On Selection Bar 4 Of raccourci 	_Screen.ActiveForm._5551dnkgf ()

    Activate Popup raccourci
  Endproc

  Procedure combo1.Click
    Sele ycurs
    _Screen.ActiveForm.ywin=winhandle
  Endproc

Enddefine
*
*-- EndDefine: ywintoolbar

Procedure yhierarchyDk
  Do ydeclare

  Local hParent, hWindow, cTitle, cRect
  hParent = GetDesktopWindow()
  hWindow = 0

  If Used("ycurs")
    Use In Select("ycurs")
  Endi
  Create Cursor ycurs (winhandle I,  x0 I, y0 I, x1 I, y1 I, wintitle C(200),winClass C(200))
  Inde On wintitle Tag wintitle Descending
  Set Order To wintitle
  Do While .T.
    Store Replicate(Chr(0),255) To cClass, cTitle
    hWindow = FindWindowEx(hParent, hWindow,;
      Null, Null)

    If hWindow = 0
      * 123=ERROR_INVALID_NAME
      * 127=ERROR_PROC_NOT_FOUND
      * ? "Exit on error:", GetLastError()
      Exit
    Else
      cTitle = GetWinText(hWindow)
      cRect = GetWinRect(hWindow)
      cWinClass= GetClsName(hWindow)
      If isWindowVisible(hWindow)=1  And !Substr(Lower(cTitle),1,15)== "desktop windows"  and x0>=0 and y0>=0 and x1>=0 and y1>=0  &&and !hwindow=xHWND  &&and !empty(ctitle)
        Insert Into ycurs Values (hWindow,;
          buf2dword(Substr(cRect, 1,4)),;
          buf2dword(Substr(cRect, 5,4)),;
          buf2dword(Substr(cRect, 9,4)),;
          buf2dword(Substr(cRect, 13,4)),;
          allt(cTitle)+"---"+Allt(cWinClass) ,cWinClass)
      Endi
    Endif
  Enddo

  Select ycurs
  Locate
  *messagebox(tcTitle)
  *BROWSE  NORMAL NOWAIT
  Retu
  * end of main

Function GetWinText(hWindow)
  Local cBuffer
  cBuffer = Replicate(Chr(0), 255)
  = GetWindowText(hWindow, @cBuffer, Len(cBuffer))
  Return Strtran(cBuffer, Chr(0), "")
Endfunc

Function GetWinRect(hWindow)
  Local cBuffer
  cBuffer = Replicate(Chr(0), 16)
  = GetWindowRect(hWindow, @cBuffer)
  Return cBuffer
Endfunc

Procedure ydeclare
  &&shellexecute
  Declare Integer ShellExecute In SHELL32.Dll Integer nWinHandle,;
    STRING cOperation,;
    STRING cFileName,;
    STRING cParameters,;
    STRING cDirectory,;
    INTEGER nShowWindow

  Declare Integer BringWindowToTop In user32 Integer HWnd
  Declare Integer GetLastError In kernel32
  Declare Integer GetDesktopWindow In user32

  Declare Integer FindWindowEx In user32;
    INTEGER hwndParent, Integer hwndChildAfter,;
    STRING @lpszClass, String @lpszWindow

  Declare Integer GetWindowText In user32;
    INTEGER HWnd, String @lpString, Integer nMaxCount

  Declare Integer GetWindowRect In user32;
    INTEGER HWnd, String lpRect
  Declare Integer GetClassName In user32;
    INTEGER HWnd, String lpClassName, Integer nMaxCount

  Declare Integer SendMessage In Win32API;
    INTEGER HWnd,;
    INTEGER uMsg,;
    INTEGER wParam,;
    INTEGER Lparam
  Declare Integer IsWindowVisible In user32 Integer HWnd
Endproc

Function buf2dword(lcBuffer)
  Return Asc(Substr(lcBuffer, 1,1)) + ;
    BitLShift(Asc(Substr(lcBuffer, 2,1)),  8) +;
    BitLShift(Asc(Substr(lcBuffer, 3,1)), 16) +;
    BitLShift(Asc(Substr(lcBuffer, 4,1)), 24)
Endfunc

Function GetClsName(hWindow)
  Local nBufsize, cBuffer
  cBuffer = Repli(Chr(0), 250)
  nBufsize = GetClassName(hWindow, @cBuffer, Len(cBuffer))
  Return Substr(cBuffer, 1, nBufsize)
Endfunc

*clock container class
Define Class ytime As Container
  Top = 12
  Left = 780
  Width = 80
  Height = 25
  borderwidth=1
  Name = "ytime"

  Add Object label1 As Label With ;
    FontBold = .T., ;
    FontSize = 10, ;
    Caption = "Label1", ;
    Height = 25, ;
    Left = 0, ;
    MousePointer = 15, ;
    Top = 0, ;
    Width = 156, ;
    ForeColor = Rgb(0,255,0), ;
    BackColor = Rgb(0,0,0), ;
    tooltiptext=Ttoc(Datetime()), ;
    Name = "Label1"

  Add Object timer1 As Timer With ;
    Top = -1, ;
    Left = 134, ;
    Height = 23, ;
    Width = 23, ;
    Interval = 1000, ;
    Name = "Timer1"

  Procedure Init
    This.timer1.Timer()
  Endproc

  Procedure label1.Click
    Messagebox(Ttoc(Datetime()))
  Endproc

  Procedure timer1.Init
    This.Parent.label1.Caption="Time: "+Substr(Time(),1,5)
  Endproc

Enddefine
*
*-- EndDefine: yTime


A custom taskBar scanning all  desktop windows
A custom taskBar scanning all  desktop windows
A custom taskBar scanning all  desktop windows
A custom taskBar scanning all  desktop windows
A custom taskBar scanning all  desktop windows
A custom taskBar scanning all  desktop windows
A custom taskBar scanning all  desktop windows

Click on code to select [then copy] -click outside to deselect


*2* created on thursday 08 of March 2018
*builds a similar windows taskbar on a toolbar in vfp environment and manage all its child windows .
*the top of vfp windows is _screen.the code enumerates all its child windows exactly as the code *1* but restricted to vfp namespace.
*all vfp child windows are enumerated even the vfp system toolbars (11).warning these last are localized (depend on windows locale language installed on PC)
*select any window in combo and run the contextuel menu...
*read the help in code


Set Date Long

If Type("_screen.oToolbar")="O" And !Isnull(_Screen.otoolbar)
release  _screen.toolbar
Endif

With _Screen
  .AddProperty("otoolbar","")
  .AddProperty("ywin",Null)
  .AddProperty("ycl",0)
  .AddProperty("ypos",0)
  .otoolbar=Create("ywinToolbar")
  .otoolbar.Dock(3)  &&can select top position in the toolbar
  .otoolbar.Show
Endwith

Procedure _5551dnkg8

  If Isnull(_Screen.ywin)
    Wait Window "no window selected!" Timeout 1
    Return .F.
  Endi

  Sele ycurs
  #Define WM_ACTIVATE	0x0006
  #Define WA_ACTIVE	1
  #Define SC_MINIMIZE			0xF020
  #Define SC_MAXIMIZE			0xF030
  #Define SC_RESTORE			0xF120
  #Define SC_CLOSE			0xF060
  #Define WM_SYSCOMMAND		0x0112
  bringWindowtotop(_Screen.ywin)

  If _Screen.ycl=1
    _Screen.ycl=0
    =SendMessage(_Screen.ywin, WM_SYSCOMMAND, SC_RESTORE, 0)
    =SendMessage(_Screen.ywin, WM_ACTIVATE, WA_ACTIVE, 0)
  Else
    _Screen.ycl=0
    =SendMessage(_Screen.ywin, WM_SYSCOMMAND, SC_MAXIMIZE	, 0)
    _Screen.ycl=1
  Endi
  bringWindowtotop(_Screen.HWnd)
Endproc


Procedure _5551dnkgc
  If Isnull(_Screen.ywin)
    Wait Window "no window selected!" Timeout 1
    Return .F.
  Endi

  Sele ycurs
  #Define WM_ACTIVATE	0x0006
  #Define WA_ACTIVE	1
  #Define SC_MINIMIZE			0xF020
  #Define SC_MAXIMIZE			0xF030
  #Define SC_RESTORE			0xF120
  #Define SC_CLOSE			0xF060
  #Define WM_SYSCOMMAND		0x0112

  bringWindowtotop(_Screen.ywin)

  =SendMessage(_Screen.ywin, WM_SYSCOMMAND,SC_MINIMIZE,0)
Endproc

Procedure _5551dnkg4
  If Isnull(_Screen.ywin)
    Wait Window "no window selected!" Timeout 1
    Return .F.
  Endi
  Sele ycurs
  Locate For winhandle=_Screen.ywin
  If Found()
    Local m.myvar
    TEXT to m.myvar textmerge noshow
-Window title :<<allt( winTitle)>>
-Window classname:<<allt(winClass)>>
-Window Handle: <<winHandle>>
-Window corners coord: x0=<<x0>> y0=<<y0>>   x1=<<x1>>   y1=<<y1>>
    ENDTEXT
    _Cliptext=m.myvar
    Messagebox(m.myvar,0+32+4096,"Infos in clipboard")
  Endi
Endproc

Procedure _5551dnkgf
  If Isnull(_Screen.ywin)
    Wait Window "no window selected!" Timeout 1
    Return .F.
  Endi

  #Define WM_ACTIVATE	0x0006
  #Define WA_ACTIVE	1
  #Define SC_MINIMIZE			0xF020
  #Define SC_MAXIMIZE			0xF030
  #Define SC_RESTORE			0xF120
  #Define SC_CLOSE			0xF060
  #Define WM_SYSCOMMAND		0x0112
  Sele ycurs

  bringWindowtotop(_Screen.ywin)

  =SendMessage(_Screen.ywin, WM_SYSCOMMAND, SC_CLOSE, 0)
Endproc
*
Procedure _5560ptn1z
  Local oshell
  oshell=Newobject("shell.application")
  oshell.toggleDesktop()
  oshel=Null
Endproc

Procedure _5560ptn22
  Try
    shellexecute(0,"open","explorer.exe" ," shell:::{4234d49b-0245-4df3-b780-3893943456e1}","",1)
  Catch
  Endtry
Endproc

*
Procedure _5560ptn24
  Try
    shellexecute(0,"open","iexplore.exe","","",1)
  Catch
  Endtry
Endproc
*
Procedure _5560ptn26
  Try
    shellexecute(0,"open","firefox.exe","","",1)
  Catch
  Endtry
Endproc

*
Procedure _5560ptn27
  Try
    shellexecute(0,"open","chrome.exe","","",1)
  Catch
  Endtry
Endproc

Procedure _ytaskmgr
  Try
    shellexecute(0,"open","taskmgr.exe","","",1)
  Catch
  Endtry
Endproc

Procedure yshow_hide
  #Define WM_COMMAND 	0x0111
  hWindow = FindWindowEx(0, 0, "Progman", 0)
  hWindow = FindWindowEx(hWindow, 0, "SHELLDLL_DefView", 0)
  SendMessage(hWindow, WM_COMMAND, 0x7402,0)
Endproc

*-----------------------------------------------------------*
*toolbar class
Define Class ywinToolBar As Toolbar
  Caption = "Toolbar1"
  Height = 30
  Left = 0
  Top = 0
  Width = 930
  BackColor=Rgb(212,210,208)
  Movable=.F.
  Name = "ywinToolBar"

  Add Object yclose As CommandButton With ;
    fontbold=.T.,;
    fontsize=9,;
    caption="Exit",;
    autosize=.T.,;
    top=1,;
    left=3,;
    ForeColor = Rgb(128,0,64), ;
    mousepointer=15,;
    Name = "yclose"

  Add Object Separato As Separator With Top = 3, Left = 752, Height = 0,  Width = 0,  Name = "Separato"
  Add Object ylab As Label With ;
    AutoSize = .T., ;
    FontBold = .T., ;
    FontSize = 10, ;
    BackStyle = 0, ;
    Caption = "Count=    =", ;
    Height = 22, ;
    Left = 0, ;
    Top = 6, ;
    Width = 60, ;
    ForeColor = Rgb(255,0,0), ;
    Name = "ylab"

  Add Object shp As Shape With Top=6,BackColor=255,Curvature=99,MousePointer=15 ,Width=13,Height=13 ,ToolTipText="position"

  Add Object separator1 As Separator With ;
    Top = 3, ;
    Left = 51, ;
    Height = 0, ;
    Width = 0, ;
    Name = "Separator1"

  Add Object combo1 As ComboBox With ;
    Height = 24, ;
    Left = 60, ;
    Top = 10, ;
    Width = 718, ;
    displaycount=25, ;
    columnCount=1, ;
    boundcolumn=1, ;
    Name = "Combo1"

  Add Object timer1 As Timer With ;
    Top = 3, ;
    Left = 722, ;
    Height = 23, ;
    Width = 23, ;
    Interval = 2000, ;
    Name = "Timer1"

  Add Object separator2 As Separator With ;
    Top = 3, ;
    Left = 752, ;
    Height = 0, ;
    Width = 0, ;
    Name = "Separator2"

  Add Object ymenu As Label With ;
    AutoSize = .T., ;
    FontBold = .T., ;
    FontSize = 10, ;
    BackStyle = 0, ;
    Caption = "Menu", ;
    Height = 22, ;
    Left = 0, ;
    Top = 6, ;
    Width = 60, ;
    ForeColor = Rgb(255,0,0), ;
    mousepointer=15,;
    Name = "ymenu"

  Add Object separator3 As Separator With ;
    Top = 3, ;
    Left = 752, ;
    Height = 0, ;
    Width = 0, ;
    Name = "Separator3"

  Add Object yApps As Label With ;
    AutoSize = .T., ;
    FontBold = .T., ;
    FontSize = 10, ;
    BackStyle = 0, ;
    Caption = "Apps", ;
    Height = 22, ;
    Left = 0, ;
    Top = 6, ;
    Width = 60, ;
    ForeColor = Rgb(128,0,64), ;
    mousepointer=15,;
    Name = "yApps"

  Add Object separator4 As Separator With ;
    Top = 3, ;
    Left = 752, ;
    Height = 0, ;
    Width = 0, ;
    Name = "Separator4"

  Add Object yhelp As Label With ;
    AutoSize = .T., ;
    FontBold = .T., ;
    FontSize = 12, ;
    BackStyle = 0, ;
    Caption = "?", ;
    Height = 22, ;
    Left = 0, ;
    Top = 6, ;
    Width = 60, ;
    ForeColor = Rgb(128,0,64), ;
    mousepointer=15,;
    Name = "yhelp"
  Add Object separator5 As Separator With Top = 3, Left = 752, Height = 0,  Width = 0,  Name = "Separator5"
  Add Object ywinlab As Label  With Width=200, Top=3,Left=752,Height=20,BackStyle=0 ,Caption="",ToolTipText="Selected window"
  Add Object ytime As ytime With Left=100,Top=3
  Add Object separator6 As Separator With Top = 3, Left = 752, Height = 0,  Width = 0,  Name = "Separator6"
  Add Object shp0 As Shape With Left= 300,Top=3,BackColor=Rgb(0,0,128),Curvature=99,MousePointer=15 ,Width=13,Height=13 ,ToolTipText="Background"

  Procedure shp.Click
    With  _Screen
      .ypos=Iif(.ypos=1,0,1)
      If .ypos=0
        _Screen.otoolbar.Dock(3)
      Else
        _Screen .otoolbar.Dock(0)
      Endi
    Endwith
  Endproc

  Procedure shp0.Click
    Local m.xcolor
    m.xcolor=Getcolor()
    If m.xcolor=-1
      Return.F.
    Endi
    _Screen.otoolbar.BackColor=m.xcolor
  Endproc

  Procedure yclose.Click
  clea dlls
    _Screen.otoolbar.Release
    _screen.otoolbar=null
  Endproc

  Procedure yApps.Click
    Set Color Of Scheme 1 To N+/w*,R/w+*,,,,w+/R
    If _Screen.ypos=1
      Define Popup raccourci SHORTCUT Relative From Mrow(),Mcol() Color Scheme 1  Font 'Tahoma',9 Style 'I'
    Else
      Define Popup raccourci SHORTCUT Relative From Mrow()+41,Mcol() Color Scheme 1 Font 'Tahoma',9 Style 'I'
    Endi
    Define Bar 1 Of raccourci Prompt "ToggleDesktop"
    Define Bar 2 Of raccourci Prompt "Std Executables"
    Define Bar 3 Of raccourci Prompt " Windows AppsFolder"
    Define Bar 4 Of raccourci Prompt "Navigators"
    Define Bar 5 Of raccourci Prompt "Show/hide desktop icons"
    On Selection Bar 1 Of raccourci  Do _5560ptn1z
    On Bar 2 Of raccourci Activate Popup stdexecuta
    On Selection Bar 3 Of raccourci  Do _5560ptn22
    On Bar 4 Of raccourci Activate Popup navigators
    On Selection Bar 5 Of raccourci Do yshow_hide()

    Define Popup stdexecuta SHORTCUT Relative  Color Scheme 1
    Define Bar 1 Of stdexecuta Prompt "explorer"
    Define Bar 2 Of stdexecuta Prompt "cmd"
    Define Bar 3 Of stdexecuta Prompt "mspaint"
    Define Bar 4 Of stdexecuta Prompt "notepad"
    Define Bar 5 Of stdexecuta Prompt "Task manager "
    On Selection Bar 1 Of stdexecuta Run/N explorer
    On Selection Bar 2 Of stdexecuta Run/N cmd
    On Selection Bar 3 Of stdexecuta Run/N mspaint
    On Selection Bar 4 Of stdexecuta Run/N notepad
    On Selection Bar 5 Of stdexecuta Do _ytaskmgr

    Define Popup navigators SHORTCUT Relative  Color Scheme 1
    Define Bar 1 Of navigators Prompt "Internet explorer"
    Define Bar 2 Of navigators Prompt "firefox"
    Define Bar 3 Of navigators Prompt "chrome"
    On Selection Bar 1 Of navigators 	Do  _5560ptn24
    On Selection Bar 2 Of navigators 	Do  _5560ptn26
    On Selection Bar 3 Of navigators 	Do  _5560ptn27

    Activate Popup raccourci
  Endproc

  Procedure yhelp.Click
    Local m.myvar
    TEXT to m.myvar pretext 7 noshow
    this code builds a similar tool as windows taskbar on a simple toolbar added to _screen object.
    _screen is the top of hierarchy in vfp namespace objects.
it gathers all visible windows in a cursor rowsource of a comboBox.
a timer refreshes the cursor with interval=2 seconds (can be little as 500 msec for ex. but there is some flickers on refreshing).
selecting a window (there is the window title and the window class to select efficiently the wanted window).can set other selection criteria of windows.
(Actual criteria: window visible and the list except this running prg).
a contextuel menu at the right of the toolbar select if you want to :
  .maximize/restore the window
  .minimize it
  .extract available informations on window  (infos in clipboard at each snap)
  .close it
  (window must be selected first in the combo)
  Note that the vfp system toolbars must be not docked to interact with the contextuel menu.

all these are made with SendMessage API and relative constants.
the windows present at time 't' are gathered in a cursor as a hierarchy of _screen windows.warning the list is variable all time.

another contextuel menu can be customized to fire some applications,utilities...
can also  set the toolbar  backcolor.
Note: for making navigators executed without paths can see previous posts how to set that with setx command.
(see setx path "%path%;C:\Program Files\Mozilla Firefox"   for ex.)
    ENDTEXT
    Local oshell
    oshell = Createobject('WScript.Shell')
    oshell.Popup(m.myvar,0, 'Summary help', 0+32+4096)  &&4,16,48,64...
    oshell=Null

  Procedure  Init()
    This.timer1.Timer
    Sele ycurs
    Locate
  Endproc

  Procedure timer1.Timer
    Do  yhierarchyDk

    With This.Parent.combo1
      .RowSource="ycurs.wintitle"
      .RowSourceType=6
      Sele ycurs
      Locate
      .Value=wintitle
    Endwith
    This.Parent.ylab.Caption="Count="+Trans(Reccount())
  Endproc

  Procedure ymenu.Click
    If _Screen.ypos=1
      Define Popup raccourci SHORTCUT Relative From Mrow(),Mcol() Font 'Tahoma',9 Style 'I'
    Else
      Define Popup raccourci SHORTCUT Relative From Mrow()+41,Mcol() Font 'Tahoma',9 Style 'I'
    Endi
    Define Bar 1 Of raccourci Prompt "maximize/restore"
    Define Bar 2 Of raccourci Prompt "minimize"
    Define Bar 3 Of raccourci Prompt "Window Info"
    Define Bar 4 Of raccourci Prompt "close"

    On Selection Bar 1 Of raccourci 	 Do _5551dnkg8
    On Selection Bar 2 Of raccourci 	 Do _5551dnkgc
    On Selection Bar 3 Of raccourci 	 Do _5551dnkg4
    On Selection Bar 4 Of raccourci 	 Do _5551dnkgf

    Activate Popup raccourci
  Endproc

  Procedure combo1.Click
    Sele ycurs
    _Screen.ywin=winhandle
    This.Parent.ywinlab.Caption=GetWinText(winhandle)     &&real window caption
  Endproc

Enddefine
*
*-- EndDefine: ywintoolbar

Procedure yhierarchyDk
  Do ydeclare

  Local hParent, hWindow, cTitle, cRect
  hParent = _Screen.HWnd
  hWindow = 0

  If Used("ycurs")
    Use In Select("ycurs")
  Endi
  Create Cursor ycurs (winhandle I,  x0 I, y0 I, x1 I, y1 I, wintitle C(200),winClass C(200))
  Inde On wintitle Tag wintitle Descending
  Set Order To wintitle
  Do While .T.
    Store Replicate(Chr(0),255) To cClass, cTitle
    hWindow = FindWindowEx(hParent, hWindow,;
      Null, Null)

    If hWindow = 0
      * 123=ERROR_INVALID_NAME
      * 127=ERROR_PROC_NOT_FOUND
      * ? "Exit on error:", GetLastError()
      Exit
    Else
      cTitle = GetWinText(hWindow)
      cRect = GetWinRect(hWindow)
      cWinClass= GetClsName(hWindow)
      If isWindowVisible(hWindow)=1  And !Substr(Lower(cTitle),1,16)== "yvfp_toolbar.prg"  And x0>=0 And y0>=0 And x1>=0 And y1>=0  &&and !hwindow=xHWND  &&and !empty(ctitle)
        Insert Into ycurs Values (hWindow,;
          buf2dword(Substr(cRect, 1,4)),;
          buf2dword(Substr(cRect, 5,4)),;
          buf2dword(Substr(cRect, 9,4)),;
          buf2dword(Substr(cRect, 13,4)),;
          allt(cTitle)+"---"+Allt(cWinClass) ,cWinClass)
      Endi
    Endif
  Enddo

  Select ycurs
  Locate
  Retu
  * end of main

Function GetWinText(hWindow)
  Local cBuffer
  cBuffer = Replicate(Chr(0), 255)
  = GetWindowText(hWindow, @cBuffer, Len(cBuffer))
  Return Strtran(cBuffer, Chr(0), "")
Endfunc

Function GetWinRect(hWindow)
  Local cBuffer
  cBuffer = Replicate(Chr(0), 16)
  = GetWindowRect(hWindow, @cBuffer)
  Return cBuffer
Endfunc

Procedure ydeclare
  &&shellexecute
  Declare Integer ShellExecute In SHELL32.Dll Integer nWinHandle,;
    STRING cOperation,;
    STRING cFileName,;
    STRING cParameters,;
    STRING cDirectory,;
    INTEGER nShowWindow

  Declare Integer BringWindowToTop In user32 Integer HWnd
  Declare Integer GetLastError In kernel32
  Declare Integer GetDesktopWindow In user32

  Declare Integer FindWindowEx In user32;
    INTEGER hwndParent, Integer hwndChildAfter,;
    STRING @lpszClass, String @lpszWindow

  Declare Integer GetWindowText In user32;
    INTEGER HWnd, String @lpString, Integer nMaxCount

  Declare Integer GetWindowRect In user32;
    INTEGER HWnd, String lpRect
  Declare Integer GetClassName In user32;
    INTEGER HWnd, String lpClassName, Integer nMaxCount

  Declare Integer SendMessage In Win32API;
    INTEGER HWnd,;
    INTEGER uMsg,;
    INTEGER wParam,;
    INTEGER Lparam
  Declare Integer IsWindowVisible In user32 Integer HWnd
  Declare Integer IsWindow In user32 Integer HWnd
Endproc

Function buf2dword(lcBuffer)
  Return Asc(Substr(lcBuffer, 1,1)) + ;
    BitLShift(Asc(Substr(lcBuffer, 2,1)),  8) +;
    BitLShift(Asc(Substr(lcBuffer, 3,1)), 16) +;
    BitLShift(Asc(Substr(lcBuffer, 4,1)), 24)
Endfunc

Function GetClsName(hWindow)
  Local nBufsize, cBuffer
  cBuffer = Repli(Chr(0), 250)
  nBufsize = GetClassName(hWindow, @cBuffer, Len(cBuffer))
  Return Substr(cBuffer, 1, nBufsize)
Endfunc

*clock container class
Define Class ytime As Container
  Top = 12
  Left = 780
  Width = 80
  Height = 25
  BorderWidth=1
  Name = "ytime"

  Add Object label1 As Label With ;
    FontBold = .T., ;
    FontSize = 10, ;
    Caption = "Label1", ;
    Height = 25, ;
    Left = 0, ;
    MousePointer = 15, ;
    Top = 0, ;
    Width = 156, ;
    ForeColor = Rgb(0,255,0), ;
    BackColor = Rgb(0,0,0), ;
    tooltiptext=Ttoc(Datetime()), ;
    Name = "Label1"

  Add Object timer1 As Timer With ;
    Top = -1, ;
    Left = 134, ;
    Height = 23, ;
    Width = 23, ;
    Interval = 2000, ;
    Name = "Timer1"

  Procedure Init
    This.timer1.Timer()
  Endproc

  Procedure label1.Click
    Messagebox(Ttoc(Datetime()))
  Endproc

  Procedure timer1.Init
    This.Parent.label1.Caption="Time: "+Substr(Time(),1,5)
  Endproc

Enddefine
*
*-- EndDefine: yTime


A custom taskBar scanning all  desktop windows
A custom taskBar scanning all  desktop windows

Click on code to select [then copy] -click outside to deselect


*3* created on thursday 08 of march 2018
* Code to hide/show the standard toolbars previously created by the user (manually).

*condition :vfp system toolbars must be activated previously and manually by the user in the vfp main menu  !!! (in display/toolbars/select toobars to activate them)
*this is an exception in vfp and infortunatly it cannot been done programmatly !

*warning vfp system toolbars names are localized (here english+french  only)

*!*	You can also programmatically activate and deactivate toolbars that have been previously activated by using the
*!*	DEACTIVATE WINDOW or ACTIVATE WINDOW commands as in the following example.
*!*
*!*	IF WVISIBLE ("Color Palette")
*!*	DEACTIVATE WINDOW("Color Palette")
*!*	ENDIF
*if this toolbar is not initialized in vfp toolbars (vfp main menu) vfp returns error (window not defined!)

Local m.xlang
m.xlang="FR"  && "EN"

Local m.x
m.x=Inputbox("Hide(0),show(1)","","1")

If ! Used("ycurs")
  Create Cursor ycurs (vfp_toolbar_en c(30),vfp_toolbar_fr c(30),xlog L)
  Insert Into ycurs Values("Print Preview","Aperçu avant impression",.F.)
  Insert Into ycurs Values("Report Designer","Générateur d'états",.F.)
  Insert Into ycurs Values("Form Controls","Contrôles de formulaires",.F.)
  Insert Into ycurs Values("Standard","Standard",.F.)
  Insert Into ycurs Values("Form Designer","Générateur de formulaires",.F.)
  Insert Into ycurs Values("Layout","Mise en page",.F.)
  Insert Into ycurs Values("Database Designer","Générateur de bases de données",.F.)
  Insert Into ycurs Values("View designer","Générateur de vues",.F.)
  Insert Into ycurs Values("Report Controls","Contrôles d'états",.F.)
  Insert Into ycurs Values("Color Palette","Palette des couleurs",.F.)
  Insert Into ycurs Values("Query Designer","Générateur de requêtes",.F.)
  Insert Into ycurs Values("View","Vue",.F.)
Endi

If m.x=="0"
  Scan
    Do Case
      Case  xlang=="EN"
        If Wvisible(vfp_toolbar_en)
          Repl xlog With .T.
          Hide Window (vfp_toolbar_en)
        Endi

      Case xlang=="FR"
        If Wvisible(vfp_toolbar_fr)
          Repl xlog With .T.
          Hide Window (vfp_toolbar_fr)
        Endi
    Endcase
  Endscan
Endi


If m.x=="1"
  Sele ycurs
  Scan
    Do Case
      Case  xlang=="EN"
        If !Wvisible(vfp_toolbar_en)  And xlog=.T.
          Show Window (vfp_toolbar_en)
        Endi

      Case xlang=="FR"
        If !Wvisible(vfp_toolbar_fr)  And xlog=.T.
          Try
            Show Window (vfp_toolbar_fr)
          Catch
          Endtry
        Endi
    Endcase
  Endscan
Endi


Click on code to select [then copy] -click outside to deselect


*4* created on 27 of march 2018
*this code scans all windows under desktop and close specific ones here with any titlebar containing "internet explorer" for example.
*this builds an "addblocker"-can use it for ex. when see football matchs and where there is too windows adds fired (on any click,...).Even the original Addblocker is detected by scripts and your match is blocked...vfp is not detected (in a prg,form or app only not exe)!
*a simple timer can fire the code below with interval 2 sec(2000ms) and makes viewing the match safety without disturbs by closing immediatly the adds when they appears.
*the code originally from news2news.

Do Decl

Local hParent, hWindow, cTitle, cRect
hParent = GetDesktopWindow()
hWindow = 0

Create Cursor cs (winhandle I,;
  x0 I, y0 I, x1 I, y1 I, wintitle C(200))

Do While .T.
  Store Replicate(Chr(0),255) To cClass, cTitle
  hWindow = FindWindowEx(hParent, hWindow,;
    Null, Null)

  If hWindow = 0
    * 123=ERROR_INVALID_NAME
    * 127=ERROR_PROC_NOT_FOUND
    * ? "Exit on error:", GetLastError()
    Exit
  Else
    cTitle = GetWinText(hWindow)
    cRect = GetWinRect(hWindow)

    Insert Into cs Values (hWindow,;
      buf2dword(Substr(cRect, 1,4)),;
      buf2dword(Substr(cRect, 5,4)),;
      buf2dword(Substr(cRect, 9,4)),;
      buf2dword(Substr(cRect, 13,4)),;
      cTitle)
    * endi
  Endif
Enddo

Select cs
Locate

Scan
  If "internet explorer" $ Lower(wintitle)   &&can be any part of any window caption here(IE adds always this string to its window title)
    *close
    #Define WM_SYSCOMMAND 0x112
    #Define SC_CLOSE  0xF060
    SendMessage(winhandle, WM_SYSCOMMAND, SC_CLOSE, 0)
  Endi
Endscan
* end of main

Function GetWinText(hWindow)
  Local cBuffer
  cBuffer = Replicate(Chr(0), 255)
  = GetWindowText(hWindow, @cBuffer, Len(cBuffer))
  Return Strtran(cBuffer, Chr(0), "")

Function GetWinRect(hWindow)
  Local cBuffer
  cBuffer = Replicate(Chr(0), 16)
  = GetWindowRect(hWindow, @cBuffer)
  Return cBuffer

Procedure Decl
  Declare Integer GetLastError In kernel32
  Declare Integer GetDesktopWindow In user32

  Declare Integer FindWindowEx In user32;
    INTEGER hwndParent, Integer hwndChildAfter,;
    STRING @lpszClass, String @lpszWindow

  Declare Integer GetWindowText In user32;
    INTEGER HWnd, String @lpString, Integer nMaxCount

  Declare Integer GetWindowRect In user32;
    INTEGER HWnd, String lpRect
  Declare Integer SendMessage In Win32API;
    INTEGER HWnd,;
    INTEGER uMsg,;
    INTEGER wParam,;
    INTEGER Lparam


Function buf2dword(lcBuffer)
  Return Asc(Substr(lcBuffer, 1,1)) + ;
    BitLShift(Asc(Substr(lcBuffer, 2,1)),  8) +;
    BitLShift(Asc(Substr(lcBuffer, 3,1)), 16) +;
    BitLShift(Asc(Substr(lcBuffer, 4,1)), 24)


the image above is an example of  custom app with vfp "addBlocker"  of all IE windows  adds .

the image above is an example of custom app with vfp "addBlocker" of all IE windows adds .


                     

Yousfi Benameur


Important:All Codes above are tested on VFP9SP2 & windows 10 pro 64 bits version 1709(fall creator) & IE11 emulation. Navigator: firefox - screen:32 pouces.

To be informed of the latest articles, subscribe:
Comment on this post