suppose im working only with winapi's to create my dialogbox, take this as example

invoke CreateWindowEx, NULL, ADDR EditClass, NULL, WS_CHILD, 0Dh,0ADh, 17h, 10h, hWnd, NULL, hInst, NULL

how do i know where in my screen will this be created ? im lost with this part.. if anyone show me the light
Posted on 2001-10-22 19:38:47 by registred
At first, to create a DIALOGBOX you do not use CreateWindow functions. But creating both is almost the same. When you call to the correspondient functions you define the position, apart from other things. Do you have a WinAPI reference? If you do not do so, look at this piece of WIN32.hlp:
HWND CreateWindow(

LPCTSTR lpClassName, // pointer to registered class name
LPCTSTR lpWindowName, // pointer to window name
DWORD dwStyle, // window style
int x, // horizontal position of window
int y, // vertical position of window
int nWidth, // window width
int nHeight, // window height
HWND hWndParent, // handle to parent or owner window
HMENU hMenu, // handle to menu or identifier
HANDLE hInstance, // handle to application instance
LPVOID lpParam // pointer to window-creation data

Easy, isn?t it?

Be sure that the coordinates of the screen begin in the upper left part. So, you have points (0,0) in the upper left of the screen.

Now it is clearer, isn?t it
Posted on 2001-10-22 20:29:16 by CodeLover
The x-y arguments of CreateWindowEx tells Windows where the upper left corner of the new window goes.

When the new window is a child window (WS_CHILD), (0,0) is the coordinate of the upper left corner of the client area of the parent window. Otherwise, it is the upper left corner of the (desktop) screen.
Posted on 2001-10-25 20:13:39 by tank

Your code is for a normal window when you use CreateWindowEx(). A dialog box is another set of APIs which are dedicated to creating dialog boxes.

The other thing is there is no point in setting you window co-ordinates in HEX, it just makes them harder to read for no purpose, the screen resolution of a computer is usually set in decimal which makes code a lot easier to read.

There is a lot of example code around that will help you getting this basic window stuff going, Iczelion's tutorials, the MASM32 example code and many other excellent examples posted by various members of this forum.

This range of code will get you up to pace fast so you can work on creating your own applications in assembler.

Good luck with your assembler coding.


Posted on 2001-10-25 21:00:04 by hutch--