Skip to content

QueryObject

Narta Xaymar Dirks edited this page Oct 31, 2026 · 8 revisions
BlitzPlus

QueryObject

QueryObject:Int32 object:Int32, query_id:Int32
Parameter Mode Type Default Description
object In Int32 required A window, gadget or font.
query_id In Int32 required

Returns: The handle of the system that the query asks for, or 0 if the object has none (see the difference below).

Description

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.

Differences

  • Queries 1 and 2 give a number for the window of the operating system that the gadget is in: the same number for every gadget in a window, and it is the runtime's number for the window, not an HWND that the Windows API can use. For the desktop, and for gadgets drawn inside the window of Graphics, it is the handle of that window. Fonts (3) have no handle of the operating system and give 0, and so does anything that is not a gadget.

Examples

Graphics 320, 240, 32, 2
win = CreateWindow("Query", 20, 20, 240, 100, Desktop(), 3)
SetGadgetText win, "Handle " + QueryObject(win, 1)
Repeat
Until WaitEvent() = $803

Related Commands

PauseTimer, Proceed, ResetTimer, ResumeTimer

Home · Command Index



Differences
Language Features
BlitzBasic
Blitz3D
BlitzPlus

Clone this wiki locally