API Flags and stuff

BlitzMax Forums/BlitzMax Programming/API Flags and stuff

MattVonFat(Posted 2005) [#1]
Hello. On my miniquest to work out more about the API stuff i want to ask whether the flags that are on the msdn site for the different functions parameters (such as COLOR_ACTIVEBORDER to be random) can be used as they are in BlitzMAX (i know they cant in B+ atleast) and if not where i can find out the values that can be used instead?

Thanks

Matthew


Perturbatio(Posted 2005) [#2]
from delphi's windows.pas:
  CTLCOLOR_MSGBOX = 0;
  CTLCOLOR_EDIT = 1;
  CTLCOLOR_LISTBOX = 2;
  CTLCOLOR_BTN = 3;
  CTLCOLOR_DLG = 4;
  CTLCOLOR_SCROLLBAR = 5;
  CTLCOLOR_STATIC = 6;
  CTLCOLOR_MAX = 7;

  COLOR_SCROLLBAR = 0;
  COLOR_BACKGROUND = 1;
  COLOR_ACTIVECAPTION = 2;
  COLOR_INACTIVECAPTION = 3;
  COLOR_MENU = 4;
  COLOR_WINDOW = 5;
  COLOR_WINDOWFRAME = 6;
  COLOR_MENUTEXT = 7;
  COLOR_WINDOWTEXT = 8;
  COLOR_CAPTIONTEXT = 9;
  COLOR_ACTIVEBORDER = 10;
  COLOR_INACTIVEBORDER = 11;
  COLOR_APPWORKSPACE = 12;
  COLOR_HIGHLIGHT = 13;
  COLOR_HIGHLIGHTTEXT = 14;
  COLOR_BTNFACE = 15;
  COLOR_BTNSHADOW = $10;
  COLOR_GRAYTEXT = 17;
  COLOR_BTNTEXT = 18;
  COLOR_INACTIVECAPTIONTEXT = 19;
  COLOR_BTNHIGHLIGHT = 20;

  COLOR_3DDKSHADOW = 21;
  COLOR_3DLIGHT = 22;
  COLOR_INFOTEXT = 23;
  COLOR_INFOBK = 24;

  COLOR_HOTLIGHT = 26;
  COLOR_GRADIENTACTIVECAPTION = 27;
  COLOR_GRADIENTINACTIVECAPTION = 28;

  COLOR_MENUHILIGHT = 29;
  COLOR_MENUBAR = 30;

  COLOR_ENDCOLORS = COLOR_MENUBAR;

  COLOR_DESKTOP = COLOR_BACKGROUND;
  COLOR_3DFACE = COLOR_BTNFACE;
  COLOR_3DSHADOW = COLOR_BTNSHADOW;
  COLOR_3DHIGHLIGHT = COLOR_BTNHIGHLIGHT;
  COLOR_3DHILIGHT = COLOR_BTNHIGHLIGHT;
  COLOR_BTNHILIGHT = COLOR_BTNHIGHLIGHT;


*EDIT*

to get the rest you could either get a copy of delphi from a computer magazine cover disk (PC Plus regularly gives it away), or download freepascal and look through windows.pas


MattVonFat(Posted 2005) [#3]
Thanks thats a great help!


MattVonFat(Posted 2005) [#4]
Just one more question. Some of the flags have values like 8x0002. How woul di use these in Blitz?


Dreamora(Posted 2005) [#5]
just replace 0x with $ ( this are hexvalues )


MattVonFat(Posted 2005) [#6]
Oh right thanks


MattVonFat(Posted 2005) [#7]
Actually im not sure if its working with the $. I'm getting an error because of it.


Dreamora(Posted 2005) [#8]
$0002 instead of 0x0002? ( hex / bin are in front of the variable not after as the rest )


MattVonFat(Posted 2005) [#9]
Yeah thats what i was doing. Should it change color? Also would it make a difference if it had a letter in it (because L seems to be appearing alot)


Perturbatio(Posted 2005) [#10]
take a look in \samples\birdie\mods\TWin32 before going through all this, it looks like Birdie has done quite a bit of it already.


Sarge(Posted 2005) [#11]
I have created 70% or more of a windows gui. This is the code to create a windows menu. Keep in mind its a bit messy

Global group_
Global pop_
Global pop2_
Global id_
Local newmenu:TMenu = New TMenu

Type TMenu

Field hwnd:Int

Method Create( group_ )

Self.hwnd = PMCreateMenu()
PMSetMenu(group_, Self.hwnd)
FlushMem()
Return group
End Method

Method Title( id_,item:String )
hmenu = PMGetMenu(winhwnd)
pop_=PMCreatePopupMenu()
count=PMgetmenuitemcount(hmenu)
mi:MENUITEMINFO = New MENUITEMINFO
itemgad:String = item:String
mi.cbsize=SizeOf(mi)
mi.fmask=MIIM_TYPE|MIIM_SUBMENU
mi.ftype=MFT_STRING
mi.hsubmenu=pop_
mi.wid=id_
mi.dwtypedata=Int(itemgad.ToCString())
PMInsertMenuItem(Self.hwnd,count+1,1,mi)
PMdrawmenubar(winhwnd)
FlushMem()
End Method

Method Break()
hmenu = PMGetSubMenu(pop_,0)
count=PMgetmenuitemcount(hmenu)
mi:MENUITEMINFO = New MENUITEMINFO
mi.cbsize=SizeOf(mi)
mi.fmask=MIIM_ID | MIIM_TYPE
mi.ftype= MFT_SEPARATOR
PMInsertMenuItem(pop_,count,1,mi)
PMdrawmenubar(winhwnd)
FlushMem()
End Method

Method Item( item:String )
hmenu = PMGetSubMenu(pop_,0)
count=PMgetmenuitemcount(hmenu)
mi:MENUITEMINFO = New MENUITEMINFO
itemgad:String = item:String
mi.cbsize=SizeOf(mi)
mi.fmask=MIIM_ID | MIIM_TYPE
mi.wid=IDM_NEW2
mi.ftype= MFT_STRING
mi.dwtypedata=Int(itemgad.ToCString())
PMInsertMenuItem(pop_,count,1,mi)
PMdrawmenubar(winhwnd)
FlushMem()
End Method

Method SubMenu( item:String )
hmenu = PMGetSubMenu(pop_,0)
pop2=PMCreatePopupMenu()
count=PMgetmenuitemcount(hmenu)
mi:MENUITEMINFO = New MENUITEMINFO
itemgad:String = item:String
mi.cbsize=SizeOf(mi)
mi.fmask=MIIM_ID | MIIM_TYPE | MIIM_SUBMENU
mi.wid=IDM_NEW1
mi.ftype= MFT_STRING
mi.hsubmenu=pop2_
mi.dwtypedata=Int(itemgad.ToCString())
PMInsertMenuItem(pop_,count,1,mi)
PMdrawmenubar(winhwnd)
FlushMem()
End Method

Method SubItem( item:String )
hmenu = PMGetSubMenu(pop2_,0)
count=PMgetmenuitemcount(hmenu)
mi:MENUITEMINFO = New MENUITEMINFO
itemgad:String = item:String
mi.cbsize=SizeOf(mi)
mi.fmask=MIIM_ID | MIIM_TYPE
mi.wid=IDM_NEW1
mi.ftype= MFT_STRING
mi.dwtypedata=Int(itemgad.ToCString())
PMInsertMenuItem(pop2_,count,1,mi)
PMdrawmenubar(winhwnd)
FlushMem()
End Method

End Type


you can even put them on the BlitzMaxGL window with GetActiveWindow() instead of "winhwnd" and abit of modification. I hope it helps you

If you need any other code just email me