Skip to content

QueryObject

Claude edited this page Oct 26, 2026 · 8 revisions

QueryObject

Command Index · BlitzPlus · System

QueryObject object%, query_id%  ; returns Int

Works in: BlitzPlus

In the original it gives the Windows handle behind a gadget (query 1 is the HWND, 2 the HWND of the client area, 3 the HFONT), so it can be used with the Windows API.

Graphics 320, 240, 32, 2
win = CreateWindow("Query", 20, 20, 240, 100, Desktop(), 3)
SetGadgetText win, "Handle " + QueryObject(win, 1)
Repeat
Until WaitEvent() = $803
Parameter Type Default Description
object Int required A window, gadget or font.
query_id Int required

Differences and known gaps:

  • All gadgets are drawn inside the one window of the program, so queries 1 and 2 give the handle of that window (an HWND on Windows) for every gadget. Fonts (3) have no handle of the operating system and give 0, and so does anything that is not a gadget.

Related commands

Command Index · BlitzPlus · System

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally