My previous posts was mainly consirned with creating an XP styled listview, and i would like to thank any1 who had help me. I would like to ask a question though. I want to know how possible is it to create a button similar to the "Welcome to Windows XP" screen. I thought that a ListView is part of it and the other is the drawing functions and hottracking of the toolbar.
The Listview is done, but the toolbar actions aren't. I have been trying to play with GDI and GDI+ with little to no success. To make it very simple is all i wish to have is this (image) without the item selected whenthe mouse is over it (setting LVN_HOTTRACK to 1 doesn't work).
I know this is a lot to ask and all i can ask really is for some guidence and advice.
Thank you.
Black iCE
The Listview is done, but the toolbar actions aren't. I have been trying to play with GDI and GDI+ with little to no success. To make it very simple is all i wish to have is this (image) without the item selected whenthe mouse is over it (setting LVN_HOTTRACK to 1 doesn't work).
I know this is a lot to ask and all i can ask really is for some guidence and advice.
Thank you.
Black iCE
LVN_HOTTRACK is a notification message. You have to set the extended style using LVS_EX_TRACKSELECT then process the LVN_HOTTRACK message which comes in the form of a WM_NOTIFY notification:
invoke SendMessage, [hListview], LVM_SETEXTENDEDLISTVIEWSTYLE, LVS_EX_TRACKSELECT,
LVS_EX_TRACKSELECT
cmp [uMsg], WM_NOTIFY
jne >.NXTMSG
mov edi,[lParam]
cmp D[edi+NMHDR.code], LVN_HOTTRACK
jne >.NXTNOTIFY
; process your hottracking here
.NXTNOTIFY
jmp >.DEFPROC
.NXTMSG
Thank you donkey, but i have already coded that. I was just a bit consirned about the hover select function,
msdn:
Return Value
Return zero to allow the list view to perform its normal track select processing. If the application returns nonzero, the item will not be selected.
Now all i am trying to do is to draw a rect and make it opiac or alpha blended but so far no success.:(
Kindly,
Black iCE
msdn:
Return Value
Return zero to allow the list view to perform its normal track select processing. If the application returns nonzero, the item will not be selected.
Now all i am trying to do is to draw a rect and make it opiac or alpha blended but so far no success.:(
Kindly,
Black iCE
Hi Black iCE,
mostly it depends on whether it is a dialog or a window that the listview is on. You would normally draw the stuff you want then return non-zero. However if it is a dialog, even returning non-zero will still return 0 to the listview, you must use Set WindowLong to specify a non-zero return:
mostly it depends on whether it is a dialog or a window that the listview is on. You would normally draw the stuff you want then return non-zero. However if it is a dialog, even returning non-zero will still return 0 to the listview, you must use Set WindowLong to specify a non-zero return:
invoke SetWindowLong, [hDlg], DWL_MSGRESULT, 1
mov eax,TRUE
RET
Thank you Donkey! i'll give it a try... i am using a window.
On another note... i am trying very hard to draw a rect with FrameRect but as i am going about it, it keeps on drawing the default colour which is white!
This is primarilay a test routine so that i can place the rect @ the right location and have it interact with the mouse....
On another note... i am trying very hard to draw a rect with FrameRect but as i am going about it, it keeps on drawing the default colour which is white!
DrawLVMenuHiLight proc iIndex:DWORD
LOCAL hBrush:HANDLE
LOCAL hDC:HDC
LOCAL rc:RECT
invoke RtlZeroMemory,ADDR rc,sizeof RECT
mov eax,100
mov rc.bottom,eax
mov rc.right,eax
invoke GetSysColorBrush,COLOR_GRADIENTACTIVECAPTION
mov hBrush,eax
invoke GetDC,g_hWndLVMenu
mov hDC,eax
invoke FrameRect,hDC,ADDR rc,hDC
invoke ReleaseDC,g_hWndLVMenu,hDC
ret
;Look at frameRect & FillRect & InvertRect & GetSysColorBrush
DrawLVMenuHiLight endp
This is primarilay a test routine so that i can place the rect @ the right location and have it interact with the mouse....