hey, i've gotten my program to compile before but now i'm getting an error. the part of the code that has the error, is when the user double clicks and item in the listbox, it opens up the location in explorer. heres the code..
Code:
WORD wID,wNotify;
HWND hCntrl;
int selected = 0, len = 0;
char path[MAX_PATH] = {0}, cmd[22] = "Explorer.exe /select,";
char *command;
if (SendMessage(GetDlgItem(hwnd, ID_INPUTDIR), WM_MOUSEHOVER, 0, (LPARAM)
wID=LOWORD(wParam);
wNotify=HIWORD(wParam);
hCntrl=(HWND)lParam;
if (lParam)
{
/*notification is from a control*/
if (wID==ID_LISTOUT)
{
/*notification is from a listbox control with id of 'ID_OF_LISTBOX'*/
if (wNotify==LBN_DBLCLK)
{
/*an item has been double clicked and we'll open it in an explorer window*/
selected = SendMessage(hCntrl, LB_GETCURSEL, 0, 0);
SendMessage(hCntrl, LB_GETTEXT, (WPARAM)selected, (LPARAM)path);
len = strlen(cmd) + strlen(path) + 1;
command = malloc(len * sizeof(char));
strcpy(command, cmd);
strcat(command, path);
STARTUPINFO si = { sizeof(STARTUPINFO) };
PROCESS_INFORMATION pi = { 0 };
CreateProcess(NULL, command, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
CloseHandle(pi.hThread);
CloseHandle(pi.hProcess);
}
}
}
and here's the error i'm getting..
main.c: In function `WindowProcedure':
main.c:635: warning: use of cast expressions as lvalues is deprecated
main.c:635: error: syntax error before ';' token
make.exe: *** [main.o] Error 1
program: Dev-C++
OS: WinXP Pro
any help is appreciated :] thanks.