Click here to Skip to main content
15,907,905 members
Home / Discussions / Article Writing
   

Article Writing

 
GeneralParser for C header Pin
31-Oct-01 1:05
suss31-Oct-01 1:05 
GeneralRe: Parser for C header Pin
Michael P Butler31-Oct-01 8:27
Michael P Butler31-Oct-01 8:27 
GeneralProblem with C# Pin
SimonS30-Oct-01 5:43
SimonS30-Oct-01 5:43 
GeneralRe: Problem with C# Pin
Todd Smith30-Oct-01 9:09
Todd Smith30-Oct-01 9:09 
GeneralHTML in PocketPc Pin
30-Oct-01 5:03
suss30-Oct-01 5:03 
GeneralListView Notification Example win32 Pin
author29-Oct-01 3:34
author29-Oct-01 3:34 
GeneralRe: ListView Notification Example win32 Pin
Michael Dunn29-Oct-01 7:33
sitebuilderMichael Dunn29-Oct-01 7:33 
GeneralRe: ListView Notification Example win32 Pin
author29-Oct-01 17:04
author29-Oct-01 17:04 
Hi Michael

Thanks for replying. I have seen that code. but it doesn't seemt o work for me in Win32 or maybe I have done something wrng i just can't figure it out. Confused | :confused:

Would appreciate help on this. I have posted the problem yesterday in the Visual C++ discussion board but nobody replied.

I have given details of my problem there and I can't seem to figure out the problem. I will put the stuff here again.

I am making a win32 dll (non MFC) and i have these three functions which I am using (i have more functions but may not be exactly useful here)

HWND WINAPI EXPORT MakeListView(HWND hwnd,long x ,long y,long width,long height)
{
INITCOMMONCONTROLSEX iccex;

iccex.dwICC=ICC_LISTVIEW_CLASSES; //ICC_WIN95_CLASSES;
iccex.dwSize=sizeof(INITCOMMONCONTROLSEX);
InitCommonControlsEx(&iccex);

hwndTT = CreateWindow("SysListView32","",WS_CHILD | WS_VISIBLE | WS_BORDER | LVS_REPORT | LVS_SHOWSELALWAYS , x, y,width,height,awParam->hwnd, NULL, hInst, NULL);
ListView_SetExtendedListViewStyle(hwndTT, LVS_EX_FULLROWSELECT );

//initialize the LVCOLUMN structure
//The LVCOLUMN is used for adding title to the header of listview.
lvc.mask=LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM;
lvc.cx=100;

lvi.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_STATE;
lvi.state = 0;
lvi.stateMask = 0;


return(hwndTT);
}

//The above sample code is for making a listview and it returns a handle

void WINAPI EXPORT ListChangeItemColor(HWND listviewhandle)
{
glPrevWndProc = SetWindowLong(listviewhandle, GWL_WNDPROC,(LONG)(WNDPROC)DoNotify);
}

//this is the second function which accepts the listviewhandle and attempts to use the window procedure of the ListView. I think this is the problem, not sure if i am doing this right.

long DoNotify(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch(msg)
{
case WM_NOTIFY:
{
LPNMLISTVIEW pnm = (LPNMLISTVIEW)lParam;
switch (pnm->hdr.code)
{
case NM_CUSTOMDRAW:
{
LPNMLVCUSTOMDRAW lplvcd = (LPNMLVCUSTOMDRAW)lParam;

if(lplvcd->nmcd.dwDrawStage == CDDS_PREPAINT)
return CDRF_NOTIFYITEMDRAW;

if(lplvcd->nmcd.dwDrawStage == CDDS_ITEMPREPAINT)
{
if(!(lplvcd->nmcd.dwItemSpec % 3))
{
GetClientRect(hwnd,&rect);
MessageBox(NULL,"I am here","help",MB_OK);
lplvcd->clrText =RGB(255, 0, 0);
lplvcd->clrTextBk = RGB(0,0,0);
InvalidateRect(hwnd,&rect,FALSE);

return(CDRF_DODEFAULT);
}
}
}
}
}
default:
return(CDRF_DODEFAULT);
}
return CallWindowProc((WNDPROC)glPrevWndProc, hwnd, msg, wParam, lParam);
}

//This is the window procedure which i call from ListChangeItemColor

Could you tell me what i am doing wrong. I have thought of this for almost the entire 1 whole day and for some reason can't seem to get it working. I saw your code (MFC version) but i still don't know what i am doing wrong.

HELP Frown | :(

QuestionHow to save business in UDDI using VB.net? Pin
adeline28-Oct-01 23:29
adeline28-Oct-01 23:29 
QuestionHow to run cgi script from MFC Pin
Huu Quynh28-Oct-01 13:41
Huu Quynh28-Oct-01 13:41 
AnswerRe: How to run cgi script from MFC Pin
markkuk28-Oct-01 20:35
markkuk28-Oct-01 20:35 
GeneralKPT Bryce Pin
Haniff28-Oct-01 10:14
Haniff28-Oct-01 10:14 
QuestionHow can I map a drive programmatically Pin
26-Oct-01 10:55
suss26-Oct-01 10:55 
AnswerRe: How can I map a drive programmatically Pin
Carlos Antollini26-Oct-01 11:15
Carlos Antollini26-Oct-01 11:15 
GeneralRe: How can I map a drive programmatically Pin
SAK27-Oct-01 13:07
SAK27-Oct-01 13:07 
GeneralBorland C++ 3.1 Pin
Sarah26-Oct-01 4:19
Sarah26-Oct-01 4:19 
GeneralPeople still use BC... amazing! Pin
28-Oct-01 15:37
suss28-Oct-01 15:37 
GeneralRe: People still use BC... amazing! Pin
Migs18-Nov-01 17:14
Migs18-Nov-01 17:14 
GeneralRe: People still use BC... amazing! Pin
George20-Nov-01 19:03
George20-Nov-01 19:03 
GeneralRe: Borland C++ 3.1 Pin
Christian Graus28-Oct-01 15:51
protectorChristian Graus28-Oct-01 15:51 
GeneralRe: Borland C++ 3.1 Pin
Rassman1-Nov-01 22:36
Rassman1-Nov-01 22:36 
GeneralASP Text File - Inserting to top of line Pin
mrhsean25-Oct-01 4:49
mrhsean25-Oct-01 4:49 
GeneralRe: ASP Text File - Inserting to top of line Pin
Nish Nishant27-Oct-01 5:45
sitebuilderNish Nishant27-Oct-01 5:45 
Generalinserting customer's choice Pin
ginola24-Oct-01 17:06
ginola24-Oct-01 17:06 
QuestionWhich one would you like me to write about? Pin
Mehdi Mousavi24-Oct-01 9:40
Mehdi Mousavi24-Oct-01 9:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.