News:

Download Pelles C here: http://www.smorgasbordet.com/pellesc/

Main Menu

Show Active Breakpoints add-in

Started by JohnF, April 21, 2005, 06:33:33 PM

Previous topic - Next topic

JohnF

I don't know who wrote the 'Show Active Breakpoints' add-in, but here is a way to select the 'Find in Files' tab.


In FindBP_PPX2LB(), this code added after the comment TODO: etc


/* TODO: find a way to activate the "Find in Files" window */
NMHDR nmh;
HWND hTab = Get_hSysTabCtrl();
if(hTab)
{
SendMessage(hTab, (UINT)TCM_SETCURSEL,(WPARAM)1,(LPARAM)0);  
nmh.hwndFrom = hTab;
nmh.code     = TCN_SELCHANGE;
nmh.idFrom   = GetDlgCtrlID(hTab);
SendMessage(g_hwndMain, WM_NOTIFY, nmh.idFrom, (LPARAM)&nmh);
}

return err;
#undef BUFS


And here is the added function to find the tab control.


HWND Get_hSysTabCtrl(void)
{
HWND hPCIDE, hPCTAB;
HWND *h;

h = &hPCIDE;
*h = FindWindow("PellesC_IDE",NULL);
if(!*h)
goto errfindTab;

h = &hPCTAB;
// find the first Tab control
*h = FindWindowEx(hPCIDE,NULL,"SysTabControl32",NULL);
if(!*h)
goto errfindTab;

// find the next Tab control
*h = FindWindowEx(hPCIDE,hPCTAB,"SysTabControl32",NULL);
if(!*h)
goto errfindTab;

return *h;

errfindTab:
return NULL;
}


Very handy add-in, thanks.

John

tiwag

Hi John
i wrote this addin, i'm glad that one find's it useful, thanks !

-tiwag

JohnF

Quote from: "tiwag"Hi John
i wrote this addin, i'm glad that one find's it useful, thanks !

-tiwag

Ok, people don't seem to add their name these days. :) At least I couldn't find it.

John