News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

differences between windows 7 and vista

Started by shankle, August 16, 2011, 01:20:34 PM

Previous topic - Next topic

shankle

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.
The greatest crime in my country is our Congress

dedndave

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

shankle

Hi Dave,
Problem solved. Maybe not the best way but it seems to work.
WM_LBUTTONDOWN then left click then Sendmessage
Thanks
The greatest crime in my country is our Congress

Bill Cravener

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.
My MASM32 Examples.

"Prejudice does not arise from low intelligence it arises from conservative ideals to which people of low intelligence are drawn." ~ Isaidthat