Sign in to follow this  
Followers 0
xin

how to make this window

10 posts in this topic

only colse button and no icon on title, how can i do that.

use $WS_SYSMENU, i can get only close button but with icon, and use $WS_EX_TOOLWINDOW i get window without icon but also without close button. how can i make without icon and only with close button?

thx!

Share this post


Link to post
Share on other sites



I don't know how to create such a window in AutoIt but I have tried to remove the icon as described at msdn. Unfortunately it did not work, I probably goofed at some point. The SendMessage call is suposed to returne a handel to the icon in question but mine did not :)

Maybee the code will give you ore someone else a idea?

#include <GuiConstants.au3>
HotKeySet("ESC", "Terminate")
Local $form = GUICreate("", 200, 200,-1,-1,BitOr($WS_EX_DLGMODALFRAME ,$WS_SYSMENU))
Local $statuslabel = GUICtrlCreateLabel ("Ready",10,180,175,23,BitOr($SS_SIMPLE,$SS_SUNKEN))
GUISetState(@SW_SHOW)
; Remove Icons according to : http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/windows/windowreference/windowmessages/wm_seticon.asp
local $ICON_SMALL = 0 
Local $ICON_BIG = 1
Local $WM_SETICON = 128
Local $foo
$foo = dllcall ("user32.dll","int", "SendMessage", "hwnd", WinGetHandle($form), "int", $WM_SETICON, "int", $ICON_SMALL, "int", 0)
; NOTE: I dont get a handel to the icon suposed to be removed so I probably have done something wrong?
ConsoleWrite("ERROR?:" & ErrStrDllCall(@error) & " : IconHandel:=" & $foo & @LF)

$foo = dllcall ("user32.dll","int", "SendMessage", "hwnd", WinGetHandle($form), "int", $WM_SETICON, "int", $ICON_BIG, "int", 0)
ConsoleWrite("ERROR?:" & ErrStrDllCall(@error) & " : IconHandel:=" & $foo & @LF)

While GUIGetMsg() <> - 3
WEnd
Exit
; === Functions
Func Terminate()
   Exit
EndFunc
Func ErrStrDllCall($err, $LogFunction="", $preMsg = "")
   Local $ret
   Switch @error
      case 0
         Return 
      case 1 
         $ret = 'unable to use the DLL file '
      Case 2 
         $ret = 'unknown return type'
      Case 3 
         $ret = '"function" not found in the DLL file. ' 
   EndSwitch
   If $LogFunction <> "" Then 
      Call($LogFunction, $preMsg & ": " & $ret)
   EndIf
   Return $ret
EndFunc

Share this post


Link to post
Share on other sites

Try

#include <GUIConstants.au3>
; == GUI generated with Koda ==);
$Form1 = GUICreate("Shut Down Windows", 622, 449, 192, 125, BitOR($WS_SYSMENU,$WS_CAPTION,$WS_POPUPWINDOW,$WS_BORDER,$WS_CLIPSIBLINGS), BitOR($WS_EX_APPWINDOW,$WS_EX_TOOLWINDOW,$WS_EX_WINDOWEDGE))
GUISetState(@SW_SHOW)
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case Else
    ;;;;;;;
    EndSelect
WEnd


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

Not to criticize your efforts @BigDod but isn't that the same as @xin told us he already could do?

$Form1 = GUICreate("Shut Down Windows", 622, 449, 192, 125, -1, $WS_EX_TOOLWINDOW)

I think he wants the BIG X button, and not the tiny one :)

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Not to criticize your efforts @BigDod but isn't that the same as @xin told us he already could do?

$Form1 = GUICreate("Shut Down Windows", 622, 449, 192, 125, -1, $WS_EX_TOOLWINDOW)

I think he wants the BIG X button, and not the tiny one :)

He said that he did not get a cross. Edited by BigDod


Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

He said that he did not get a cross.

thx for all answers. i want really the big cross. is that possible?

Share this post


Link to post
Share on other sites

Here is a rough idea to get you started

#include <GUIConstants.au3>
; == GUI generated with Koda ==);
$Form1 = GUICreate("AForm1", 622, 424, 192, 125, BitOR($WS_SYSMENU,$WS_POPUPWINDOW,$WS_BORDER,$DS_MODALFRAME), 0)
$Button1 = GUICtrlCreateButton("X", 592, 9, 22, 22, 0)
GUICtrlSetFont(-1, 10, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0xFFFFFF)
$Graphic1 = GUICtrlCreateGraphic(0, 0, 625, 41)
GUICtrlSetColor(-1, 0xECE9D8)
GUICtrlSetBkColor(-1, 0x0054E3)
GUICtrlSetState(-1, $GUI_DISABLE)
GUISetState(@SW_SHOW)
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $Button1
        ExitLoop
    Case Else
    ;;;;;;;
    EndSelect
WEnd

If you want round corners there is something in Scripts and Scraps somewhere (if I remember correctly)



Get Beta versions Here Get latest SciTE editor Here AutoIt 1-2-3 by Valuater - A great starting point.

Time you enjoyed wasting is not wasted time ......T.S. Elliot
Suspense is worse than disappointment................Robert Burns
God help the man who won't help himself, because no-one else will...........My Grandmother

Share this post


Link to post
Share on other sites

Look in the 'AutoIt Wrappers' post. You can find the round-corners script near the end, on page 4. BigDod actually linked it, look for his avatar.


Ha, I haven't been on these forums since... 2006, almost. Behold, my legacy signature:My AutoIt idol is Valuater. You know you love him, too.My Stuff: D&D AGoT Tools Suite

Share this post


Link to post
Share on other sites

What i want to know is how i can insert my program on the button of start > shutdown.

For an example:

If you press start > shutdown

Windows will start some program of microsoft wich displays the shutdown window.

What i want to do is adjust the path to my program, so i can write a advanced shutdown program.

Anyone knows where i can change it or if its even possible?

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

there is a script to "notify of shutdown" in the Autoit Wrappers also

8)

in my sig below

title = terminate a script right before a user shuts

page 4

Edited by Valuater

NEWHeader1.png

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