I used to work with the small but old PureBasic IDE tool "Alt-F1.exe", which allowed searching for the word under the cursor via Google and in the PureBasic forums. That tool was handy, but it required an external EXE file.
I’ve now replaced it with a pure PowerShell script which means it works entirely with Windows’ built-in tools, no extra program needed.
Setup in the PureBasic IDE:
- Open Tools / Configure Tools
- Click Add a new tool
- Enter the following values:
Name: e.g. WinAPI Search
Command line: powershell.exe
Arguments: (This is where the PowerShell script below goes)
Event: Menu or Shortcut
Shortcut: e.g. Alt + F1
Hidden start: enable this option so the PowerShell window doesn’t pop up.
PowerShell Script (single line, directly insertable)
Code: Select all
-NoProfile -ExecutionPolicy Bypass -Command "$w='%WORD'; $q=[uri]::EscapeDataString($w); $exe='C:\Program Files\SRWare Iron (64-Bit)\chrome.exe'; $u1='https://learn.microsoft.com/search/?terms='+$q+'&scope=Desktop'; $u2='https://www.purebasic.fr/english/search.php?keywords='+$q; $u3='https://www.purebasic.fr/german/search.php?keywords='+$q; Start-Process -FilePath $exe -ArgumentList ('--new-window ' + '"'+$u1+'" "'+$u2+'" "'+$u3+'"')"
In the line
Code: Select all
$exe='C:\Program Files\SRWare Iron (64-Bit)\chrome.exe'
(Of course, this could be chrome.exe, brave.exe, vivaldi.exe, or any other Chromium-based browser.)
The three URLs ($u1, $u2, $u3) define the pages that open simultaneously:
- Microsoft Learn – provides API documentation for Windows functions
- PureBasic English Forum – searches for the current keyword
- PureBasic German Forum – searches for the same keyword
You can easily replace these with other search engines or forums if you like.
The parameter
Code: Select all
--new-window
That way, you can simply close the entire results window afterwards, without affecting your existing browser session.
I’ve attached a few screenshots and a short demo video showing it in action.
Maybe it’ll be useful for some of you, especially if you often work with Windows API calls.
Have fun trying it out!
Kurzer


