Jump to content

GUI Questions


James
 Share

Recommended Posts

Removing title bar, try using the style $WS_POPUP. Note that this removes the close/minimize buttons too

To make only an input show up, you can use the $WS_EX_TRANSPARENT..,. im not to sure on it though, it would be easier to just make the input be the same size as the window and use the $WS_POPUP style, along with the $WS_EX_TOOLWINDOW which removes it from the taskbar as well

For the third question... I dont know... I dont think its possible to put one on the actual windows title bar, if thats what you mean. You can improvise this a few ways but you would need a system for moving it and stuff. Why would you want one in the title bar?

Link to comment
Share on other sites

Hmm.. Well I have this:

#include <GuiConstants.au3>

$DeskHeight = @DesktopHeight / 170
$DeskWidth = @DesktopWidth / 2 + 320

GuiCreate("Test", 100, 20, $DeskWidth, $DeskHeight, BitOR($WS_POPUP, $WS_EX_TOPMOST))
GUICtrlCreateInput("Search", -1, -1, 100, 20)
GuiSetState(@SW_SHOW)

While 1
    Sleep(100)
Wend

I dont know how to keep it on top all the time. And I cant make it stay in the same place on different resolutions. I need it to be near the buttons on the right of a window.

Link to comment
Share on other sites

Yes, I am trying to add it into BetaPad so that you can type help and it will bring up the help. I cant remove the taskbar icon. Not #NoTrayIcon

I have:

#include <GuiConstants.au3>
#NoTrayIcon

$DeskHeight = @DesktopHeight / 170
$DeskWidth = @DesktopWidth / 2 + 320

$sGUI = GuiCreate("Test", 100, 20, $DeskWidth, $DeskHeight, BitOR($WS_POPUP, $WS_EX_TRANSPARENT, $WS_EX_TOOLWINDOW))
$sInput = GUICtrlCreateInput("", -1, -1, 102, 22)

GuiSetState()

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $sInput
            $sRead = GuiCtrlRead($sInput)
            If $sRead = GuiCtrlRead("help") Then MsgBox(0, "Help", "You need help?")
            ;
            If $sRead = GuiCtrlRead("lol") Then MsgBox(0, "Lol?", "Why are you laughing?")
    EndSwitch
Wend

As a test.

What I need to do now is:

  • Make it fit on all resolutions
  • Answer to the correct word and not go through all of them
  • Embed into a main GUI
Secure
Link to comment
Share on other sites

Finally, I have made the GUI always on top but so you can still use your other applications.

#include <GuiConstants.au3>
#NoTrayIcon

$DeskHeight = @DesktopHeight / 170
$DeskWidth = @DesktopWidth / 2 + 320

$sGUI = GuiCreate("Test", 100, 20, $DeskWidth, $DeskHeight, BitOR($WS_POPUP, $WS_EX_TOPMOST),$WS_EX_TOOLWINDOW)
$sInput = GUICtrlCreateInput("", -1, -1, 102, 22)

GuiSetState()
WinSetOnTop($sGUI, "", 1)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $sInput
            $sRead = GuiCtrlRead($sInput)
            If $sRead = GuiCtrlRead("help") Then MsgBox(0, "Help", "You need help?")
            If $sRead = GuiCtrlRead("lol") Then MsgBox(0, "Lol?", "Why are you laughing?")
    EndSwitch
Wend

No I only need to do:

  • Auto-Adjust (So it places it self on the top right about 100px away from the, minimize, maximise and exit button.
  • Make the $sRead work. So you type in a command and it will do something.
Secure
Link to comment
Share on other sites

Ok, I have done the Input problem:

#include <GuiConstants.au3>
#NoTrayIcon

$sGUI = GuiCreate("WinBar App", 100, 20, 100, 100, BitOR($WS_POPUP, $WS_EX_TOPMOST),$WS_EX_TOOLWINDOW)
$sInput = GUICtrlCreateInput("", -1, -1, 102, 22)

GuiSetState()
WinSetOnTop($sGUI, "", 1)

While 1
    WinFix()
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $sInput
            $sRead = GuiCtrlRead($sInput)
            ToDo()
    EndSwitch
Wend

Func WinFix()
    If @DesktopHeight = 1024 Then WinMove($sGUI, "", @DesktopHeight / 170, @DesktopWidth / 2 + 320)
    EndFunc
    
Func ToDo()
    If $sRead = "help" Then MsgBox(0, "Help", "You need help?")
    If $sRead = "lol" Then MsgBox(0, "Lol?", "Why are you laughing")
EndFunc

Now I need the Auto Placement, but that is hard.

Edit: Minor spelling mistake.

Edited by Secure_ICT
Link to comment
Share on other sites

Just read your posts. Great job! That's exciting~

Note: on my system it places the search bar ontop of my startBar. Is this what you wanted? I just thought I'd let you know how it looks on my system.

Great job! I'm looking forward to more from it and I've thought of some wonderful applications of this. Thanks

A decision is a powerful thing
Link to comment
Share on other sites

haha, that's pretty much what I was going to test :whistle: What part are you fuzzy on? Not for sure it will work, but that's where I was thinking of starting.

Edit: screw it I'll try some stuff for a few mins :) haha

Edited by JohnBailey
A decision is a powerful thing
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...