WIN32API and custom APIViewer.

Published on by Yousfi Benameur

          
[Post 269]
-APIs functions,examples and constants
Provide documentation for calling hundreds of Win32API functions from VFP.

*1306 APIs functions
*51 libraries
*603 examples
*48765 constants

The original project was generously donated to VFPX by Anatoliy Mogylevets from its original source, news2news.com, which is no longer available.
I dont used  the original data of the project to build this application but i modified them.
Github links are sensitive , and i preserve the original links syntaxe  to avoid navigation errors.

-a combo is populated with the libraries (51) and can filter the grid to show the one wanted.
-a textbox can make interactive search on the grid and set a green highlighted dynamicBackcolor for records found (with condition set).
-can filter alphabetically functions,examples & constants (see 2nd combo).switch to "All" to view all initial contents.
-all the grid columns can be ordered ascending/descending by clicking on each header .
-click on the ID or Xfunction for any record to see the relative web page for the detailled code function and links concerned.
-can navigate on the browser (back,forward,home) for web links.
-can preview/print olecontrol contents-i stay the contextuel olecontrol menu enabled.
-search is enabled only with web links.
-Application runs on systray(built with a simple menuText property).

3 Tables  w32_examples.dbf , w32_functions.dbf and w32_constants must be in source folder to make these codes working.(marked as excluded in project)
original tables are modified to inlude github links...
all indexes are created in code and withins cursors built with sql commands.
Note that github warns dont working with IE11 that why i tweak the page to hide some incoveniences.only web links are navigable here.
Internet must be connected and fast (to avoid some problems with document object).
-Any feedback is welcome.

Yousfi Benameur  Tuesday 20 of march 2018.

[/Post 269]


WIN32API and custom APIViewer.
WIN32API and custom APIViewer.
WIN32API and custom APIViewer.
WIN32API and custom APIViewer.
WIN32API and custom APIViewer.
WIN32API and custom APIViewer.
WIN32API and custom APIViewer.

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


*1* A PRESENTATION OF THE SUBJECT ABOVE with IE11 (emulated mandatory ,here with meta tag)
Local m.myvar
TEXT to m.myvar pretext 7 noshow
<style>
h1{color:maroon;}
body {
background:
	radial-gradient(
		circle at bottom left,
		transparent 0,
		transparent 2em,
		beige 2em,
		beige 4em,
		transparent 4em,
		transparent 6em,
		khaki 6em,
		khaki 8em,
		transparent 8em,
		transparent 10em
	),
	radial-gradient(
		circle at top right,
		transparent 0,
		transparent 2em,
		beige 2em,
		beige 4em,
		transparent 4em,
		transparent 6em,
		khaki 6em,
		khaki 8em,
		transparent 8em,
		transparent 10em
	),
	radial-gradient(
		circle at top left,
		transparent 0,
		transparent 2em,
		navajowhite 2em,
		navajowhite 4em,
		transparent 4em,
		transparent 6em,
		peachpuff 6em,
		peachpuff 8em,
		transparent 8em,
		transparent 10em
	),
	radial-gradient(
		circle at bottom right,
		transparent 0,
		transparent 2em,
		palegoldenrod 2em,
		palegoldenrod 4em,
		transparent 4em,
		transparent 6em,
		peachpuff 6em,
		peachpuff 8em,
		transparent 8em,
		transparent 10em
	), blanchedalmond;

background-blend-mode: multiply;
background-size: 10em 10em;
background-position: 0 0, 0 0, 5em 5em, 5em 5em;
}
</style>
<meta http-equiv="x-ua-compatible" content="ie=edge" />
<body  oncontextmenu="return false;">
<center><marquee direction="up" behavior="scroll" scrollamount="1" style="padding:10px;height:300px;width:950px;background-color:#ffffff;font-family:Cursive;font-size:14pt;color:indigo;border-width:5;border-style:groove;border-color:#000000; " >
<pre>-APIs functions,examples and constants
Provides documentation for calling hundreds of Win32API functions from VFP.

*1306 APIs functions
*51 libraries
*603 examples
*48765 constants

The original project was generously donated to VFPX by Anatoliy Mogylevets from
its original source,news2news.com, which is no longer available.
I dont used  the original data of the project to build this application but
i modified them.
Github links are sensitive , and i preserve the original links syntaxe  to avoid
navigation errors.

-a combo is populated with the libraries (51) and can filter the grid to show
the one wanted.
-a textbox can make interactive search on the grid and set a green highlighted
dynamicBackcolor for records
found (with condition set).<br>
-can filter alphabetically functions,examples & constants (see 2nd combo).switch
to "All" to view all initial  contents.
-all the grid columns can be ordered ascending/descending by clicking on each header .
-click on the ID or Xfunction for any record to see the relative web page for
the detailled code function and links concerned.
-can navigate on the browser (back,forward,home) for web links.
-can preview/print olecontrol contents-i stay the contextuel olecontrol menu enabled.
-search is enabled only with web links.
-Application runs on systray (built with a simple menuText property).

3 Tables  w32_examples.dbf , w32_functions.dbf and w32_constants must be in source
 folder to make these codes working.(marked as excluded in project)
original tables are modified to inlude github links...
all indexes are created in code and withins cursors built with sql commands.
Note that github warns dont working with IE11 that why i tweak the page to hide
 some incoveniences.
only web links are navigable here.
Internet must be connected and fast (to avoid some problems with document

Yousfi Benameur  Tuesday 20 of march 2018.
</pre>
</marquee>
<br>
<h1> WIN32API and custom API Viewer  march 2018</h1>
</center>
ENDTEXT

Declare Integer BringWindowToTop In user32 Integer HWnd
Local apie
apie=Newobject("internetexplorer.application")
With apie
  .Navigate("about:blank")
  Inke(1)
  .Width=1280
  .Height =600
  .Left=(Sysmetric(1)-.Width)/2
  .Top=50
  .Toolbar=0
  .menubar=0
  .StatusBar=0
  .Resizable=1  &&0

  With .Document
    .Open()
    .Write(m.myvar)
    .Close()
  Endwith
  BringWindowToTop(.HWnd)
  ******
  Declare Integer ExtractIcon In shell32 Integer hInst, String  lpszExeFileName, Integer lpiIcon
  Declare Integer SendMessage In user32 Integer HWnd, Integer Msg, Integer wParam, Integer Lparam
  Declare Integer SetWindowText In user32 Integer HWnd, String lpString
  *Constants for SendMessage second parameter
  #Define WM_GETICON 0x7F
  #Define WM_SETICON 0x80

  *Constants for SendMessage third parameter
  #Define ICON_SMALL 0
  #Define ICON_BIG 1

  Local lnIcon
  lnIcon = ExtractIcon (0,Home(1)+"vfp9.exe",0)  && if exists on system

  SetWindowText(.HWnd, "WIN32API IN GITHUB VFPX")
  SendMessage(.HWnd, WM_SETICON, ICON_SMALL, lnIcon)
  *********
  .Visible=.T.
  Inke(2)

  .Document.body.Scroll="no"
Endwith



WIN32API and custom APIViewer.

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


*2* created on wednesday 04 of april 2018
*generating html table with 1306 Winapi fuctions.w32_functions must be in folder to extract data.can specify in select SQL what user want to extract from this table.(here 4 fields extracted)
*press CTRL+F to fire search dialog,select,copy....with contextuel menu (rightclick).

Local m.yrep
m.yrep=Addbs(Justpath(Sys(16,1)))
Set Defa To (yrep)

if !file("w32_functions.dbf")
locfile("w32_funtions.dbf","dbf")
return .f.
endi

Local m.xstyle
TEXT to m.xstyle noshow  &&a general html table css style
<style>
table.blueTable {
  border: 1px solid #1C6EA4;
  background-color: #EEEEEE;
  width: 100%;
  text-align: left;
  border-collapse: collapse;
}
table.blueTable td, table.blueTable th {
  border: 1px solid #AAAAAA;
  padding: 3px 2px;
}
table.blueTable tbody td {
  font-size: 16px;
}
table.blueTable tr:nth-child(even) { background: #D0E4F5;}

table.blueTable th{
  background: #1C6EA4;
  background: -moz-linear-gradient(top, #5592bb 0%, #327cad 66%, #1C6EA4 100%);
  background: -webkit-linear-gradient(top, #5592bb 0%, #327cad 66%, #1C6EA4 100%);
  background: linear-gradient(to bottom, #5592bb 0%, #327cad 66%, #1C6EA4 100%);
  border-bottom: 2px solid #444444;
}
table.blueTable thead th {
  font-size: 15px;
  font-weight: bold;
  color: #FFFFFF;
  border-left: 2px solid #D0E4F5;
}
table.blueTable thead th:first-child {
  border-left: none;
}
table.blueTable tfoot {
  font-size: 14px;
  font-weight: bold;
  color: #FFFFFF;
  background: #D0E4F5;
  background: -moz-linear-gradient(top, #dcebf7 0%, #d4e6f6 66%, #D0E4F5 100%);
  background: -webkit-linear-gradient(top, #dcebf7 0%, #d4e6f6 66%, #D0E4F5 100%);
  background: linear-gradient(to bottom, #dcebf7 0%, #d4e6f6 66%, #D0E4F5 100%);
  border-top: 2px solid #444444;
}
table.blueTable tfoot td {
  font-size: 14px;
}
table.blueTable tfoot .links {
  text-align: right;
}
table.blueTable tfoot .links a{
  display: inline-block;
  background: #1C6EA4;
  color: #FFFFFF;
  padding: 2px 8px;
  border-radius: 5px;
}
</style>
</style>
ENDTEXT
local m.cr
m.cr=Chr(13)+Chr(10)
Sele functionId,functionNa,Descriptio,declaratio From w32_functions Into Cursor ycurs

Do (_Genhtml) With "functions.html","ycurs"  &&see _genhtml  in foxhelp
Inke(4)

Local m.u
m.u=Filetostr("functions.html")
m.u=Strtran(m.u,'<table id="GenTable" border=1>','<table class="blueTable" border="1">')
*m.u=strtran(m.u,'bgcolor="silver"','bgcolor="#d0c7ed"')  &&its added in code below (as alternative)
Strtofile(m.u,"functions.html")

Declare Integer BringWindowToTop In user32 Integer HWnd
Local apie
apie=Newobject("internetexplorer.application")
With apie
  .Navigate(m.yrep+"functions.html")
  Inke(5)
  .menubar=0
  .Toolbar=0
  .StatusBar=0
  .Left=10
  .Top=10
  .Width=Sysmetric(1)-2*10
  .Height=Sysmetric(2)-2*10

  Local m.x,m.t
  With .Document
    m.x = .createElement("STYLE")
    m.t = .createTextNode(m.xstyle)
    x.appendChild(m.t)
    .Head.appendChild(m.x)
    .Title="WIn32API visual foxpro!1306 Functions"
    .body.style.backgroundColor="#d0c7ed"
  Endwith
  BringWindowToTop(.HWnd)
  .Visible=.T.
Endwith


in this created web page can search,copy...

in this created web page can search,copy...

some relative links in this blog

My win32 APiViewer
around-the-vfp-systray-class

                     

Yousfi Benameur


WIN32API and custom APIViewer.

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