views:

223

answers:

1

Hi,

i want to set the style of picturebox using sendmessage in win32. i want a sample piece of code with enum values of setting style.. please please suggest me... i will be thank full to u guys.. please help me.

+1  A: 

What you want is the

LONG_PTR SetWindowLongPtr(HWND hWnd, int nIndex, LONG_PTR dwNewLong);

function which, according to MSDN "function changes an attribute of the specified window.". The nIndex param should be set to 'GWL_STYLE' and 'dwNewLong' represents the new style.

You can select the various values (use the constants) for the style.

There's a great article exploring this in detail on MSDN: http://msdn.microsoft.com/en-us/library/ms997562.aspx which includes a list of the various styles you can set.

RobS
ya.. setwindowLong i know.. but is there any way to apply style with sendmessage API.. particularly with sendmessage
Shadow
I can't find a WM_ message which would correspond, but you could use SetWindowLongPtr and intercept the messages and see what actually gets sent to the target's message pump.
RobS