Jump to content

New Button on the all other Windows Frames


 Share

Recommended Posts

Hi,

How can I put some new Key on all Windows Header-Frames on the right top side?

For example:

Standard Windows Keys are: " Min / Max / Close "

Is it posssibe to put some more Funktion in all Windows Frames " My_Key / Min / Max / Close " ?

How ?

I am nor familar with all function off AutoIt.

Thanks

Link to comment
Share on other sites

  • Moderators

To put buttons/etc.. on another GUI take a look at AnyGUI.au3

There are examples provided on how things work.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Thank you,

but I gues in my case the other windows are not creatted with AutoIt GUI funtions. Maybe I am wrong ???

For example:

You can open the nodepad editor window with AutoIt run command.

I can get the handle,name,.. of this nodepad window but

How can I put on this Notepad- Header- Frame a smal button like ( the program handcopy adds an icon as button in the header to do some print screen action.)

how can I put GuiAdd... functions in this MicroSoft Nodepad-Window ?

Thanks and all the Best Tom

Link to comment
Share on other sites

  • Moderators

If you actually look at the link? It has examples as I stated before.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

include-once

#include <GUIConstants.au3>

#include <ANYGUIv26.au3>

Opt("WinWaitDelay",100)

Opt("WinTitleMatchMode", 4)

Opt("WinDetectHiddenText",1)

Opt("MouseCoordMode",0)

Run('C:\WINNT\system32\calc.exe')

WinWait("Calculator","")

If Not WinActive("Calculator","") Then WinActivate("Calculator","")

WinWaitActive("Calculator","")

; I am to stubit to get it work. I need Help !!!!

; Can you please put some Code that I can understand

; For Example:

; Hide the Help Menu Entry ( in the Calculator Window )

; Hide the {M+} Buttun ( in the Calculator Window )

; Put a new Button in ( in the Calculator Window )

;

; But:

; How can I put some Buttons in the std.Window Frame before the Symbols/Buttons comes "_", "-", "x",

on the right top Window-Frame ( behind the Window Title "Calculator" )

Link to comment
Share on other sites

  • Moderators

; I am to stubit to get it work. I need Help !!!!

If that means you are too "stupid" to understand... that doesn't seem very appealing to put up code to show you how to do it exactly. My suggestion is to work with the examples that are there first (The notepad one) and understand what each function is doing... then and only then attempt to do something else... someone just writing the code for you isn't going to help you learn.

There is a script that uses AnyGUI.au3 in the scripts and scraps forum on the calculator, I'll see if I can find that to help, but I'm not going to write the script myself.

Edit:

Here is the example by Xenogis:

#include <guiconstants.au3>
#include "C:\Documents and Settings\Admin\Desktop\AU3_Files\ANYGUIv2.6.au3"
Run ( "calc" )
WinWait ( "Calculator" )
$Pos = WinGetPos ( "Calculator" )
WinMove ( "Calculator", '', (@DesktopWidth-$Pos[2])/2, (@DesktopHeight-$Pos[3])/2, $Pos[2] + 47, $Pos[3] )
_GuiTarget ( "Calculator", 1 )
$Quit = _TargetAddButton ( "Quit", $Pos[2]-10, 37, 50, 29 )
$Quit = $Quit[0]
GUISetState ( )
_TargetAddLabel ( "Notepad", $Pos[2]-10, 66, 50, 18 )
GUISetState ( )
_TargetAddEdit ( "", $Pos[2]-10, 84, 50, 115 )
GUISetState ( )
While 1
    $msg = GUIGetMsg ( )
    If $msg = $Quit Then Exit
    If Not WinExists ( "Calculator" ) Then Exit
WEnd

Func OnAutoItExit()
    ProcessClose ( "calc.exe" )
EndFunc
Look at how I had to define the AnyGUI.au3 in the #include file, that type of #include from someone new is generally an issue because they Never include it from the right directory. AnyGUI.au3 is not a file that comes standard with AutoIt, it must be downloaded from here. ANYGUIv2.6.au3

And put in the directory your going to be calling it from.

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

#include <guiconstants.au3>
#include "C:\Documents and Settings\Admin\Desktop\AU3_Files\ANYGUIv2.6.au3"
Run ( "calc" )
WinWait ( "Calculator" )
$Pos = WinGetPos ( "Calculator" )
WinMove ( "Calculator", '', (@DesktopWidth-$Pos[2])/2, (@DesktopHeight-$Pos[3])/2, $Pos[2] + 47, $Pos[3] )
_GuiTarget ( "Calculator", 1 )
$Quit = _TargetAddButton ( "Quit", $Pos[2]-10, 37, 50, 29 )
$Quit = $Quit[0]
GUISetState ( )
_TargetAddLabel ( "Notepad", $Pos[2]-10, 66, 50, 18 )
GUISetState ( )
_TargetAddEdit ( "", $Pos[2]-10, 84, 50, 115 )
GUISetState ( )
While 1
    $msg = GUIGetMsg ( )
    If $msg = $Quit Then Exit
    If Not WinExists ( "Calculator" ) Then Exit
WEnd

Func OnAutoItExit()
    ProcessClose ( "calc.exe" )
EndFunc

I was intersted in doing something with anyGUI, but i never got to deep in it, just a quick syntax question do you need the

"GUISetState()"s after each new control is added, just as a question because i think that lags me up

Link to comment
Share on other sites

Another nice example comes from quaiziwabbit :

#include "C:\Documents and Settings\Admin\Desktop\AU3_Files\ANYGUIv2.6.au3"
#include <guiconstants.au3>
Run("notepad.exe")
Sleep(1000)
WinSetState("Untitled - Notepad", "", @SW_MAXIMIZE)
$Targetwindow = _GuiTarget ("Untitled - Notepad", 1); mode 1 set so all '_Targetadd(s) go to this window
ControlMove($Targetwindow, "", 15, 0, 0, 800, 500);resize Edit1 control so everything fits
$btn1 = _TargetaddButton ( "Button1", 30, 550, 100, 50);
GUISetState(@SW_SHOW);
$btn2 = _TargetaddButton ( "Button2", 150, 550, 100, 50);
GUISetState(@SW_SHOW);
$Child = _TargetaddChild ("Test", 810, 0, 205, 500);
GUISetBkColor(0xff000);
$label1 = GUICtrlCreateLabel("Child Window", 60, 0, 100, 30)
$btn3 = GUICtrlCreateButton("Button3", 52, 35, 100, 50);
$grp1 = GUICtrlCreateGroup("Testing", 20, 90, 165, 200);
$radio1 = GUICtrlCreateRadio("A", 95, 120);
$radio2 = GUICtrlCreateRadio("B", 95, 180);
$radio3 = GUICtrlCreateRadio("C", 95, 240);
$Date = GUICtrlCreateDate("My Calender", 20, 300, 165, 180);
GUISetState(@SW_SHOW);
$tab = _TargetaddTab (300, 500, 715, 210);
$tab1 = GUICtrlCreateTabItem("First");
$tab2 = GUICtrlCreateTabItem("Second");
$tab3 = GUICtrlCreateTabItem("Third");
GUISetState(@SW_SHOW)
While WinExists($Targetwindow)
   $msg = GUIGetMsg(1)
   If $msg[0] = $GUI_EVENT_CLOSE Then Exit
   If Not WinExists($Targetwindow) Then Exit
   Sleep(50)
WEnd

But I think TOMTOM's problem is to get a button in the windows title bar and not inside the window.

I would also like to see how that is done ... :D

D2charkeeper = No more 'expired characters' in D2.File Date Changer = Change the file date(s), attributes and the filename case of multiple files @ once.Updater_full = Copy/Update your autoitscripts, pictures, .mp3, .avi etc ... subdirs from your PC to your memory stick or to your external harddisk. Now with scheduling and logging.Questmapper
Link to comment
Share on other sites

  • Moderators

just a quick syntax question do you need the "GUISetState()"s after each new control is added, just as a question

Yes

Edit:

But I think TOMTOM's problem is to get a button in the windows title bar and not inside the window.

I would also like to see how that is done ... :D

This had been discussed, but for the life of me, I can't remember who did it or what thread it was in or even if it were plausable :D.

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

This had been discussed, but for the life of me, I can't remember who did it or what thread it was in or even if it were plausable :D.

Is This the thread


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

Link to comment
Share on other sites

  • Moderators

Is This the thread

Yep :D ... Knew I had seen it, but I've slept once or twice since September.

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

tnx all

Edited by Gyzmok
D2charkeeper = No more 'expired characters' in D2.File Date Changer = Change the file date(s), attributes and the filename case of multiple files @ once.Updater_full = Copy/Update your autoitscripts, pictures, .mp3, .avi etc ... subdirs from your PC to your memory stick or to your external harddisk. Now with scheduling and logging.Questmapper
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...