Requested API Structure and constants

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
nco2k
Addict
Addict
Posts: 1344
Joined: Mon Sep 15, 2003 5:55 am

Re: Requested API Structure and constants

Post by nco2k »

god that issue has been fixed like a year ago. how about using an updated version, before posting stuff? :P

c ya,
nco2k
If OSVersion() = #PB_OS_Windows_ME : End : EndIf
User avatar
nco2k
Addict
Addict
Posts: 1344
Joined: Mon Sep 15, 2003 5:55 am

Re: Requested API Structure and constants

Post by nco2k »

can we ask for interfaces here too? :)

Code: Select all

Interface IMMDeviceEnumerator Extends IUnknown
  EnumAudioEndpoints(a, b, c)
  GetDefaultAudioEndpoint(a, b, c)
  GetDevice(a, b)
  RegisterEndpointNotificationCallback(a)
  UnregisterEndpointNotificationCallback(a)
EndInterface

Interface IMMDevice Extends IUnknown
  Activate(a, b, c, d)
  OpenPropertyStore(a, b)
  GetId(a)
  GetState(a)
EndInterface

Interface IPropertyStore Extends IUnknown
  GetCount(a)
  GetAt(a, b)
  GetValue(a, b)
  SetValue(a, b)
  Commit()
EndInterface

#eRender = 0
#eCapture = 1
#eAll = 2
#EDataFlow_enum_count = 3

#eConsole = 0
#eMultimedia = 1
#eCommunications = 2
#ERole_enum_count = 3
c ya,
nco2k
Last edited by nco2k on Sat Oct 14, 2017 5:45 pm, edited 1 time in total.
If OSVersion() = #PB_OS_Windows_ME : End : EndIf
c4s
Addict
Addict
Posts: 1981
Joined: Thu Nov 01, 2007 5:37 pm
Location: Germany

Re: Requested API Structure and constants

Post by c4s »

I don't now when, but the following constants have already been defined:

Code: Select all

#TBPF_NOPROGRESS = 0
#TBPF_INDETERMINATE = 1
#TBPF_NORMAL = 2
#TBPF_ERROR = 4
#TBPF_PAUSED = 8
...Unfortunately they are written in all-lowercase which is a little annoying.
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
yrreti
Enthusiast
Enthusiast
Posts: 546
Joined: Tue Oct 31, 2006 4:34 am

Re: Requested API Structure and constants

Post by yrreti »

Help. When using ABBKlaus Printer_Lib with PB550 it works fine
With PB560b1 it crashes because it's missing the DEVMODE Structure
Install PB550 over it again and it works fine again.
So something like this is missing in PB560b1

The DEVMODE structure has the following form:

Code: Select all

typedef struct _devicemode {    /* dvmd */
    TCHAR  dmDeviceName[32];
    WORD   dmSpecVersion;
    WORD   dmDriverVersion;
    WORD   dmSize;
    WORD   dmDriverExtra;
    DWORD  dmFields;
    short  dmOrientation;
    short  dmPaperSize;
    short  dmPaperLength;
    short  dmPaperWidth;
    short  dmScale;
    short  dmCopies;
    short  dmDefaultSource;
    short  dmPrintQuality;
    short  dmColor;
    short  dmDuplex;
    short  dmYResolution;
    short  dmTTOption;
    short  dmCollate;
    TCHAR  dmFormName[32];
    WORD   dmUnusedPadding;
    USHORT dmBitsPerPel;
    DWORD  dmPelsWidth;
    DWORD  dmPelsHeight;
    DWORD  dmDisplayFlags;
    DWORD  dmDisplayFrequency;
} DEVMODE;
The DEVMODE data structure contains information about the device initialization and environment of a printer.

Thanks

__________________________________________________
Code tags added
26.04.2017
RSBasic
User avatar
nco2k
Addict
Addict
Posts: 1344
Joined: Mon Sep 15, 2003 5:55 am

Re: Requested API Structure and constants

Post by nco2k »

its not missing, it has been finally fixed. you simply have to rename the following fields:

Code: Select all

\dmPosition ---> \Display\dmPosition
\dmDisplayOrientation ---> \Display\dmDisplayOrientation
\dmDisplayFixedOutput ---> \Display\dmDisplayFixedOutput

\dmOrientation ---> \Printer\dmOrientation
\dmPaperSize ---> \Printer\dmPaperSize
\dmPaperLength ---> \Printer\dmPaperLength
\dmPaperWidth ---> \Printer\dmPaperWidth
\dmScale ---> \Printer\dmScale
\dmCopies ---> \Printer\dmCopies
\dmDefaultSource ---> \Printer\dmDefaultSource
\dmPrintQuality ---> \Printer\dmPrintQuality
c ya,
nco2k
If OSVersion() = #PB_OS_Windows_ME : End : EndIf
yrreti
Enthusiast
Enthusiast
Posts: 546
Joined: Tue Oct 31, 2006 4:34 am

Re: Requested API Structure and constants

Post by yrreti »

Thanks very much nco2k for helping me with that. :D
But if I could 'please' ask you. Where or how did you find out that information :?: :?:
I'm not a professional programmer like you and many are on this forum. But I did both
an inside the forum search, and an outside the forum search for some of those params,
and could not find anything referencing that change. I know some changes are listed
when a new version is announced. But I sure couldn't find any reference to this change.
Thanks very much for your help, because I use that in several of my programs for printing.
User avatar
nco2k
Addict
Addict
Posts: 1344
Joined: Mon Sep 15, 2003 5:55 am

Re: Requested API Structure and constants

Post by nco2k »

well i was the one who requested the fix. :D http://purebasic.fr/english/viewtopic.php?f=4&t=67026

when a structure doesnt work anymore, simply open up the structure viewer (tools -> structure viewer) and type in the name of the structure. then you can see all the fields and check whats wrong / what changed.

when you need more infos, usually its enough to type in just the name of the structure in the forum search and the first few threads should be about the changes made. http://purebasic.fr/english/viewtopic.p ... 77#p497777

if you dont find anything useful, feel free to ask in the coding questions sections why its not working anymore. those are simple fixes and you should get help in an instant. :)

c ya,
nco2k
If OSVersion() = #PB_OS_Windows_ME : End : EndIf
yrreti
Enthusiast
Enthusiast
Posts: 546
Joined: Tue Oct 31, 2006 4:34 am

Re: Requested API Structure and constants

Post by yrreti »

Before returning this forum section back to just Requested API Structure and constants.
I just wanted to thank you very much nco2k, for your help on this and showing me how to
find that information.
User avatar
eddy
Addict
Addict
Posts: 1479
Joined: Mon May 26, 2003 3:07 pm
Location: Nantes

Re: Requested API Structure and constants

Post by eddy »

For desktop window manager: https://msdn.microsoft.com/en-us/librar ... s.85).aspx

Code: Select all

Enumeration
#DWMWA_NCRENDERING_ENABLED=1
#DWMWA_NCRENDERING_POLICY
#DWMWA_TRANSITIONS_FORCEDISABLED 
#DWMWA_ALLOW_NCPAINT 
#DWMWA_CAPTION_BUTTON_BOUNDS 
#DWMWA_NONCLIENT_RTL_LAYOUT 
#DWMWA_FORCE_ICONIC_REPRESENTATION 
#DWMWA_FLIP3D_POLICY 
#DWMWA_EXTENDED_FRAME_BOUNDS 
#DWMWA_HAS_ICONIC_BITMAP 
#DWMWA_DISALLOW_PEEK 
#DWMWA_EXCLUDED_FROM_PEEK 
#DWMWA_CLOAK 
#DWMWA_CLOAKED
#DWMWA_FREEZE_REPRESENTATION 
#DWMWA_LAST
EndEnumeration
  

#DWMNCRP_USEWINDOWSTYLE=0  
#DWMNCRP_DISABLED=1        
#DWMNCRP_ENABLED=2  

Code: Select all

Structure MARGINS
cxLeftWidth.l
cxRightWidth.l
cyTopHeight.l
cyBottomHeight.l
EndStructure
__________________________________________________
URL tags added
26.04.2017
RSBasic
Imagewin10 x64 5.72 | IDE | PB plugin | Tools | Sprite | JSON | visual tool
User avatar
Lunasole
Addict
Addict
Posts: 1091
Joined: Mon Oct 26, 2015 2:55 am
Location: UA
Contact:

Re: Requested API Structure and constants

Post by Lunasole »

https://msdn.microsoft.com/en-us/librar ... s.85).aspx

Code: Select all

; Flags for USER_INFO_3, USER_INFO_23 and similar structures (usri3_flags field)
EnumerationBinary UF 
	#UF_SCRIPT
	#UF_ACCOUNTDISABLE
	#UF_HOMEDIR_REQUIRED
	#UF_PASSWD_NOTREQD
	#UF_PASSWD_CANT_CHANGE
	#UF_LOCKOUT
	#UF_DONT_EXPIRE_PASSWD
	#UF_ENCRYPTED_TEXT_PASSWORD_ALLOWED
	#UF_NOT_DELEGATED
	#UF_SMARTCARD_REQUIRED
	#UF_USE_DES_KEY_ONLY
	#UF_DONT_REQUIRE_PREAUTH
	#UF_TRUSTED_FOR_DELEGATION
	#UF_PASSWORD_EXPIRED						; Windows 2000:  This value is not supported.
	#UF_TRUSTED_TO_AUTHENTICATE_FOR_DELEGATION	; Windows XP/2000:  This value is not supported.
EndEnumeration
__________________________________________________
URL tags added
26.04.2017
RSBasic
"W̷i̷s̷h̷i̷n̷g o̷n a s̷t̷a̷r"
User avatar
mk-soft
Always Here
Always Here
Posts: 5334
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

Re: Requested API Structure and constants

Post by mk-soft »

DISPID Constants

https://msdn.microsoft.com/en-us/librar ... s.85).aspx

Code: Select all

  #DISPID_UNKNOWN = -1
  #DISPID_VALUE = 0
  #DISPID_PROPERTYPUT = -3
  #DISPID_NEWENUM = -4
  #DISPID_EVALUATE = -5
  #DISPID_CONSTRUCTOR = -6
  #DISPID_DESTRUCTOR = -7
  #DISPID_COLLECT = -8
__________________________________________________
URL tags added
28.05.2017
RSBasic
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
User avatar
Josh
Addict
Addict
Posts: 1183
Joined: Sat Feb 13, 2010 3:45 pm

Re: Requested API Structure and constants

Post by Josh »

mk-soft wrote:DISPID Constants

https://msdn.microsoft.com/en-us/librar ... s.85).aspx

Code: Select all

  #DISPID_UNKNOWN = -1
  #DISPID_VALUE = 0
  #DISPID_PROPERTYPUT = -3
  #DISPID_NEWENUM = -4
  #DISPID_EVALUATE = -5
  #DISPID_CONSTRUCTOR = -6
  #DISPID_DESTRUCTOR = -7
  #DISPID_COLLECT = -8
From DispEx.h

Code: Select all

#DISPID_STARTENUM = #DISPID_UNKNOWN
#DISPID_THIS = -613
sorry for my bad english
User avatar
Josh
Addict
Addict
Posts: 1183
Joined: Sat Feb 13, 2010 3:45 pm

Re: Requested API Structure and constants

Post by Josh »

From Commctrl.h

Code: Select all

#TVM_GETBKCOLOR          = #TV_FIRST + 31
#TVM_GETEXTENDEDSTYLE    = #TV_FIRST + 45
#TVM_GETINSERTMARKCOLOR  = #TV_FIRST + 38
#TVM_GETITEMHEIGHT       = #TV_FIRST + 28
#TVM_GETITEMPARTRECT     = #TV_FIRST + 72
#TVM_GETITEMSTATE        = #TV_FIRST + 39
#TVM_GETLINECOLOR        = #TV_FIRST + 41
#TVM_GETSCROLLTIME       = #TV_FIRST + 34
#TVM_GETSELECTEDCOUNT    = #TV_FIRST + 70
#TVM_GETTEXTCOLOR        = #TV_FIRST + 32
#TVM_GETTOOLTIPS         = #TV_FIRST + 25
#TVM_GETUNICODEFORMAT    = #CCM_GETUNICODEFORMAT
#TVM_MAPACCIDTOHTREEITEM = #TV_FIRST + 42
#TVM_MAPHTREEITEMTOACCID = #TV_FIRST + 43
#TVM_SETAUTOSCROLLINFO   = #TV_FIRST + 59
#TVM_SETBKCOLOR          = #TV_FIRST + 29
#TVM_SETBORDER           = #TV_FIRST + 35
#TVM_SETEXTENDEDSTYLE    = #TV_FIRST + 44
#TVM_SETHOT              = #TV_FIRST + 58
#TVM_SETINSERTMARK       = #TV_FIRST + 26
#TVM_SETINSERTMARKCOLOR  = #TV_FIRST + 37
#TVM_SETITEMHEIGHT       = #TV_FIRST + 27
#TVM_SETLINECOLOR        = #TV_FIRST + 40
#TVM_SETSCROLLTIME       = #TV_FIRST + 33
#TVM_SETTEXTCOLOR        = #TV_FIRST + 30
#TVM_SETTOOLTIPS         = #TV_FIRST + 24
#TVM_SETUNICODEFORMAT    = #CCM_SETUNICODEFORMAT
#TVM_SHOWINFOTIP         = #TV_FIRST + 71
In the #TVM's there are constants like:

Code: Select all

#TVM_EDITLABEL
#TVM_EDITLABELA
#TVM_EDITLABELW
I think, the ...A and ...W constants are not necessary.
sorry for my bad english
Lebostein
Addict
Addict
Posts: 807
Joined: Fri Jun 11, 2004 7:07 am

Re: Requested API Structure and constants

Post by Lebostein »

Is it possible to load all structures and constants for Windows in the Mac OS IDE? Sometimes I work on Mac OS, and later while testing on Windows I see that some structures I defined already used by Windows (for example the structure "coord"). In that case I have to rename all these things in the code.... Thanks!
User avatar
Bisonte
Addict
Addict
Posts: 1226
Joined: Tue Oct 09, 2007 2:15 am

Re: Requested API Structure and constants

Post by Bisonte »

Lebostein wrote:Is it possible to load all structures and constants for Windows in the Mac OS IDE? Sometimes I work on Mac OS, and later while testing on Windows I see that some structures I defined already used by Windows (for example the structure "coord"). In that case I have to rename all these things in the code.... Thanks!
You can use GetPBInfo from Danilo on windows and use the output
as include or if it works as resident.
PureBasic 6.04 LTS (Windows x86/x64) | Windows10 Pro x64 | Asus TUF X570 Gaming Plus | R9 5900X | 64GB RAM | GeForce RTX 3080 TI iChill X4 | HAF XF Evo | build by vannicom​​
English is not my native language... (I often use DeepL to translate my texts.)
Post Reply