Thanks for any suggestions.
This code worked in Vista Pro.
It gives Windows 7 Pro fits.
.ELSEIF iMsg==WM_PAINT
.IF SWH==0 ; process first time only
mov SWH, 1
invoke SendMessage, hWnd, WM_COMMAND, NULL, NULL
.ENDIF
invoke BeginPaint, hWnd, ADDR ps
invoke EndPaint, hWnd, ADDR ps
SWH is defined as a DD set to zero
My purpose is to execute WM_Command once.
I guess there is another way to accomplish the same task.
is it possible to give a non-zero value for wParam in SendMessage ?
if you give it a value that has the high word set to 0, it will look like a menu item was selected
http://msdn.microsoft.com/en-us/library/ms647591%28v=vs.85%29.aspx
it looks like you want a sort of WM_CREATE
but you may not be able to do what you like during WM_CREATE :P
i sometimes call a proc to perform such tasks, just before entering the message loop
Hi Dave,
Problem solved. Maybe not the best way but it seems to work.
WM_LBUTTONDOWN then left click then Sendmessage
Thanks
Don't understand what it is your doing in the WM_PAINT message there shankle, but anyway, the problem may be SendMessage does not return until the window procedure has processed the message where as PostMessage returns without waiting. Might want to give that one a try.