Home
Site Structure

Programming Home
  Basic Home
    GUI & OS Home
    QB Knowledge Base
    Professor Answers
    Codename Surena
    QB Downloads

Write Us

Special Links
QB DirectoryNEW

Codename Surena
Forums
Sepent Basic GUI & OS Home
Register Log In
QB Knowledge Base > How To Questions > Number 6

How to detect Microsoft Windows running?
You can use &H2F interrupt service, using CALL INTERRUPT statement:

	'$INCLUDE: 'QB.BI'
	
	DIM InRegs AS RegType
	DIM OutRegs AS RegType
	
	InRegs.AX = &H160A
	CALL INTERRUPT(&H2F, InRegs, OutRegs)
	
	IF OutRegs.AX = 0 THEN
		'Windows is running.
	ELSE
		'Windows is not running.
	END IF
		

If you use QBASIC 1.1 that does not support CALL INTERRUPT statement, you may use the solution provided at ht7: How to imitate CALL INTERRUPT in QBASIC 1.1?