Jump to content
Sign in to follow this  
Yashied

Title without icon

Recommended Posts

Yashied
AdmiralAlkex

Here, no icon

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

GUICreate("Test", 200, 100, -1, -1, $WS_CAPTION)
GUISetState()

Do
    Sleep(20)
Until GUIGetMsg() = $GUI_EVENT_CLOSE

Share this post


Link to post
Share on other sites
GEOSoft

Here, no icon

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

GUICreate("Test", 200, 100, -1, -1, $WS_CAPTION)
GUISetState()

Do
    Sleep(20)
Until GUIGetMsg() = $GUI_EVENT_CLOSE
I think he just wants to remove the icon and not the buttons.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites
GEOSoft

Use

GUISetIcon("shell32.dll", 50)
to replace the icon with a blank one.

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites
Yashied

Here, no icon

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

GUICreate("Test", 200, 100, -1, -1, $WS_CAPTION)
GUISetState()

Do
    Sleep(20)
Until GUIGetMsg() = $GUI_EVENT_CLOSE
Thanks for the reply, but please go back button. :unsure:

Use

GUISetIcon("shell32.dll", 50)
to replace the icon with a blank one.
Thanks, but this is not a good example. :D

Who has more ideas, please share them.

:P

Edited by Yashied

Share this post


Link to post
Share on other sites
AdmiralAlkex

Thanks for the reply, but please go back button. :unsure:

Thanks, but this is not a good example. :D

Who has more ideas, please share them.

:P

Could you show us a screenshot of a gui that looks like you want? Then it would be easier to know what you really need. Edited by AdmiralAlkex

Share this post


Link to post
Share on other sites
Yashied

Share this post


Link to post
Share on other sites
Poncho

Is this the MainGUI? If yes, think its not possible to set no Icon.

If its a GUI in GUI or however u wanna call it (yea iam a newb) use:

$2ndGUI = GUICreate("", 208, 370, $WS_SYSMENU, $WS_EX_TOOLWINDOW)

Share this post


Link to post
Share on other sites
Yashied

Is this the MainGUI? If yes, think its not possible to set no Icon.

If its a GUI in GUI or however u wanna call it (yea iam a newb) use:

$2ndGUI = GUICreate("", 208, 370, $WS_SYSMENU, $WS_EX_TOOLWINDOW)
Thank you for your answer, but you do not carefully read the topic. I wrote at the beginning that the GUI should not include $WS_EX_TOOLWINDOW. I agree that the window was a children, but not $WS_EX_TOOLWINDOW. For proof that this is possible look at the standard Run dialog in Windows.

Maybe try to use the WinAPI. I look forward to your responses.

:P

Edited by Yashied

Share this post


Link to post
Share on other sites
martin

Thank you for your answer, but you do not carefully read the topic. I wrote at the beginning that the GUI should not include $WS_EX_TOOLWINDOW. I agree that the window was a children, but not $WS_EX_TOOLWINDOW. For proof that this is possible look at the standard Run dialog in Windows.

Maybe try to use the WinAPI. I look forward to your responses.

:P

But how do you know that "Run" is not just an icon?

EDIT: well it obviously isn't so you can ignore that.

Edited by martin

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites
GEOSoft

Here are the styles for the Run Dialog as shown in Resource Hacker.

DS_FIXEDSYS | DS_MODALFRAME | DS_NOIDLEMSG | DS_CONTEXTHELP | WS_POPUP | WS_CAPTION | WS_SYSMENU

You will have to figure out the values for a couple of the constants.


George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites
GEOSoft

As I pointed out in my first reply, setting the GUI icon to a blank icon does the trick. I used icon index 50 because I know that is a blank in XP. If you are using Vista then you may have to check for a different index.

The following does what you asked with the exception that the text in the title bar appears indented because of the blank icon.

#include <WindowsConstants.au3>
GUICreate('Test', 380, 400, -1, -1, BitOr($WS_POPUP, $WS_CAPTION,$WS_SYSMENU))
GUISetIcon("shell32.dll", -50)
GUISetState()

do
until GUIGetMsg() = -3

George

Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.

Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.***

The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number.

Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else.

"Old age and treachery will always overcome youth and skill!"

Share this post


Link to post
Share on other sites
James

This might be more useful:

$frmAbout = GUICreate("", 255, 234, -1, -1, 0x94C800C4)
GUISetIcon("shell32.dll", 50)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case -3
            Exit
    EndSwitch
WEnd

No need for includes.

Edited by JamesBrooks

Share this post


Link to post
Share on other sites
martin

This might be more useful:

$frmAbout = GUICreate("", 255, 234, -1, -1, 0x94C800C4)
   GUISetIcon("shell32.dll", 50)
   GUISetState(@SW_SHOW)
   
   While 1
       $nMsg = GUIGetMsg()
       Switch $nMsg
           Case -3
               Exit
       EndSwitch
   WEnd

No need for includes.

Seems to be an echo in here.:P Seems to be an echo in here.:unsure:

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites
martin

Weird echo! My example doesn't use any includes :P

Ok, that's true, but I just thought that the technique of using a blank icon was what the post was really about and in that case GEOSoft has mentioned that more than once in this thread.

No offense intended.


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites
James

Ok, that's true, but I just thought that the technique of using a blank icon was what the post was really about and in that case GEOSoft has mentioned that more than once in this thread.

No offense intended.

No offense taken. I just added to Geo's code :P

Share this post


Link to post
Share on other sites
CodyBarrett

i personaly think that toolwindow looks cool... but GUISETICON() will work also... lol and if you dont want that use WS_CAPTION and use a menuitem for the EXIT and minimize and maximize and reestore buttons...

Share this post


Link to post
Share on other sites
rover

Prompt me please, how to create a GUI has no icon in the title? The GUI should not be $WS_EX_TOOLWINDOW.

@Yashied

a bit of advice.

you don't ask for promptness from random forum users volunteering their time to answer questions.

another method to set a blank GUI icon

GUISetIcon(@AutoItExe, -2) ; -2 is AutoIt blank icon

and to remove the icon...

#include <GUIConstantsEX.au3>
#include <Constants.au3>
#include <WindowsConstants.au3>

Global $GCL_HICONSM = -34
Global $GCL_HICON = -14

;$hGUI = GUICreate("No Icon", 300, 200, -1, -1, -1, $WS_EX_DLGMODALFRAME)
$hGUI = GUICreate("No Icon", 300, 200, -1, -1, BitOR($WS_CAPTION, $WS_SYSMENU), $WS_EX_DLGMODALFRAME)

$hIcon = GetClassLong($hGUI, $GCL_HICON)
DllCall("User32.dll", "int", "DestroyIcon", "hwnd", $hIcon)
SetClassLong($hGUI, $GCL_HICON, 0)
SetClassLong($hGUI, $GCL_HICONSM, 0)
GUISetState()

Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE

Func GetClassLong($hWnd, $nIndex)
    Local $hResult = DllCall("user32.dll", "dword", "GetClassLong", "hwnd", $hWnd, "int", $nIndex)
    Return $hResult[0]
EndFunc

Func SetClassLong($hWnd, $nIndex, $dwNewLong)
    Local $hResult = DllCall("user32.dll", "dword", "SetClassLong", "hwnd", $hWnd, "int", $nIndex, "long", $dwNewLong)
    Return $hResult[0]
EndFunc

I see fascists...

Share this post


Link to post
Share on other sites
martin

@Yashied

a bit of advice.

you don't ask for promptness from random forum users volunteering their time to answer questions.

another method to set a blank GUI icon

GUISetIcon(@AutoItExe, -2) ; -2 is AutoIt blank icon

and to remove the icon...

#include <GUIConstantsEX.au3>
#include <Constants.au3>
#include <WindowsConstants.au3>

Global $GCL_HICONSM = -34
Global $GCL_HICON = -14

;$hGUI = GUICreate("No Icon", 300, 200, -1, -1, -1, $WS_EX_DLGMODALFRAME)
$hGUI = GUICreate("No Icon", 300, 200, -1, -1, BitOR($WS_CAPTION, $WS_SYSMENU), $WS_EX_DLGMODALFRAME)

$hIcon = GetClassLong($hGUI, $GCL_HICON)
DllCall("User32.dll", "int", "DestroyIcon", "hwnd", $hIcon)
SetClassLong($hGUI, $GCL_HICON, 0)
SetClassLong($hGUI, $GCL_HICONSM, 0)
GUISetState()

Do
Until GUIGetMsg() = $GUI_EVENT_CLOSE

Func GetClassLong($hWnd, $nIndex)
    Local $hResult = DllCall("user32.dll", "dword", "GetClassLong", "hwnd", $hWnd, "int", $nIndex)
    Return $hResult[0]
EndFunc

Func SetClassLong($hWnd, $nIndex, $dwNewLong)
    Local $hResult = DllCall("user32.dll", "dword", "SetClassLong", "hwnd", $hWnd, "int", $nIndex, "long", $dwNewLong)
    Return $hResult[0]
EndFunc
Excellent example rover, thanks.

In Yashied's defence, I think his use of the word "prompt" was an an interpretation of "advise" and not a request to be quick.


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

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  

×