Sign in to follow this  
Followers 0
4ggr35510n

Gui Appearing And Menus Icons - Easy Questions

7 posts in this topic

#1 ·  Posted (edited)

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

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

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:


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 

Share this post


Link to post
Share on other sites

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


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______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

 

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

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

Share this post


Link to post
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:


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 

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

_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

Share this post


Link to post
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:


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 

Share this post


Link to post
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
Sign in to follow this  
Followers 0