0

When making a window using invoke MessageBox,(string),(string) syntax, are their any parameters that allow you to set the size of the window you are creating?

For example,

.386
.model flat,sdcall
option casemap:none

include \masm32\include\windows.inc 
include \masm32\include\user32.inc 
include \masm32\include\kernel32.inc 
includelib \masm32\lib\user32.lib 

.data
     msg db "Hello, world!",0
     title db "A messagebox",0
.code 
start:
      invoke MessageBox, NULL,addr title, addr msg, MB_OK
      invoke ExitProcess, 0
end start

Is there any way that I can change the size of the box that is made? Like a width/height parameter?

Thanks

Progrmr
  • 1,575
  • 4
  • 26
  • 44

1 Answers1

1

No, if you need control over the window, you should make a DialogBox. It's quite involved however.

Jens Björnhager
  • 5,632
  • 3
  • 27
  • 47
  • Could you provide some example assembly code to make a simple dialogbox? – Progrmr Aug 24 '12 at 03:22
  • After having a look, SURELY there must be a simple macro or something to create a window, or at least something simpler??? It's so overly complex! – Progrmr Aug 24 '12 at 03:28
  • I don't have any masm code using dialogs, but perhaps you would be better off making an ordinary window with CreateWindow? It's hard to guess what you need. – Jens Björnhager Aug 24 '12 at 05:30
  • How do I use createwindow? I looked at all the code on the internet and its in C++ – Progrmr Aug 24 '12 at 05:33
  • Look it up on msdn. It's similar to making a dialog box. – Jens Björnhager Aug 24 '12 at 05:39
  • Could you show me an example? Sorry to be a bother, but I just don't get how to implement it. – Progrmr Aug 24 '12 at 06:40
  • @AussieGamer - The function [CreateWindowEx](http://msdn.microsoft.com/en-us/library/windows/desktop/ms632680%28v=vs.85%29.aspx) is a monster taking twelve (12) parameters, some of which must first be registered using other calls. There *is* a reason most people don't try to do this in assembly! – Bo Persson Aug 24 '12 at 10:03