-
June 15th, 2003, 07:11 AM
#1
const value for PBM_SETBKCOLOR
i need const value for PBM_SETBKCOLOR
and is there any way i myself can get its value
apart from writing a small prog. in vc++
i tried it but i failed
-
June 15th, 2003, 07:24 AM
#2
Code:
Private Const CCM_FIRST As Long = &H2000
Private Const CCM_SETBKCOLOR As Long = (CCM_FIRST + 1)
Private Const PBM_SETBKCOLOR As Long = CCM_SETBKCOLOR
or in simple terms it's value is 8193
string Signature = Censored;
-
June 15th, 2003, 07:24 AM
#3
If you have VC++ installed, all of the declarations are defined in COMMCTRL.H. Do a search for it on your system.
If you want an easy way to change the colors of a progress bar, you should download my version of it that I made. Its simple, fast and offers a lot more funcitonality thatn the standard Microsoft one. Get it from Planet Source Code. If you do a search for 'FiniteInfinity', you should find it!
Good luck.
Finite
"If a cat always lands on its feet, and a peice of bread always lands butter side down, if you strap a peice of bread butter side up to the back of a cat, will it hover?"
-
June 15th, 2003, 07:25 AM
#4
PBM_SETBKCOLOR is 8193. You can get that value without using a VC simple program by using are the commctrl.h file.
It is defined like this
#define PBM_SETBKCOLOR CCM_SETBKCOLOR // lParam = bkColor
so you haave to get the value of CCM_SETBKCOLOR
#define CCM_SETBKCOLOR (CCM_FIRST + 1) // lParam is bkColor
again, you have to get the value of CCM_FIRST and add 1
#define CCM_FIRST 0x2000 // Common control shared messages
finally we can get 0x2000 + 1 = 0x2001 and this hex value is equal to 8193. You can also use &H2001 to define it.
Hope it will help you
Last edited by rxbagain; June 15th, 2003 at 07:34 AM.
-
June 15th, 2003, 07:27 AM
#5
if you are colouring a progressbar in vb , here's a little code i made a while back to show gow to get started.
Code:
Private Declare Function SendMessage Lib "user32.dll" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Const WM_USER As Long = &H400
Private Const CCM_FIRST As Long = &H2000
Private Const CCM_SETBKCOLOR As Long = (CCM_FIRST + 1)
Private Const PBM_SETBARCOLOR As Long = (WM_USER + 9)
Public Function ColorBar(prgBar As ProgressBar, Optional BkCol As ColorConstants, Optional FrCol As ColorConstants)
If BkCol = 0 Then BkCol = vbBlue
If FrCol = 0 Then FrCol = vbRed
SendMessage prgBar.hwnd, CCM_SETBKCOLOR, ByVal 0&, ByVal BkCol
SendMessage prgBar.hwnd, PBM_SETBARCOLOR, ByVal 0&, ByVal FrCol
End Function
Private Sub Command1_Click()
ColorBar ProgressBar1, vbBlue, vbRed
End Sub
hope this helps.
string Signature = Censored;
-
June 15th, 2003, 07:53 AM
#6
thanx all of u for ur replies
but i guess as of now i will b using 'FiniteInfinity' progress bar it is really cool & what i always wanted the 'caption'
rxbagain:
thanx for ur reply it did really helped me
one more thing how can i convert that hex value
sorry for this silly question?
-
June 15th, 2003, 08:06 AM
#7
i said, it was really a silly question
i am sorry i should have searched the forum b4 asking the question. i got the answer
thanx
-
June 15th, 2003, 08:13 AM
#8
You can use your calculator (calc.exe).
You can also type the hex value in the VB IDE (hex value in a single line alone) and then after typing press the up or down arrow or enter. It will convert the hex to string. For example if you type &H2001 and then press enter, it will automatically replaced with 8193. Just make sure that in that line the only typed is &H2001.
-
June 15th, 2003, 05:02 PM
#9
you can also use Clng in vb to get the value
eg: value = Clng(&H2001)
or to convert to C++ format 0x2001 , and same to convert from C++ format
eg: 0x0107 would be &H0107
string Signature = Censored;
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|