Author Topic: NULL_BRUSH and TRANSPARENT  (Read 1393 times)

0 Members and 1 Guest are viewing this topic.

chrisc

  • Guest
NULL_BRUSH and TRANSPARENT
« on: March 18, 2018, 06:29:24 PM »
Hello

when i try compiling a program with the below code
the compiler display an error message (shown in the atteched image)

Code: [Select]
   IF GetDlgCtrlID(lParam) = LabelFN THEN
                'wPARAM id device context DC
               SetTextColor(wPARAM, RGB(0,0,250))
               SetBkMode(wPARAM, TRANSPARENT)
               FUNCTION = GetStockObject(NULL_BRUSH)
               EXIT FUNCTION
      END IF                                 

the compiler found 2 unidentified objects   NULL_BRUSH  and TRANSPARENT
this must be caused by a missing include file

i have use CoreWin  what other include file shall i use?

Arnold

  • Guest
Re: NULL_BRUSH and TRANSPARENT
« Reply #1 on: March 18, 2018, 11:48:45 PM »
Hi Chris,

% NULL_BRUSH=5
% TRANSPARENT=1

in OxygenBasic only the most used WinApi constants are defined. I use a small helper file, constructed of some C header files, but I think in Powerbasic these constants are defined somewhere too.

BTW: Dialogs.inc uses only the constants to run Dialogs.inc itself. So extra constants or types must be defined separately, if this is not already done somewhere else.

Roland

chrisc

  • Guest
Re: NULL_BRUSH and TRANSPARENT
« Reply #2 on: March 19, 2018, 05:47:40 AM »
Thanxx a lot Arnold,  this problem is now rectified

can you show me where to find the web links to these API constants?  i have been searching for it yesterday

chrisc

  • Guest
Re: NULL_BRUSH and TRANSPARENT
« Reply #3 on: March 19, 2018, 06:11:25 AM »
Hello Aurel and thanxx

yes i found some constants in ur awinh.inc,   is this the most correct one that contains all the API constants

can it be replacement of Corewin.inc  ?

 or can itwork with corewin.inc without duplicating each other?

Aurel

  • Guest
Re: NULL_BRUSH and TRANSPARENT
« Reply #4 on: March 19, 2018, 06:31:47 AM »
hi chrisc
yes you can find many constants inside awinh.inc or awinh035.inc.

well for coremin.inc i am not sure , I use mine and what i found on web
sometimes i use MinWin.inc .

Also you can use both but for sure most constants are same...
You must know that I use awinh.inc for windows not for dialogs.
sorry i don't build Dialog Apps.  ::) 

Charles Pegge

  • Guest
Re: NULL_BRUSH and TRANSPARENT
« Reply #5 on: March 19, 2018, 12:26:53 PM »
I'll add this set to WinData.inc (which is included in MinWin and CoreWin)

Code: [Select]
  % WHITE_BRUSH      0
  % LTGRAY_BRUSH     1
  % GRAY_BRUSH       2
  % DKGRAY_BRUSH     3
  % BLACK_BRUSH      4
  % HOLLOW_BRUSH     5
  % NULL_BRUSH       5

  % WHITE_PEN        6
  % BLACK_PEN        7
  % NULL_PEN         8

chrisc

  • Guest
Re: NULL_BRUSH and TRANSPARENT
« Reply #6 on: March 19, 2018, 01:10:56 PM »
thanxx Aurel and Charles
more enhancement to O2 the better, i quite like O2 now