Jump to content

Gui Appearing And Menus Icons - Easy Questions


Recommended Posts

Hi all!

Im asking for ur knowledge and mercyful guidance:

Using $WS_EX_TOOLWINDOW I can create not-appearing-in-task-bar window.

My three little, easy question about that:

1. Is it possible to create normal title-style window that not appears in task bar? (toolwindow causes smaller title font, no mini/maximizeboxes which is really unwanted by me)

2. Toolwindow also causes not appearing window in alt+tab dialog box. Can I create window that not appears in task bar, but appear in alt+tab box? (or vice versa)

And about menu-icons:

3. How can I create picture(jpg?png?bmp?) Icons next to MenuItems in MainMenu and ContextMenu?

I'll really appreciate ur help!

Regards,

4gre5510n

Edited by 4ggr35510n
Link to comment
Share on other sites

1. Is it possible to create normal title-style window that not appears in task bar? (toolwindow causes smaller title font, no mini/maximizeboxes which is really unwanted by me)

2. Toolwindow also causes not appearing window in alt+tab dialog box. Can I create window that not appears in task bar, but appear in alt+tab box? (or vice versa)

1. Yes, but you will have to create a hidden window first and display your actual GUI as child dialog (s. example below).

2. Yes - exactly like 1.

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Global $main = GUICreate("Main")
GUICreate("Actual GUI", 640, 580, (@DesktopWidth - 640) / 2, (@DesktopHeight - 580) / 2, BitOR($WS_OVERLAPPEDWINDOW, $WS_CAPTION, $WS_DLGFRAME), 0, $main)
GUISetState()       ;Show GUI
While 1
    $msg = GUIGetMsg()

    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
    EndSelect
    
WEnd

GUIDelete()

And about menu-icons:

3. How can I create picture(jpg?png?bmp?) Icons next to MenuItems in MainMenu and ContextMenu?

Take a look at _GUICtrlMenu_SetItemBmp() from GuiMenu.au3 (standard UDF) and corresponding help topic (it shows a code sample). Edited by doudou

UDFS & Apps:

Spoiler

DDEML.au3 - DDE Client + Server
Localization.au3 - localize your scripts
TLI.au3 - type information on COM objects (TLBINF emulation)
TLBAutoEnum.au3 - auto-import of COM constants (enums)
AU3Automation - export AU3 scripts via COM interfaces
TypeLibInspector - OleView was yesterday

Coder's last words before final release: WE APOLOGIZE FOR INCONVENIENCEĀ 

Link to comment
Share on other sites

  • Moderators

4ggr35510n (and doudou),

You can also use the ever-present, but hidden, AutoIt window as the parent: :blink:

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

GUICreate("Actual GUI", 640, 580, Default, Default, BitOR($WS_OVERLAPPEDWINDOW, $WS_CAPTION, $WS_DLGFRAME), 0, WinGetHandle(AutoItWinGetTitle()))
GUISetState()       ;Show GUI
While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch
WEnd

Also note that if you use the Default keyword for the location coordinates, your GUI is automatically centred with no need to do any calculations. ;)

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.pngĀ AnyĀ of myĀ own codeĀ posted anywhere on the forumĀ isĀ available for use by others without any restrictionĀ of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSortĀ ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- AĀ highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort,Ā edit and colourĀ ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

Ā 

Link to comment
Share on other sites

Thanks guys soo much! ;*

But I have two more questions ;]

1 and 2:

Child window doesn't appear in taskbar, but do appear in alt+tab dialog box - how should I create it to not appear there too?

And:

When I set Always-On-Top attribute to parent window, child window is also created with that attribute, same happens when I'm trying to delete this attribute from one, child/parent also looses it.

Is there any way to set Always-On-Top atttribute to parent/child independently from parents/childs always-on-top attribute?

3:

How can I create bitmap from file, that I could later append to menuitem? I found fuction _GDIPlus_BitmapCreateFromFile but handle that function returns doesn't work neither with _GUICtrlMenu_SetItemBmp or _GUICtrlMenu_SetItemBitmaps :/

What should I do to make it work?

Edited by 4ggr35510n
Link to comment
Share on other sites

Child window doesn't appear in taskbar, but do appear in alt+tab dialog box - how should I create it to not appear there too?

You may succeed if you play around with different window style bits. However, I don't think it is possible for windows other than WS_EX_TOOLwindow.

When I set Always-On-Top attribute to parent window, child window is also created with that attribute, same happens when I'm trying to delete this attribute from one, child/parent also looses it.

Is there any way to set Always-On-Top atttribute to parent/child independently from parents/childs always-on-top attribute?

No. Child windows are ordered in the window hierarchy automatically on top of their parents.

How can I create bitmap from file, that I could later append to menuitem? I found fuction _GDIPlus_BitmapCreateFromFile but handle that function returns doesn't work neither with _GUICtrlMenu_SetItemBmp or _GUICtrlMenu_SetItemBitmaps :/

What should I do to make it work?

_GDIPlus_BitmapCreateFromFile() returns GDI+ bitmap object, what you need is HBITMAP handle, so you'll have to apply _GDIPlus_BitmapCreateHBITMAPFromBitmap() on it (the bitmap object) before calling GDI or GUI functions.

UDFS & Apps:

Spoiler

DDEML.au3 - DDE Client + Server
Localization.au3 - localize your scripts
TLI.au3 - type information on COM objects (TLBINF emulation)
TLBAutoEnum.au3 - auto-import of COM constants (enums)
AU3Automation - export AU3 scripts via COM interfaces
TypeLibInspector - OleView was yesterday

Coder's last words before final release: WE APOLOGIZE FOR INCONVENIENCEĀ 

Link to comment
Share on other sites

_GDIPlus_BitmapCreateFromFile() returns GDI+ bitmap object, what you need is HBITMAP handle, so you'll have to apply _GDIPlus_BitmapCreateHBITMAPFromBitmap() on it (the bitmap object) before calling GDI or GUI functions.

Gr8, works, thank you!

but...

by default those icons are really small... Is there any way to enlarge them?

Edited by 4ggr35510n
Link to comment
Share on other sites

Gr8, works, thank you!

Pleasure.

by default those icons are really small... Is there any way to enlarge them?

Everything displayed in a menu item is limited by its height (which is controlled globally by Windows visual styles), customizing it further will require owner-drawn menu. It is a bit to complex to construct an example from scratch, for the moment I can only suggest searching the forum and the Web for "menu owner draw".

UDFS & Apps:

Spoiler

DDEML.au3 - DDE Client + Server
Localization.au3 - localize your scripts
TLI.au3 - type information on COM objects (TLBINF emulation)
TLBAutoEnum.au3 - auto-import of COM constants (enums)
AU3Automation - export AU3 scripts via COM interfaces
TypeLibInspector - OleView was yesterday

Coder's last words before final release: WE APOLOGIZE FOR INCONVENIENCEĀ 

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...