News:

Download Pelles C here: http://www.pellesc.se

Main Menu

Offline GitHub MS Documents

Started by John Z, November 09, 2025, 05:21:33 PM

Previous topic - Next topic

John Z

Attached is the full release for the access program for the win32-docs.zip downloaded from GitHub:
https://github.com/MicrosoftDocs/win32

This provides a way to use and access documentation (mainly the API Names) from the GitHub documentation effort off-line, and searchable.

The documents can be viewed in the .md format or in a .html format.  Searching is provided in the .md display, and of course intrinsically in the web browser viewing .html.

TimoVJL provided the code/method to search the win32 documentation for API NAMES from which I created a database and the rest of the program.  See readme_v4.txt, for other external source code attributions.

It is possible that the MD_Files_3.db3 could be expanded in the future to include all topics in the win32-docs.zip and that would not require changing the basic program to be immediately useful.  TBD

John Z

TimoVJL

Sadly win32-docs have still a some problems and updates sometimes make more of them.

MS should make a checking code with or without AI.
MSDN xhtml isn't perfect for offline usage, as every documentations groups do things in their own way, so it is very messy for parsing.

Something went very wrong near year 2012.
May the source be with you

John Z

I'm sure you are right based on prior findings. In the last 15 months it has only grown about 7Meg.

Not sure I want to reprocess it to update the MD_Files_3.db3 and MDFiles.exe I created for easily accessing the data...

Documentation access utilities like Hint, Hint_SA, MDFiles, don't see much interest by forum members.  I might post Hint_SA on SourceForge with links back to Pelles Forum if someone wants the GPL'ed source code that is required to be provided.

John Z

P.S. There is not a 'bot'/'AI' excluded Open Source License yet either . . . theoretically a 'bot'/'AI' could request the source code from any GPL'ed project and the developer would be obligated to provide it.
 
I guess anything on GitHub/GitLab has already been absorbed

TimoVJL

#3
If MS don't give full keyword list, they don't even try to be helpful.

A that MessageBox keyword mystery is odd.

Microsoft should make a keyword list for every function and from where it found from their help sites and local versions.

A code for finding functions from a one folder#define WIN32_LEAN_AND_MEAN
//#include <stdio.h> // clang needs different stdio.h
#include <windows.h>

#pragma comment(lib, "kernel32.lib")
#pragma comment(lib, "user32.lib")

void CheckFile(char *szFile);
int __cdecl puts(const char *string); // clang needs different stdio.h

TCHAR szBuffer[4096];

int ScanDir(char *szDir)
{
WIN32_FIND_DATA fdFile;
HANDLE hFile;
//int i = 0;

int nLen = lstrlen(szDir);
lstrcpy(szDir+nLen, "*-flat.md");
// OutputDebugString(szDir);
hFile = FindFirstFile(szDir, &fdFile);
if (hFile != INVALID_HANDLE_VALUE)
do {
if ((fdFile.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
!= FILE_ATTRIBUTE_DIRECTORY) {
lstrcpy(szDir+nLen, fdFile.cFileName);
//puts(szDir);
//OutputDebugString(szDir);
CheckFile(szDir);
//i++;
}
} while (FindNextFile(hFile, &fdFile));
FindClose(hFile);
return 0;
}

void ParseField1(char *pStart, char *pEnd)
{
char *pPtr1 = pStart+2;
char *pPtr2 = szBuffer;
while (*pPtr1 != '|') { // until a new field separator
if (*pPtr1 != '\\')  // avoid '\'
*pPtr2++ = *pPtr1;
if (*pPtr1 == ')') break; // end of function
pPtr1++;
}
*pPtr2++ = ';';
*pPtr2 = 0;
puts(szBuffer);
}

void CheckFile(char *szFile)
{
HANDLE hFile;
BYTE *pRows;
DWORD nMax, nRead;

hFile = CreateFile(szFile, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
if (hFile != INVALID_HANDLE_VALUE)
{
nMax = GetFileSize(hFile, NULL);
pRows = HeapAlloc(GetProcessHeap(), 0, nMax + 1);
//if (nMax > sizeof(szBuffer)) nMax = sizeof(szBuffer); // read only header
if (ReadFile(hFile, pRows, nMax, &nRead, NULL)) {
TCHAR *pPtr1, *pPtr2; //, *pPtr3;
CloseHandle(hFile);
*(pRows + nMax) = 0; // ensure 0
pPtr1 = (char*)pRows;
while (*pPtr1 != '|') pPtr1++; // find first '|'
if (pPtr1) {
while (*pPtr1 != 10) {
pPtr2 = pPtr1;
while (*pPtr2 != 10) pPtr2++; // find end of line
*pPtr2 = 0; // cut line
if (*pPtr1 != 10 && *(pPtr1+1) != '-' && *(pPtr1+2) != 'F')
ParseField1(pPtr1, pPtr2);
pPtr1 = pPtr2+1;
if (!*pPtr1 || *pPtr1 == 10) break;
}
}
} else CloseHandle(hFile);
HeapFree(GetProcessHeap(), 0, pRows);
}
}

int main(int argc, char **argv) {
char szDir[MAX_PATH];

lstrcpy(szDir, "gdiplus/");
ScanDir(szDir);
return 0;
}
May the source be with you

TimoVJL

#4
A markdown (.md) conversion to RTF could be useful for md-files,
as RichEdit component could show them visually.

Currently win32-docs are not good consistent material, but a testbed for them.

Sadly also a MSDN help file material is just a huge trashcan with too many kind of formattings, no coherent material.

A md-format was a good idea, from it could format many kind of other formats, like bloated xhtml.

QuoteCybersecurity researchers have uncovered a sophisticated malware campaign exploiting Microsoft Help Index Files (.mshi) to deliver the notorious PipeMagic backdoor, marking a significant evolution in the threat actors' tactics since the malware's first detection in 2022.
May the source be with you

Robert

Quote from: TimoVJL on October 31, 2026, 03:51:10 PMA markdown (.md) conversion to RTF could be useful for md-files,
as RichEdit component could show them visually.

Currently win32-docs are not good consistent material, but a testbed for them.

Sadly also a MSDN help file material is just a huge trashcan with too many kind of formattings, no coherent material.

A md-format was a good idea, from it could format many kind of other formats, like bloated xhtml.

QuoteCybersecurity researchers have uncovered a sophisticated malware campaign exploiting Microsoft Help Index Files (.mshi) to deliver the notorious PipeMagic backdoor, marking a significant evolution in the threat actors' tactics since the malware's first detection in 2022.

MarkDown to RTF project here.

https://github.com/fabiov64/md2rtf

TimoVJL

Thanks Robert.

Quite small and only <br> haven't handled / removed  from MS created files.
May the source be with you

MrBcx

#7
I took my earlier MD2HTML and converted it to MD2RTF.

It has most of the same functionality but not all, notably no "--dark" option.

One thing it does have is the ability to call it at the command line with a github RAW url.


MD2RTF https://raw.githubusercontent.com/MicrosoftDocs/win32/refs/heads/docs/desktop-src/Controls/about-combo-boxes.md


The app will resolve, download, and embed the images referenced in the github link.  Pretty useful!

The zip contains a Pelles project, files, and a Samples folder with a half dozen that I created with this tool, just to give an idea of what it produces.

Have fun!

(( Added Later ))

The forum is not showing the 0.6MB zip, so I'm making it available here:

https://bcxbasiccoders.com/bcxusers/mrbcx/md2rtf_poc.zip


Bcx Basic to C/C++ Translator
https://www.bcxbasiccoders.com

Robert

Quote from: MrBcx on Today at 01:48:11 AMI took my earlier MD2HTML and converted it to MD2RTF.

It has most of the same functionality but not all, notably no "--dark" option.

One thing it does have is the ability to call it at the command line with a github RAW url.


MD2RTF https://raw.githubusercontent.com/MicrosoftDocs/win32/refs/heads/docs/desktop-src/Controls/about-combo-boxes.md


The app will resolve, download, and embed the images referenced in the github link.  Pretty useful!

The zip contains a Pelles project, files, and a Samples folder with a half dozen that I created with this tool, just to give an idea of what it produces.

Have fun!

(( Added Later ))

The forum is not showing the 0.6MB zip, so I'm making it available here:

https://bcxbasiccoders.com/bcxusers/mrbcx/md2rtf_poc.zip


Thanks MrBcx, for both MD2HTML and MD2RTF. Very informative and useful.

TimoVJL

#9
Thanks MrBcx

md2rtf works well with MS Word, sadly not so well with Windows 7 RichEdit control, but in msftedit.dll looks good.
May the source be with you