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 


Add bitmaps to Menu items; Menu check/uncheck !!
Goto page Previous  1, 2
 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Advanced VDS 5 Source Code
View previous topic :: View next topic  
Author Message
X-Tools
Valued Contributor
Valued Contributor


Joined: 20 Sep 2001
Posts: 296
Location: Germany

PostPosted: Thu Aug 21, 2003 8:37 am    Post subject: Reply with quote

Hi mindpower,

can you explain me a little bit more ?
I tried the following code:

Code:

 LOADLIB user32.dll
  %%menuBar = @lib(user32.dll,GetMenu,INT:,@strdel(@winexists(#PI),1,1))
 
  %%dateiMenu = @lib(user32.dll,GetSubMenu,INT:,%%menubar,0)
  %%einstellungenMENU = @lib(user32.dll,GetSubMenu,INT:,%%menubar,7)
  %%dummy = @lib(user32.dll,RemoveMenu,BOOL:,%%menuBar,7,MF_BYPOSITION)
  info %%einstellungenMENU@cr()%%dummy
  %%dummy = @lib(user32.dll,DrawMenuBar,BOOL:,%%menuBar)


The Menu Number 7 should be removed, but it does not.
Do you know where my mistake is ?

Thank you very much.

Bye, Fabian
Back to top
View user's profile Send private message Send e-mail Visit poster's website
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Thu Aug 21, 2003 2:13 pm    Post subject: Reply with quote

Hi X-Tools,
I didn't know that VDS would reconize a constant directly like this? MF_BYPOSITION should be a variable that is defined with a numeric value.

The value for MF_BYPOSITION should be the number 0...

Also the @lib() function just needs the name of the DLL with out the Extension.

Also if these changes do not work then prefix the variable type for the arguments of the functions like so...
Code:
%%MF_BYPOSITION = $400
%%dummy = @lib(user32,RemoveMenu,BOOL:,%%menuBar,INT:7,INT:%%MF_BYPOSITION)

_________________
Home of

Give VDS a new purpose!


Last edited by vdsalchemist on Fri Aug 22, 2003 12:41 pm; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
X-Tools
Valued Contributor
Valued Contributor


Joined: 20 Sep 2001
Posts: 296
Location: Germany

PostPosted: Thu Aug 21, 2003 3:29 pm    Post subject: Reply with quote

Hi,

thanks for your answer.

But the help file says:

Code:
BOOL RemoveMenu(

    HMENU  hmenu,   // handle of menu
    UINT  uItem,   // menu item identifier or position
    UINT  fuFlags   // menu item flag
   );   
Parameters

hmenu

Identifies the menu to be changed.

uItem

Specifies the menu item to be deleted, as determined by the fuFlags parameter.

fuFlags

Specifies how the uItem parameter is interpreted. This parameter must be one of the following values:

Value   Meaning
MF_BYCOMMAND   Indicates that uItem gives the identifier of the menu item. If neither the MF_BYCOMMAND nor MF_BYPOSITION flag is specified, the MF_BYCOMMAND flag is the default flag.
MF_BYPOSITION   Indicates that uItem gives the zero-based relative position of the menu item.


So I thought MF_BYCOMMAND and MF_BYPOSITION are parameters.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
CodeScript
Moderator Team


Joined: 08 Jun 2003
Posts: 1060
Location: India

PostPosted: Fri Aug 22, 2003 3:48 am    Post subject: Reply with quote

X-Tools wrote:
But the help file says:


I think you are refering only W32.Hlp file. It gives you constants in the form of MF_BYPOSITION etc, It's fine if You are in Delphi/C/C++ as the values for these are already defined there in the header(.h or .hpp) files. But in languages like VB and VDS
you have to feed the constant values yourself.
W32.hlp doesn't have it.
So you have to look for alternatives :
Windows header files from C++/delphi (.pas ?)
API text viewer that comes with VB.
API viewers and similar references written by 3rd parties
E.g. API Viewer 2003. (I recommend it; as I hardly failed to find a declare/constant in that).

As for deleting a menu I thought it would be too simple and removed it in the final version I posted Sad.
As far as I remember I posted a script that "deletes items from the system menu" and disables close button.

Regards

_________________
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
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Fri Feb 11, 2005 6:40 pm    Post subject: Reply with quote

Skit,

Even after writing SSMenu.Dll I found that I ran into instances where I
needed to load a menu's description from a text file. There is a way to
go about this while using only 3 variables. You say that %1 aND %2 are
used already, so %3 could be used like %%string is here.

Code:

  list create,1
  list loadtext,1
"Item 1
"Item 2
"Item 3
"Item 4
"Item 5
"Item 6
"Item 7
"Item 8
"Item 9

  %x = 0
  %%string =
  repeat
    %I = @item(1,%x)
    if @not(@null(%I))
      %%string = %%string%I@chr(0)
    end
    %x = @succ(%x)
  until @equal(%x,@count(1))

  dialog create,Dialog,-1,0,300,200
  dialog add,MENU,&File,%%string
  dialog show

:Evloop
  wait event
  %E = @event()
  if @equal(%E,CLOSE)
    goto %E
  end
  goto Evloop

:CLOSE
  exit

_________________
Bill Weckel
ShinobiSoft Software

"The way is known to all, but not all know it."
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Advanced VDS 5 Source Code All times are GMT
Goto page Previous  1, 2
Page 2 of 2

 
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