Jump to content

Help! Someone can convert this to Autoit!


Recommended Posts

Hi all, i'm a newbie and my name is Holly, nice to meet all :D

I'd like to put a gui over a game, it's not game automation, i need only a timer for remember me when to stop playing :D

Searching on the web, i have find only dll hoocking but today i have see a post can resolve my problem:

I created a timer window and set it as a child to the full screen window, then added a style so that the child wouldn't take focus over the parent.

You most likely need to set +WS_CHILD -WS_POPUP for the child window. For instance:

Gui, 1:+LastFound

hwnd1 := WinExist()

Gui, 2:+LastFound

Gui, 2:+0x40000000 -0x80000000 ; Add WS_CHILD, remove WS_POPUP

hwnd2 := WinExist()

DllCall("SetParent", "uint", hwnd2, "uint", hwnd1)

Gui, 2:Show, x0 y0 w200 h200, GUI 2

Gui, 1:Show, w400 h400, GUI 1

return

GuiClose:

ExitApp

If you uncomment the Gui, 2:+0x4... line, GUI 2 is set as the foreground window whenever you try to focus GUI 1. Pressing Alt+F4 closes GUI 2 (or does nothing if it's already closed), and pressing GUI 1's close button doesn't work. After adding WS_CHILD and removing WS_POPUP, AHK Window Info shows that GUI 1 is the foreground/active window, and GUI 2 is the focused control. MSDN wrote: For compatibility reasons, SetParent does not modify the WS_CHILD or WS_POPUP window styles of the window whose parent is being changed. Therefore, if hWndNewParent is NULL, you should also clear the WS_CHILD bit and set the WS_POPUP style after calling SetParent. Conversely, if hWndNewParent is not NULL and the window was previously a child of the desktop, you should clear the WS_POPUP style and set the WS_CHILD style before calling SetParent.

Example image:

http://i50.tinypic.com/mvp3tf.jpg

I'm searching for someone can convert the 11 lines of AutoHotKey into autoit language.

Pleeeeeeeeeeese :D

Holly

Link to comment
Share on other sites

I would go at it at a different approach. I would make a script that at a time, or after a set time it starts dinging at you just annoyingly enough to get you to exit the game to close it. Don't want to loose to uber boss just because a window popped up on you.

I have a clock/egg timer script at home, I might post it later.

Edited by DicatoroftheUSA
Link to comment
Share on other sites

We dont do personal requests

But did you ask yourself what will autoit help file do if you type in its search

WinExist, or gui, or DllCall or SetParent?

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 
Link to comment
Share on other sites

something like

$oShell = ObjCreate("SAPI.SpVoice") ; Get the Windows SAPI Object
$oShell.Speak("30 minutes of playing left.")

well it's more like annoying voice than a sound, but it will work :)

Edited by bogQ

TCP server and client - Learning about TCP servers and clients connection
Au3 oIrrlicht - Irrlicht project
Au3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related)



460px-Thief-4-temp-banner.jpg
There are those that believe that the perfect heist lies in the preparation.
Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost.

 
Link to comment
Share on other sites

  • Moderators

I am using that for every rule-breaking post from now on. :D

$oShell = ObjCreate("SAPI.SpVoice") ; Get the Windows SAPI Object
$oShell.Speak("I will not break the forum rules. I will not break the forum rules!")

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

@bogQ I think 30 minutes is a bit excessive. I don't understand AutoHotKey anyway.

Edit

Just sayin' what JohnOne said: there's plenty of people here who will help you, providing the code doesn't interact with a game in any way whatsoever.

Edited by czardas
Link to comment
Share on other sites

Interesting stuff.

In AutoIt there are these functions as alternatives for AHK ones:

WinGetHandle()
WinExists()
_WinAPI_SetParent()
_WinAPI_SetWindowLong() + $GWL_STYLE
WinSetState() + @SW_SHOW
WinMove()

So just look into helpfile at these functions and their examples ...

Edited by Zedna
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...