flat assembler
Message board for the users of flat assembler.

Index > Windows > Making a basic dialog start Maximized and be resizable

Author
Thread Post new topic Reply to topic
calpol2004



Joined: 16 Dec 2004
Posts: 110
calpol2004
A pretty simple question, How do i make the dialog shown below start maximized and be resizable? I can't seem to find a WS_SOMETHING for when i state the size of the dialog in the resource section for either of these. I think i might have to use SendMessage() with something in the WM_INITDIALOG section telling the dialog be maximized before its shown but im not sure. I haven't done any Windows programming for a while now so i'm having to learn it all again Confused. If someone could just point me in the right direction here that would be great.

Code:
format PE GUI 4.0
entry start
include '../../INCLUDE/win32a.inc'

section '.data' data readable writeable
        flags dd ?
;end of .data

section '.code' code readable executable
  start:
        invoke  GetModuleHandle,0
        invoke  DialogBoxParam,eax,37,HWND_DESKTOP,DialogProc,0
        or      eax,eax
        jz      exit
  exit:
        invoke  ExitProcess,0
;end of .code

proc DialogProc hwnddlg,msg,wparam,lparam
push    ebx esi edi
cmp     [msg],WM_INITDIALOG
je      wminitdialog
cmp     [msg],WM_COMMAND
je      wmcommand
cmp     [msg],WM_CLOSE
je      wmclose
xor     eax,eax
jmp     finish
        wminitdialog:
                jmp     processed
        wmcommand:
                jmp     processed
        wmclose:
                invoke  EndDialog,[hwnddlg],0
        processed:
                mov     eax,1
        finish:
                pop     edi esi ebx
                ret
endp
;end of dialog procedure

section '.idata' import data readable writeable
library kernel,'KERNEL32.DLL',user,'USER32.DLL'
import kernel,GetModuleHandle,'GetModuleHandleA',ExitProcess,'ExitProcess'
import user,DialogBoxParam,'DialogBoxParamA',EndDialog,'EndDialog'
;function imports from WINAPI

section '.rsrc' resource data readable
directory RT_DIALOG,dialogs
resource dialogs,37,LANG_ENGLISH+SUBLANG_DEFAULT,maindialog
dialog maindialog,'Dialog Box',130,50,600,500,WS_CAPTION+WS_POPUP+WS_SYSMENU+WS_MAXIMIZEBOX+WS_MINIMIZEBOX
enddialog
;End of Resource Data
    
Post 17 Jul 2007, 15:43
View user's profile Send private message MSN Messenger Reply with quote
Yardman



Joined: 12 Apr 2005
Posts: 245
Location: US
Yardman
[ Post removed by author. ]


Last edited by Yardman on 04 Apr 2012, 02:43; edited 1 time in total
Post 18 Jul 2007, 18:44
View user's profile Send private message Reply with quote
calpol2004



Joined: 16 Dec 2004
Posts: 110
calpol2004
Thanks, works fine now Very Happy.
Post 18 Jul 2007, 18:53
View user's profile Send private message MSN Messenger Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.