flat assembler
Message board for the users of flat assembler.

Index > Windows > A couple of questions

Author
Thread Post new topic Reply to topic
windwakr



Joined: 30 Jun 2004
Posts: 827
windwakr 09 Jul 2004, 16:31
1. How do you put a custom icon in a message box?

2. how do you check,grey,or put a custom image in a menu?

well, thats all my questions for now.

Thanks

_________________
----> * <---- My star, won HERE
Post 09 Jul 2004, 16:31
View user's profile Send private message Reply with quote
roticv



Joined: 19 Jun 2003
Posts: 374
Location: Singapore
roticv 09 Jul 2004, 16:45
1) I doubt that is possible.
2) EnableMenuItem IIRC
Post 09 Jul 2004, 16:45
View user's profile Send private message Visit poster's website MSN Messenger Reply with quote
JohnFound



Joined: 16 Jun 2003
Posts: 3499
Location: Bulgaria
JohnFound 09 Jul 2004, 19:06
windwakr wrote:
2. how do you check,grey,or put a custom image in a menu?


For really fancy menues with normal/disabled icons, custom check mark, etc. you have to use ownerdraw menus. Check Fresh's library "gui.asm". You can see how this looks in Fresh itself. ( Fresh download page )

Regards.
Post 09 Jul 2004, 19:06
View user's profile Send private message Visit poster's website ICQ Number Reply with quote
windwakr



Joined: 30 Jun 2004
Posts: 827
windwakr 09 Jul 2004, 19:29
alright, ill check it out!

and to roticv, Ive seen it done before....in nsis(nullsoft installer)
Post 09 Jul 2004, 19:29
View user's profile Send private message Reply with quote
inskipp



Joined: 23 Jun 2003
Posts: 25
Location: Poland
inskipp 09 Jul 2004, 22:05
Check the MessageBoxIndirect funtion.
Post 09 Jul 2004, 22:05
View user's profile Send private message ICQ Number Reply with quote
windwakr



Joined: 30 Jun 2004
Posts: 827
windwakr 09 Jul 2004, 23:17
Thanks...but can I have an example of the parameters used in it? MSDN gives confusing things....
Post 09 Jul 2004, 23:17
View user's profile Send private message Reply with quote
inskipp



Joined: 23 Jun 2003
Posts: 25
Location: Poland
inskipp 10 Jul 2004, 22:09
Code:
format PE GUI 4.0
entry start
include '%fasminc%/win32a.inc'
IDI_ICON=101h
section '.code' code readable executable
start:
      mov     [MsgBoxParams.cbSize],sizeof.MSGBOXPARAMS
   invoke  GetModuleHandle,0
   mov     [MsgBoxParams.hInstance],eax
        mov     [MsgBoxParams.lpszText],szHelloWorld
        mov     [MsgBoxParams.lpszCaption],szHelloCaption
   mov     [MsgBoxParams.lpszIcon],IDI_ICON
    mov     [MsgBoxParams.dwStyle],MB_OK or MB_USERICON
 mov     [MsgBoxParams.dwLanguageId],LANG_NEUTRAL
    invoke  MessageBoxIndirect,MsgBoxParams
     invoke  ExitProcess,0
section '.data' data readable writeable

szHelloWorld  db 'Hello World',0
szHelloCaption  db 'MessageBox with Icon',0

MsgBoxParams       MSGBOXPARAMS

section '.idata' import data readable writeable

  library kernel32,'kernel32.dll',\
          user32,'user32.dll'
  import kernel32,\
         ExitProcess,'ExitProcess',\
         GetModuleHandle,'GetModuleHandleA'
  import user32,\
         MessageBoxIndirect,'MessageBoxIndirectA'

section '.rsrc' resource data readable
  directory RT_ICON,icons,\
         RT_GROUP_ICON,group_icons
  resource icons,\
           1h,LANG_NEUTRAL,icon_data
  resource group_icons,\
      IDI_ICON,LANG_NEUTRAL,main_icon
  icon main_icon,icon_data,'icon.ico'
    
Post 10 Jul 2004, 22:09
View user's profile Send private message ICQ Number Reply with quote
windwakr



Joined: 30 Jun 2004
Posts: 827
windwakr 10 Jul 2004, 22:44
THANKS!! Smile
Post 10 Jul 2004, 22:44
View user's profile Send private message 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-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.