Requested API Structure and constants

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
Quin
Addict
Addict
Posts: 1135
Joined: Thu Mar 31, 2022 7:03 pm
Location: Colorado, United States
Contact:

Re: Requested API Structure and constants

Post by Quin »

Code: Select all

#PROCESS_QUERY_LIMITED_INFORMATION = $1000  
Source: https://learn.microsoft.com/en-us/windo ... ess-rights
infratec
Always Here
Always Here
Posts: 7658
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: Requested API Structure and constants

Post by infratec »

Since we can not longer ignore IPv6:

#AF_INET6

Code: Select all

CompilerIf Not Defined(AF_INET6, #PB_Constant)
  CompilerSelect #PB_Compiler_OS
    CompilerCase #PB_OS_Linux
      #AF_INET6 = 10
    CompilerCase #PB_OS_MacOS
      #AF_INET6 = 30
    CompilerCase #PB_OS_Windows
      #AF_INET6 = 23
  CompilerEndSelect
CompilerEndIf
in6_addr

Code: Select all

CompilerIf Not Defined(in6_addr, #PB_Structure)
  Structure in6_addr Align #PB_Structure_AlignC
    StructureUnion
      s6_addr.a[16]
      s6_addr16.u[8]
      s6_addr32.l[4]
    EndStructureUnion
  EndStructure
CompilerEndIf
SOCKADDR_IN6

Code: Select all

CompilerIf Not Defined(SOCKADDR_IN6, #PB_Structure)
  Structure SOCKADDR_IN6 Align #PB_Structure_AlignC
    CompilerIf #PB_Compiler_OS = #PB_OS_MacOS
      sin6_len.a
      sin6_family.a
    CompilerElse
      sin6_family.u
    CompilerEndIf
    sin6_port.u
    sin6_flowinfo.l
    sin6_addr.in6_addr
    sin6_scope_id.l
  EndStructure
CompilerEndIf
Ventural
User
User
Posts: 31
Joined: Mon Jul 17, 2017 3:51 am
Location: Cocoa, FL
Contact:

Re: Requested API Structure and constants

Post by Ventural »

SYSTEM_POWER_STATUS has been updated.
https://learn.microsoft.com/en-us/windo ... wer_status

Code: Select all

Structure SYSTEM_POWER_STATUS
  ACLineStatus.b
  BatteryFlag.b
  BatteryLifePercent.b
  SystemStatusFlag.b   ; <- Showing as "Reserved1.b" in Structure Viewer
  BatteryLifeTime.l
  BatteryFullLifeTime.l
EndStructure
AZJIO
Addict
Addict
Posts: 2215
Joined: Sun May 14, 2017 1:48 am

Re: Requested API Structure and constants

Post by AZJIO »

Constants for AssocQueryString()

Code: Select all

Enumeration  	
	#ASSOCSTR_COMMAND = 1
	#ASSOCSTR_EXECUTABLE
	#ASSOCSTR_FRIENDLYDOCNAME
	#ASSOCSTR_FRIENDLYAPPNAME
	#ASSOCSTR_NOOPEN
	#ASSOCSTR_SHELLNEWVALUE
	#ASSOCSTR_DDECOMMAND
	#ASSOCSTR_DDEIFEXEC
	#ASSOCSTR_DDEAPPLICATION
	#ASSOCSTR_DDETOPIC
	#ASSOCSTR_INFOTIP
	#ASSOCSTR_QUICKTIP
	#ASSOCSTR_TILEINFO
	#ASSOCSTR_CONTENTTYPE
	#ASSOCSTR_DEFAULTICON
	#ASSOCSTR_SHELLEXTENSION
	#ASSOCSTR_MAX
EndEnumeration
I often use opening a file in a program associated with .txt, for example, to open a js file in Notepad, but not to execute it. Or any other file that doesn't have any associations, but I know it's a text file.
Post Reply