Jump to content

Solitary Menu


Recommended Posts

I am still very new to AutoIt and I have not scripted with it in a while so forgive me if this is a stupid question:

How can I create a solitary menu that can be opened anywhere on the screen?

I have searched the help file,the forum, and the UDFs but all I can find are functions to create a menu/context menu attached to a GUI.

Is there anyway to create a stand alone menu without being attached to a GUI?

Link to comment
Share on other sites

Yellow there!!

What is exactly your needs ?

A menu is always attached to a window anyway !!!

Are you looking for something like this :

#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>
#Include <GuiMenu.au3>

Global Enum $idNew = 1000

Local $hGui = GUICreate("Yellow!",100,20,100,100,-1,BitOR($WS_EX_TOOLWINDOW,$WS_EX_TOPMOST))
GUISetOnEvent($GUI_EVENT_CLOSE,"_Quit")

Local $hFile = _GUICtrlMenu_CreateMenu()
_GUICtrlMenu_InsertMenuItem ($hFile, 0, "&New", $idNew)

; Create Main menu
Local $hMain = _GUICtrlMenu_CreateMenu ()
_GUICtrlMenu_InsertMenuItem ($hMain, 0, "&File", 0, $hFile)

; Set window menu
 _GUICtrlMenu_SetMenu ($hGUI, $hMain)

GUISetState()
Opt("GuiOnEventMode",1)

While 1

    Sleep(10)
WEnd

Func _Quit()
    Exit
EndFunc

Well,

Good luck !!!

Link to comment
Share on other sites

Yellow there!!

What is exactly your needs ?

A menu is always attached to a window anyway !!!

Are you looking for something like this :

#include <GuiConstantsEx.au3>
#include <WindowsConstants.au3>
#Include <GuiMenu.au3>

Global Enum $idNew = 1000

Local $hGui = GUICreate("Yellow!",100,20,100,100,-1,BitOR($WS_EX_TOOLWINDOW,$WS_EX_TOPMOST))
GUISetOnEvent($GUI_EVENT_CLOSE,"_Quit")

Local $hFile = _GUICtrlMenu_CreateMenu()
_GUICtrlMenu_InsertMenuItem ($hFile, 0, "&New", $idNew)

; Create Main menu
Local $hMain = _GUICtrlMenu_CreateMenu ()
_GUICtrlMenu_InsertMenuItem ($hMain, 0, "&File", 0, $hFile)

; Set window menu
 _GUICtrlMenu_SetMenu ($hGUI, $hMain)

GUISetState()
Opt("GuiOnEventMode",1)

While 1

    Sleep(10)
WEnd

Func _Quit()
    Exit
EndFunc

Well,

Good luck !!!

Thanks.

This is still attached to a GUI though. I am looking for a way to create a free floating menu like in this app: http://www.autohotkey.net/~rexx/FolderMenu/index.en.htm

Just check out some screen shots.

Any possible way in AutoIt?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...