This project is an effort to translate the C headers of the Microsoft Platform SDK for Windows to PowerBASIC™. This version has been updated using the SDK for Windows 7.1.
These headers are freeware, not public domain. This means that you can use them for your own purposes, even in commercial applications, without paying a fee, but not to make derivative works from, sell or redistribute without permission. Also you must assume the entire risk of using them. Downloading the software indicates that you accept these terms.
Because of the use of new data types only available in PNWIN 10.0+ and PBCC 6.0+ and other features, they can only be used with the new compilers.
You must also be aware that these headers are not extensions to the ones provided with the compiler, but a full replacement. Therefore, you must not mix them with the PowerBASIC include files in any way, neither directly (via #INCLUDE), nor indirectly (via the include path in the IDE).
Unzip the attached file to a folder of your choice and replace the PB Include path in the PB Ide or the editor that you are using to that folder instead of C:\PBWin10\WinApi.
The wrapper functions for the Common Controls have been removed from CommCtrl.inc and placed in the following individual files. Therefore, the use of constants such %NOTOOLBAR, %NOUPDOWN, etc., is no longer needed. Just #INCLUDE the wanted files in your application.
AnimateCtrl.inc (Animation control)
ButtonCtrl.inc (Button control)
ComboBoxCtrl.inc (ComboBox control)
ComboBoxExCtrl.inc (ComboBoxEx control)
DateTimeCtrl.inc (Date Time control)
EditCtrl.inc (Edit control)
HeaderCtrl.inc (Header control)
HotKeyCtrl.inc (Hot Key control)
IPAddressCtrl.inc (IP Address control)
ListBoxCtrl.inc (ListBox control)
ListViewCtrl.inc (ListView control)
MonthCalCtrl.inc (Month Calendar control)
PagerCtrl.inc (Pager control)
ProgressBarCtrl.inc (Progress Bar control)
RebarCtrl.inc (Rebar control)
RichEditCtrl.inc (Rich Edit control)
ScrollBarCtrl.inc (Scroll Bar control)
StaticCtrl.inc (Static control)
StatusbarCtrl.inc (Status Bar control)
SysLinkCtrl.inc (SysLink control)
TabCtrl.inc (Tab control)
TaskDialogCtrl.inc (Task Dialog control)
ToolbarCtrl.inc (Toolbar control)
TrackbarCtrl.inc (Track Bar control)
TreeViewCtrl.inc (TreeView control)
UpDownCtrl.inc (UpDown control)
There are 1,200 files using 78,079,357 bytes.
Help file for the main classes and wrapper functions available in the version 3.1.04 of the Windows API Headers for PBWin 10+ and PBCC 6+.
What is new?
New functions:
AfxGetDefaultBrowserPath
AfxGetDefaultBrowserName
AfxGetDefaultMailClientPath
AfxGetDefaultClientMailName
AfxGetDllPath
AfxGetDllVersion
AfxGetDomainOrWorkGroup
AfxGetInternetExplorerVersion
AfxGetOSArchitecture
AfxGetPathFromhInstance
AfxGetPathFromWindowHandle
AfxGetSystemType
AfxGetTokenElevationType
AfxGetUserAndDomainFromPid
AfxIsPartOfDomain
AfxIsSimpleMapiInstalled
AfxIsUserAdmin
AfxLoadFileToString
AfxPointSizeToDIp
AfxPrintBitmalDlg
AfxUnscaleX
AfxUnscaleY
AfxUrlExists
Button_SetImageList
GdipPlusDllVersion
GdiPlusPrintImage
GdiPlusPrintImageDlg
GdiPlusPrintResourceImage
GdiPlusPrintResourceImageDlg
New classes:
CSQLite
CAfxSmtpMail
CAfxMp3
Modifications:
CAfxProtableDevices.inc file changed to CAfxPortableDevices.inc
CWindow_InputBox: Added optional parameter bPassword.
SciLexer.inc, Scintilla.inc and SciCtrl.inc updated to version 3.2.0.
Thank José...
Pierre
Thank you José,
I would only add that this update contains very important fix to glext.inc and cglext.inc, which corrects a problem with glShaderSource.
Petr
Hello Jose,
thank you for change variable iImageList in include ListViewCtrl.inc
regards Peter
Thank you José.
Many thanks, José
Great additions, Jose. Even there is an E-Mail Class now.
Thanks José you are amazing!
Thank you very much José
thanks so much, Jose
Eddy
Thanks José
best regards,
tsai ji fong
My thanks as well! Jose, your dedication to helping the entire PowerBASIC community is just amazing and very much appreciated!
Ever since I understood the value of your work, I've been in a dilemma on what includes to use in the code I post in the forums. I don't know for sure, but I've always figured that most of the folks in the forums have stuck with the PowerBASIC includes - mostly because they are comfortable that those headers will work best with their PowerBASIC code. Since my own code has mostly been intended to help folks on the forums, I stuck with the PowerBASIC includes.
When PowerBASIC recently gave you your own corner at the PowerBASIC site, I think it was a great step towards making your includes the first choice in includes for PowerBASIC programmers. And with all of the features that you continue to add to your include files, features not available in the PowerBASIC includes, it has become impossible for me to ignore the benefits of switching over.
So starting today, I'm switching over to your includes for all of my posted code and my apps. However late to the party I've been, count me on-board!
If you have any suggestions on how I can help promote your includes, feel free to speak up. I think aggressively putting the option in front of users - especially new users - will be doing them a service!
The best way to promote them is to use them. My first goal was to give PBer's what C++ programmers have: a full set of headers to allow to use anything that Windows provide. I have a deep knowledge of the Windows API and COM, and the translations aren't quick and dirty ones or partial. I promised Bob a ton of wrappers if dead code removal was implemented. There are several help files available and thousands of examples. I'm providing full source code, not black boxes. Don't know what more can I do.
Jose,
Thank you very much for all the work you have put into these.
James A. Gant
I have the Powerbasic 9.05.
Where can I get the old headers?
There: http://www.jose.it-berater.org/smfforum/index.php?topic=4136.0
José
The GetProcessHandleFromHwnd API seems to be missing in the OleAcc.inc
...
It is not included in OleAcc.h.
I will add it to OleAcc.inc, but it is not included in any of the versions of OleAcc.h that I have.
' // Documented, but not included in OleAcc.h
DECLARE FUNCTION GetProcessHandleFromHwnd IMPORT "OLEACC.DLL" ALIAS "GetProcessHandleFromHwnd" ( _
BYVAL hwnd AS DWORD _ ' __in HWND hwnd
) AS DWORD ' HANDLE
http://msdn.microsoft.com/en-us/library/windows/desktop/dd318087(v=vs.85).aspx
Yet, it is documented in MSDN, but not included in the headers.
It comes up to be very handy when you need to interact with external process.
Here is an example of use:
FUNCTION ExeTerminate(BYVAL hWnd AS DWORD) AS LONG
IF IsWindow(hWnd) THEN
LOCAL hProcess AS DWORD
hProcess = GetProcessHandleFromHwnd(hWnd)
IF hProcess THEN
IF TerminateProcess(hProcess, 9) THEN
WaitForInputIdle(hProcess, %INFINITE)
FUNCTION = %TRUE
END IF
END IF
END IF
END FUNCTION
Thank you !!!!
548 Downloads this version. I am using these only ...
In SciCtrl.inc looks like there are a few bugs inside.
One is the
SCI_AutocSetSeparator()
It needs an ASC-Value as Parameter, not a STRPTR().
FUNCTION SCI_AutocSetSeparator (BYVAL hSci AS DWORD, BYVAL strSeparator AS BYTE) AS LONG
FUNCTION = SendMessageA(hSci, %SCI_AUTOCSETSEPARATOR, strSeparator, 0)
END FUNCTION
' ========================================================================================
' ========================================================================================
FUNCTION SCIP_AutocSetSeparator (BYVAL pSci AS DWORD, BYVAL strSeparator AS BYTE) AS LONG
FUNCTION = Scintilla_DirectFunction(pSci, %SCI_AUTOCSETSEPARATOR, strSeparator, 0)
END FUNCTION
THis should be easier to use with PB.
' ========================================================================================
FUNCTION SCI_AutocSetSeparator (BYVAL hSci AS DWORD, BYVAL strSeparator AS STRING) AS LONG
FUNCTION = SendMessageA(hSci, %SCI_AUTOCSETSEPARATOR, ASC(strSeparator), 0)
END FUNCTION
' ========================================================================================
' ========================================================================================
FUNCTION SCIP_AutocSetSeparator (BYVAL pSci AS DWORD, BYVAL strSeparator AS STRING) AS LONG
FUNCTION = Scintilla_DirectFunction(pSci, %SCI_AUTOCSETSEPARATOR, ASC(strSeparator), 0)
END FUNCTION
' ========================================================================================
Of course, Jose, because you can just write
SCIP_AutocSetSeparator (pSci," ")
instead of
SCIP_AutocSetSeparator (pSci,32)
I found this some weeks before, there may be few more such cases in the include file.
Edit_GetRightMargin is spelled incorrectly in "EditCtrl.inc". The "h" and the "t" are reversed.
' ========================================================================================
' Gets the width of the right margin for an edit control.
' ========================================================================================
FUNCTION Edit_GetRigthMargin (BYVAL hEdit AS DWORD) AS LONG
FUNCTION = HI(WORD, SendMessage(hEdit, %EM_GETMARGINS, 0, 0))
END FUNCTION
' ========================================================================================
"Rigth" should be "Right"
Not sure if this was already fixed but I just came across it today while working on some code.
Thanks very much. I will post a new version soon, since I have updated some third party libraries and did some minor corrections to other files.
Hi José,
I just noticed a small typo in WinApiHeaders.chm
AfxOpenFileDialog is listed in the index as AfxOpelFileDialog
and the topic header is the same.
I must say that your header files really are a 'tour de force'.
Thanks again for all your amazing efforts.
Best Regards,
David
Thanks very much. I have modified the help file.
Here are a few more for you to review...
WinApiHeaders.chm
Index entry Correction?
------------------------------------------------ --------------------------
AfxQuadDateToFormatedStr AfxQuadDateToFormattedStr
AfxQuadTimeToFormatedStr AfxQuadTimeToFormattedStr
Button_SetImaleListXY Button_SetImageListXY
Topic headers
ControlClientHeight (Poperty) ControlClientHeight (Property)
ControlClientWidth (Poperty) ControlClientWidth (Property)
ControlHeight (Poperty) ControlHeight (Property)
CotH [Method]
A single index entry offers two topic options
(CosH [Method] and CotH [Method])
Is this correct?
DaysInYear Method [CAfxTime Class]
Topic content under "PowerBASIC Syntax"
METHOD DayusInYear () AS LONG METHOD DaysInYear () AS LONG
Delete Tooltip Method [CWindow Class]
Topic header "DeleteTooltip (Method)"
Topic content under "PowerBASIC Syntax"
METHOD Tooltip_Delete METHOD DeleteTooltip
EditWordBreakProc
A single index entry offers two identical
topic options (topic content differs slightly)
Thanks again. I have modified these entries and a couple of "formated" more.
Not sure if this one has been reported already:
' ========================================================================================
' Selects all items.
' ========================================================================================
SUB ListView_SetlectAllItems (BYVAL hwndLV AS DWORD)
LOCAL lvi AS LVITEM
lvi.mask = %LVIF_STATE
lvi.state = -1
lvi.stateMask = %LVIS_SELECTED
SendMessage hwndLV, %LVM_SETITEMSTATE, -1, VARPTR(lvi)
END SUB
ListView_SetlectAllItems should be ListView_SelectAllItems (remove the first "t" from SetlectAllItems)
Thanks very much. I probably missed this one because if forgot to add an entry for it in the help file, that I have added now.
The "formatted" one is a problem that I have with that word, because in Spanish is "formateado", with only one "t".
Quote from: José Roca on September 27, 2013, 07:19:32 PM
The "formatted" one is a problem that I have with that word, because in Spanish is "formateado", with only one "t".
No worries! So, you have a minor problem with one English word.
I have a problem with 99.999% of Spanish words. ;D
Anyway, here are a few more entries for you to check out...
Index entry Correction? / Comment
------------------------------------------------ --------------------------
Eqv [Method] (CVariant Class)
Topic content under "PowerBASIC Syntax"
METHOD Add METHOD Eqv
~~~
FormatCurrency [Method] (CVariant Class)
Topic content under "PowerBASIC Syntax"
METHOD FormatPercent METHOD FormatCurrency
~~~
FromDoubleVector [Method] (CProp Variant Class)
Topic content under "PowerBASIC Syntax"
METHOD FromInt64Vector METHOD FromDoubleVector
~~~
ListBox_CalcHorizontabExtent Function ListBox_CalcHorizontalExtent
Topic Title
ListBox_CalcHorizontabExtent ListBox_CalcHorizontalExtent
~~~
Index contains inconsistent use of brackets and square brackets.
e.g. SA_1D_AppendWord Method (CDictionary Class)
SA_1D_AppendWString Method [CSafeArray Class]
Should they all just use round brackets?
~~~
SA_1D_AppendVariant Method [CSafeArray Class]
Topic content under "PowerBASIC Syntax"
METHOD SA_1D_AppendVariantElement METHOD SA_1D_AppendVariant
~~~
SA_1D_AppendUnknown Method (CDictionary Class)
Topic content under "PowerBASIC Syntax"
METHOD SA_1D_AppendDecimal METHOD SA_1D_AppendUnknown
~~~
SA_1D_PutCurrency Method (CDictionary Class)
Topic content under "PowerBASIC Syntax"
METHOD SA_1D_PutDouble METHOD SA_1D_PutCurrency
~~~
SA_1D_PutWString Method [CSafeArray Class]
Topic content under "PowerBASIC Syntax"
METHOD SA_1D_PutString METHOD SA_1D_PutWString
~~~
SetPatsBySize Method (CWindow Class) should read Parts not Pats.
SetStatusBarPartsBySize Method (CWindow Class)
Topic Header
SetPartsBySize (Method) SetStatusBarPartsBySize (Method)
Topic content under "PowerBASIC Syntax"
METHOD SetStatusbarPartsBySize Should match index entry and topic header.
~~~
SetPositions Metod [IAfxMp3 Interface] SetPositions Method [IAfxMp3 Interface]
~~~
ToDoubleArray Method [CVariant Class]
Topic content under "PowerBASIC Syntax"
METHOD ToInt64Array METHOD ToDoubleArrayAlloc
~~~
ToDoubleVector Method [CPropVariant Class]
Topic content under "PowerBASIC Syntax"
METHOD ToInt64Array METHOD ToDoubleVector
~~~
XPButton_SetBitmapFromFile Function [XPButton Control (Themed)]
Topic content under "PowerBASIC Syntax"
FUNCTION XPButton_SetIconFromFile FUNCTION XPButton_SetBitmapFromFile
~~~
Thanks very much. I also have changed the return type of several of the XPButton function from LONG to DWORD for consistency.
If you wonder why there were so many errors in the CSafeArray class, it is because it was not a fully finished work, but a draft. During the beta testing of the compiler, I asked Bob if he was going to add support for safe arrays. As I didn't get a clear reply, I began to work in the class, and then Bob released a beta version with safe array support :)
I am a bit confused as to where to find the latest versions. For instance, the WinApiHeaders.rar file contents has a last modified date of 8/3/2012.
The source code file for CSED has a note that The Win API Headers ver 2.02+ is required, however, the download file is WINAPI_III_1.04 with contents that have most recent modified date of 8/3/2012.
Perhaps I am not interpreting these dates correctly.
The latest released version is WINAPI_III_1.04. The 2.02 version was for PB9. If the code for CSED mentions 2.02 must be that I have forgot to change it, but it requires the III series, that support unicode.
Jose, could you also address the small issues in the Scintilla*.inc?
' ========================================================================================
' SCI_ADDSTYLEDTEXT(int length, cell *s)
' This behaves just like SCI_ADDTEXT, but inserts styled text.
' ========================================================================================
' ========================================================================================
FUNCTION SCI_AddStyledText (BYVAL hSci AS DWORD, BYVAL strText AS STRING) AS LONG
FUNCTION = SendMessageA(hSci, %SCI_ADDSTYLEDTEXT, LEN(strText), STRPTR(strText))
END FUNCTION
' ========================================================================================
' ========================================================================================
FUNCTION SCIP_AddStyledText (BYVAL pSci AS DWORD, BYVAL strText AS STRING) AS LONG
FUNCTION = Scintilla_DirectFunction(pSci, %SCI_ADDSTYLEDTEXT, LEN(strText), STRPTR(strText))
END FUNCTION
' ========================================================================================
Contained a small typing mistake (s/d)
I have always promoted to use your headers as the official.
Now the people at PB HQ have been blindfolded in the past and did never realize the potential value of your contribution.
Its not your fault, it was because ... you know it blinds people.
Yet we all use your headers. I use them for any new project and also for all my major projects.
Any seriouse Visual Designer in the PB Market also wether uses exclusively Your Includes OR includes them at least as an option.