PDA

View Full Version : Windows Api problem



Luuk van Venrooij
29-12-2006, 11:48 PM
I`am doing some windows api programming and I need to use the function TabCtrl_InsertItem. I cant find the propper include. Anyone?

Luuk van Venrooij
29-12-2006, 11:51 PM
It should be in the commctrl unit but it isnt there:S.

michalis
30-12-2006, 04:34 AM
Grepping FPC sources: TabCtrl_InsertItem should be in the Windows unit. Just like all other WinAPI functions.

ComCtrls unit is for components (Lazarus / Delphi ones), so it's not usable for you if you want to use direct WinAPI functions.

Luuk van Venrooij
30-12-2006, 09:15 AM
commctrl is a different unit then ComCtrls. commctrl has al the winapi functions for extended controls. It has TabCtrl_xxxxxxxx fucntions and procedures but not the TabCtrl_InsertItem.

michalis
30-12-2006, 09:48 AM
commctrl is a different unit then ComCtrls. commctrl has al the winapi functions for extended controls. It has TabCtrl_xxxxxxxx fucntions and procedures but not the TabCtrl_InsertItem.

Ahh, this was about CommCtrl unit, sorry.

In any case, I looked at Delphi 6 sources and it seems that Delphi doesn't include TabCtrl_InsertItem at all (neither in Windows unit nor in CommCtrl). Try to use this implementation (pasted from FPC Windows unit) :


function TabCtrl_InsertItem(hwnd:HWND;iItem : longint;var item : TC_ITEM) : LRESULT;
begin
TabCtrl_InsertItem:=SendMessage(hwnd,TCM_INSERTITE M,WPARAM(iItem),LPARAM(@item));
end;