It is currently Thu May 23, 2013 1:10 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 62 posts ]  Go to page 1, 2, 3, 4, 5  Next
Author Message
 Post subject: Requested API Structure and constants
PostPosted: Wed Jul 15, 2009 3:55 pm 
Offline
Administrator
Administrator

Joined: Fri May 17, 2002 4:39 pm
Posts: 8875
Location: France
Hi there,

There is many topics opened to request API constants and structure support in PB, which is not really bug report, so please use this one from now, to avoid floods.

Thanks !


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 25, 2009 4:59 am 
Offline
Addict
Addict
User avatar

Joined: Sat Feb 19, 2005 5:05 pm
Posts: 1693
Location: Norway
MonitorFromWindow_() and GetMonitorInfo_() use these:

Code:
#MONITORINFOF_PRIMARY=1
#MONITOR_DEFAULTTONULL=0
#MONITOR_DEFAULTTOPRIMARY=1
#MONITOR_DEFAULTTONEAREST=2

Structure MONITORINFO
 cbSize.l
 rcMonitor.RECT
 rcWork.RECT
 dwFlags.l
EndStructure

Structure MONITORINFOEX
 cbSize.l
 rcMonitor.RECT
 rcWork.RECT
 dwFlags.l
 szDevice.s{#CCHDEVICENAME}
EndStructure

#SM_XVIRTUALSCREEN=76
#SM_YVIRTUALSCREEN=77
#SM_CXVIRTUALSCREEN=78
#SM_CYVIRTUALSCREEN=79
#SM_CMONITORS=80


Misc:
Code:
#BCM_SETSHIELD=#BCM_FIRST+$000C ;Used by SendMessage_() to set elevation shield icon in buttons like in SendMessage_(GadgetID(gadget),#BCM_SETSHIELD,#Null,#True)

#FILE_SHARE_DELETE=$00000004 ;Used by CreateFile_()

#ENUM_CURRENT_SETTINGS=-1 ;Used by EnumDisplaySettings_()
#ENUM_REGISTRY_SETTINGS=-2 ;Not sure, but defined together with ENUM_CURRENT_SETTINGS.


Used by InternetOpen_(), InternetOpenUrl_(), HttpQueryInfo_(), etc.
Code:
#INTERNET_FLAG_RELOAD                   = $80000000
#INTERNET_DEFAULT_HTTP_PORT             = 80
#INTERNET_DEFAULT_HTTPS_PORT            = 443
#INTERNET_DEFAULT_FTP_PORT              = 21
#HTTP_QUERY_FLAG_NUMBER                 = $20000000
#HTTP_QUERY_CONTENT_LENGTH              = 5
#HTTP_QUERY_STATUS_CODE                 = 19
#HTTP_STATUS_OK                         = 200
#INTERNET_OPEN_TYPE_PRECONFIG           = 0
#INTERNET_FLAG_SECURE                   = $00800000
#INTERNET_FLAG_IGNORE_CERT_DATE_INVALID = $2000
#INTERNET_FLAG_IGNORE_CERT_CN_INVALID   = $1000
#INTERNET_FLAG_NO_CACHE_WRITE           = $04000000
;There are much more than these in Wininet.h etc, but these are the only ones I use currently.

_________________
Image website, journal, projects, reviews and more.
Normality exist in the minds of others, not mine! - Rescator


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 08, 2009 1:28 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Wed Jun 28, 2006 6:55 pm
Posts: 145
Location: Schröttersburg
Code:
#MIM_APPLYTOSUBMENUS
#MIM_BACKGROUND
#MIM_HELPID
#MIM_MAXHEIGHT
#MIM_MENUDATA
#MIM_STYLE

#MNS_AUTODISMISS
#MNS_CHECKORBMP
#MNS_DRAGDROP
#MNS_MODELESS
#MNS_NOCHECK
#MNS_NOTIFYBYPOS

Structure MENUINFO
  cbSize.l
  fMask.l
  dwStyle.l
  cyMax.l
  hbrBack.l
  dwContextHelpID.l
  dwMenuData.l
EndStructure

Structure STYLESTRUCT
  styleOld.l
  styleNew.l
EndStructure

#SB_SETICON, #SB_GETICON; << strange, it's visible in jaPBe's Constants Explorer?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 10, 2009 7:51 am 
Offline
PureBasic Expert
PureBasic Expert
User avatar

Joined: Sat Apr 26, 2003 8:27 am
Posts: 4231
Location: Strasbourg / France
klaver wrote:
#SB_SETICON, #SB_GETICON; << strange, it's visible in jaPBe's Constants Explorer?

jaPBe's constant explorer relies on its own constant list (and not the PB residents).

_________________
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).


Top
 Profile  
 
 Post subject:
PostPosted: Thu Aug 13, 2009 8:16 pm 
Offline
Addict
Addict
User avatar

Joined: Sat Feb 19, 2005 5:05 pm
Posts: 1693
Location: Norway
Used by UpdateLayeredWindow_() and related structures.

Code:
#AC_SRC_OVER=$0
#AC_SRC_ALPHA=$1
#ULW_COLORKEY=$1
#ULW_ALPHA=$2
#ULW_OPAQUE=$4

_________________
Image website, journal, projects, reviews and more.
Normality exist in the minds of others, not mine! - Rescator


Top
 Profile  
 
 Post subject: Re: Requested API Structure and constants
PostPosted: Sun Sep 20, 2009 10:16 am 
Offline
Addict
Addict
User avatar

Joined: Sun Mar 19, 2006 1:57 pm
Posts: 4835
Location: Germany
Missing Function: SetThreadExecutionState
Missing Constants for this Function:
Code:
#ES_AWAYMODE_REQUIRED = $00000040
#ES_CONTINUOUS        = $80000000
#ES_DISPLAY_REQUIRED  = $00000002
#ES_SYSTEM_REQUIRED   = $00000001
#ES_USER_PRESENT      = $00000004

Related MSDN Site: http://msdn.microsoft.com/en-us/library ... 85%29.aspx
thnx in adv.

_________________
oh... and have a nice day.


Top
 Profile  
 
 Post subject: Re: Requested API Structure and constants
PostPosted: Fri Sep 25, 2009 7:12 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Wed Jun 28, 2006 6:55 pm
Posts: 145
Location: Schröttersburg
Code:
lpmii.MENUITEMINFO\cbSize = 44;SizeOf(MENUITEMINFO)

Took me most of the day to find out why it's not working on WinNT 4.0...
I think it would be safe to use the older (44 bytes) MENUITEMINFO structure by default.
If someone needs the hbmpItem member he can declare newer (48 bytes) version of the structure.

Also it's more consistent as most of the WinXP & Vista structures and constants aren't declared in PB.

_________________
Image


Top
 Profile  
 
 Post subject: Re: Requested API Structure and constants
PostPosted: Sun Oct 25, 2009 4:58 am 
Offline
Addict
Addict

Joined: Wed Aug 24, 2005 8:39 am
Posts: 2558
Location: Southwest OH - USA
USER_TIMER_MINIMUM 0x0000000A
USER_TIMER_MAXIMUM 0x7FFFFFFF


Top
 Profile  
 
 Post subject: Re: Requested API Structure and constants
PostPosted: Wed Dec 02, 2009 5:57 pm 
Offline
Addict
Addict

Joined: Sun Sep 07, 2008 12:45 pm
Posts: 1441
Location: Germany
#MOUSEEVENTF_VIRTUALDESK = $4000


Top
 Profile  
 
 Post subject: Re: Requested API Structure and constants
PostPosted: Sun Dec 06, 2009 1:58 am 
Offline
Addict
Addict

Joined: Wed Aug 24, 2005 8:39 am
Posts: 2558
Location: Southwest OH - USA
#CFM_WEIGHT=$400000


Top
 Profile  
 
 Post subject: Re: Requested API Structure and constants
PostPosted: Sun Dec 13, 2009 11:02 am 
Offline
Addict
Addict
User avatar

Joined: Sat Jun 30, 2007 8:04 pm
Posts: 2704
http://msdn.microsoft.com/en-us/library ... 85%29.aspx

I think this is correct:

Code:
#IMAGE_SIZEOF_SHORT_NAME=8

Structure Misc
  StructureUnion
    PhysicalAddress.l
    VirtualSize.l
  EndStructureUnion
EndStructure

Structure IMAGE_SECTION_HEADER
  Name.b[#IMAGE_SIZEOF_SHORT_NAME]
  Misc.Misc
  VirtualAddress.l
  SizeOfRawData.l
  PointerToRawData.l
  PointerToRelocations.l
  PointerToLinenumbers.l
  NumberOfRelocations.w
  NumberOfLinenumbers.w
  Characteristics.l
EndStructure

_________________
Image


Top
 Profile  
 
 Post subject: Re: Requested API Structure and constants
PostPosted: Wed Dec 23, 2009 6:50 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Fri Apr 25, 2003 5:10 pm
Posts: 413
Location: France (Doubs)
ToolBar structure

Actual structure TBBUTTONINFO
Code:
     Structure TBBUTTONINFO
          cbSize.l
          dwMask.l
          idCommand.l
          iImage.l
          fsState.b
          fsStyle.b
          cx.w
          lParam.i
          *pszText.c
          cchText.l
     EndStructure


structure MS
Code:
     typedef struct _TBBUTTONINFOA {
     UINT  cbSize;
     DWORD  dwMask;
     int  idCommand;
     int  iImage;
     BYTE  fsState;
     BYTE  fsStyle;
     WORD  cx;
     DWORD_PTR  lParam;
     LPSTR  pszText;
     int  cchText;
     #if (_WIN32_WINNT >= 0x0600)
     int  iImageLabel;
     #endif
     } TBBUTTONINFOA,  *LPTBBUTTONINFOA;


The new structure if OK (change cx.w by cx.u, added iImageLabel)

I think that *pszText.c must be *pszText as you said that such wrinting has no sens.

Code:
     Structure TBBUTTONINFO
          cbSize.l
          dwMask.l
          idCommand.l
          iImage.l
          fsState.b
          fsStyle.b
          cx.u
          lParam.i
          *pszText.c
          cchText.l
          iImageLabel.l
     EndStructure

_________________
A+
Denis


Top
 Profile  
 
 Post subject: Re: Requested API Structure and constants
PostPosted: Thu Dec 24, 2009 4:41 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Fri Apr 25, 2003 5:10 pm
Posts: 413
Location: France (Doubs)
Fred,

i've done some tests on ToolBar with msg #TB_SETBUTTONINFO (=#TB_SETBUTTONINFOA) and #TB_SETBUTTONINFOW with the new structure I propse.

The message #TB_SETBUTTONINFOA (ASCII) or #TB_SETBUTTONINFOW (Unicode) always failed with the item iImageLabel added to the structure.
It's Ok with the actual structure. It's OK too if i change cx.w to cx.u and pszText.c to pszText
and without iImageLabel.

I don't know why it fails, i try with Seven x 86, PB 4.40 final; GetLasterror_() always return 0 on failure.

May there is a problem with this msg (http://www.codeguru.com/forum/showthread.php?t=429807)

_________________
A+
Denis


Top
 Profile  
 
 Post subject: Re: Requested API Structure and constants
PostPosted: Mon Jan 11, 2010 11:49 am 
Offline
Addict
Addict
User avatar

Joined: Wed Feb 28, 2007 9:13 am
Posts: 923
Location: Edinburgh
#Orange = RGB(255,128,0)

_________________
JACK WEBB: "Coding in C is like sculpting a statue using only sandpaper. You can do it, but the result wouldn't be any better. So why bother? Just use the right tools and get the job done."


Top
 Profile  
 
 Post subject: Re: Requested API Structure and constants
PostPosted: Fri Jan 15, 2010 7:48 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sun Dec 02, 2007 12:11 pm
Posts: 229
Location: Germany
Please update NOTIFYICONDATA, thanks:
Code:
Structure NOTIFYICONDATA
  cbSize.l
  CompilerIf #PB_Compiler_Processor = #PB_Processor_x64
    PB_Alignment1.b[4]
  CompilerEndIf
  hWnd.i
  uID.l
  uFlags.l
  uCallbackMessage.l
  CompilerIf #PB_Compiler_Processor = #PB_Processor_x64
    PB_Alignment2.b[4]
  CompilerEndIf
  hIcon.i
  StructureUnion
    szTip.s{64}
    szTipEx.s{128}
  EndStructureUnion
  dwState.l
  dwStateMask.l
  szInfo.s{256}
  StructureUnion
    uTimeout.l
    uVersion.l
  EndStructureUnion
  szInfoTitle.s{64}
  dwInfoFlags.l
  guidItem.GUID
  hBalloonIcon.i
EndStructure


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 62 posts ]  Go to page 1, 2, 3, 4, 5  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye