Pelles C > Add-ins

Show Active Breakpoints add-in

(1/1)

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


--- Code: ---
/* 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

--- End code ---


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


--- Code: ---
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;
}

--- End code ---


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
--- End quote ---


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

John

Navigation

[0] Message Index

Go to full version