forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Delete a menu item

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Advanced VDS 5 Source Code
View previous topic :: View next topic  
Author Message
FreezingFire
Admin Team


Joined: 23 Jun 2002
Posts: 3508

PostPosted: Mon Jul 21, 2003 5:47 pm    Post subject: Delete a menu item Reply with quote

In plain VDS you can't remove a menu item. I'm not sure if this has been
posted already but here's what I did with no help. It might not work all
the way and needs further work, but this is what I have Smile :

Code:
  DIALOG CREATE,New Dialog,-1,0,240,160,CLASS MenuDlgTest
  DIALOG ADD,MENU,MENU1,1,2,3,4,5,6,7,8,9
  DIALOG SHOW
  %%hwnd = @strdel(@winexists(#MenuDlgTest),1,1)
LOADLIB user32.dll
%A = @lib(user32,GetMenu,INT:,INT:%%hwnd)
%B = @lib(user32,DeleteMenu,BOOL:,INT:%A,INT:5,NIL:)
info Return Code: %B
FREELIB user32.dll
wait event
stop

_________________
FreezingFire
VDSWORLD.com
Site Admin Team
Back to top
View user's profile Send private message Visit poster's website
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1060
Location: India

PostPosted: Mon Jul 21, 2003 5:52 pm    Post subject: Reply with quote

You need to redraw the menu once to make sure that the menu is refreshed. refer to my setmenuitembitmaps example.
BTW i was thinking of adding menus to a different exe and responding to it Laughing

_________________
Regards
- CodeScript
Arrow Give your application a professional look with the VDSGUI Extension
Back to top
View user's profile Send private message Visit poster's website
Tommy
Admin Team


Joined: 16 Nov 2002
Posts: 746
Location: The Netherlands

PostPosted: Sun Jul 27, 2003 1:44 am    Post subject: Reply with quote

The redrawing should be easy though, just takes a single line:

Code:
%C = @lib(user32,DrawMenuBar,BOOL:,INT:%%hwnd)
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Advanced VDS 5 Source Code All times are GMT
Page 1 of 1

 
Jump to:  
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 can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group