News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

SetWindowPos not working

Started by greco558, August 01, 2016, 12:19:52 PM

Previous topic - Next topic

greco558

 I recently updated one of my programs that uses SetWindowPos , but it no longer positions the window . I am using easycode 1.07.0.0008. The pervious version of easycode would assembly the program OK.

Thanks for any help with problem.

jj2007

If it assembles, then it's not the fault of EasyCode. But without seeing your complete code, it's impossible to give a diagnosis.

Post your code. If it contains stuff you don't want to show, make a "reduced" version that still has the SetWindowPos problem.

Welcome to the forum :icon14:

greco558

 Here is the complete easycode/masm32 program.
I made no changes to the program just re-compiled in easycode.
Previously the executable ran fine by placing the window in the upper right conner of screen but now it places window in middle of screen.
Some of the programs listed in the menu bar of this program are other masm32 programs that i wrote to run from this one so clicking on them will do nothing and they will be grayed out.

Thanks for your help
John

jj2007

John,

I can't get it to run as Masm32 (I don't use EasyCode, sorry). And the exe seen from OllyDbg doesn't correspond to the Dialog1.asm file...

But the SetWindowPos should be working, it looks correct. My advice: insert an int 3 shortly before, and watch what's happening in the debugger.

greco558

Thanks, jj2007

It is something in easycode because I compiled using previous version 1.07.0.007 of easycode and it works.
Used new version 1.07.0.0008 to compile and SetWindowPos does not work.
It has to be something in EasyCode IDE when it compiles my code.

John


jj2007

Insert an int 3 before the SetWindowPos, then assemble it and post the exe here.

greco558

Here is exe with int 3 before SetWindowPos

jj2007

There is the culprit:
hWnd = 00A8036C, class = EC2RUNDIALOGBOXControl32, text = Control

SetWindowPos reports invalid window handle.

greco558

Thanks jj2007
I will have to see way the new versions of easycode is doing this the previous version works fine.

Best Regards
John

rsala

Hi John,

You are right, there is something wrong with the last version of EC 1. I am trying to find the bug and fix it.

Sorry for the inconveniences!

Regards,

Ramon
EC coder

rsala

Hi,

The bug has been found. I am going to fit it and release a new version. Meanwhile, remove the following code from the WM_CREATE message and put it in the ECM_AFTERCREATE:

    .ElseIf uMsg == ECM_AFTERCREATE
      ;get screen width and place program in upper right corner
      Invoke GetSystemMetrics, SM_CXSCREEN
      Sub Eax, 225
      Invoke SetWindowPos, hDlg, HWND_NOTOPMOST, Eax, 0, 0, 0, SWP_NOSIZE

Regards,

Ramon
EC coder

rsala

Hi all,

A new version of Easy Code 1, fixing the move/size bug in the WM_CREATE message, has just been released. Please doenload it at:

http://www.easycode.cat/English/Download.htm

Regards,

Ramon
EC coder