
W2lkm2n
Members-
Posts
17 -
Joined
-
Last visited
-
Days Won
1
W2lkm2n last won the day on May 1 2016
W2lkm2n had the most liked content!
Recent Profile Visitors
214 profile views
W2lkm2n's Achievements

Seeker (1/7)
4
Reputation
-
Norm73 reacted to a post in a topic: Disable or remove close, minimize, maximize buttons on any window in runtime !
-
meoit reacted to a post in a topic: Disable or remove close, minimize, maximize buttons on any window in runtime !
-
Xandy reacted to a post in a topic: Disable or remove close, minimize, maximize buttons on any window in runtime !
-
I know this is an old thread, but it solved my problem. I had the exact same problem as OP on Windows 8 64bit. When I run SciTE as Administrator, everything is ok, else, it doesn't run the script !
-
W2lkm2n reacted to a post in a topic: unable to run script in SCITE
-
Control Viewer - AutoIt Window Info Tool
W2lkm2n replied to Yashied's topic in AutoIt Example Scripts
Man, this is so good I can't believe it ! This should be the default version with a standard AutoIt install ! -
mesale0077 reacted to a post in a topic: Window floater
-
W2lkm2n reacted to a post in a topic: ISN AutoIt Studio [old thread]
-
I was stunned when I found this, and I would LOVE to use it, but I have a European keyboard with a special AltGr key which makes it impossible The problem with it is that this key has the same effect as pressing CTRL+ALT+{key}. To write brackets, parenthesis, etc, I need to press it. For example, when I want to write a bracket [, It sends the combo as CTRL+ALT+F, and it writes the bracket, but the Search/replace window also popping up because of the CTRL+F part of the combination... So my stupid keyboard layout makes it impossible to use this awesome IDE. Every key working good in Scite and any other program, so AltGr+F (=CTRL+ALT+F) is not triggering a search in scite, but CTRL+F do. Any chance you look into this ? I would appreciate it ! EDIT: I downloaded the source code and added a bunch of AND _IsPressed("12", $user32) = 0 to the lines 1233, 1242, 1243, 1245, 1251, but please consider adding it, because others might have the same problem. I know Greek, Swedish, and more European keyboards use AltGr too !
- 995 replies
-
- isn autoit studio
- isn
-
(and 3 more)
Tagged with:
-
W2lkm2n reacted to a post in a topic: ISN AutoIt Studio [old thread]
-
This will "float" windows defined in $WINDOWS array to the left edge of the screen like this: If you hover the mouse over the desired window's edge, it will float in, and you can use it. If you move the mouse out of the window area, it will float back. If you exit the script, the windows will restore their original positions. If the sum of the window heights would exceed the Desktop height, nothing will happen to the windows which wouldn't fit. You can resize, close and open windows, they will jump to the desired position, but you have to move the mose there in that case. #include <Constants.au3> #include <WinAPI.au3> #include <Misc.au3> _Singleton(@ScriptName) ; window titles here Const $WINDOWS[3] = ['[CLASS:CalcFrame]', '[CLASS:HH Parent]', '[CLASS:Notepad]'] Const $MARGIN = 20 OnAutoItExitRegister("RestoreWindows") Global $iWinCount, $aOriginalPositions[1] For $iWinCount = 0 To UBound($WINDOWS) - 1 ReDim $aOriginalPositions[$iWinCount + 1] $aOriginalPositions[$iWinCount] = WinGetPos($WINDOWS[$iWinCount]) Next While 1 For $sWindow In $WINDOWS MoveWindow($sWindow) Next Sleep(50) WEnd Func MoveWindow($sWinTitle) Local $iY = CalculateYPos($sWinTitle) If $iY > @DesktopHeight Then Return Local $hWnd = WinGetHandle($sWinTitle) If @error Then Return Local $aWinPos = WinGetPos($hWnd) If $aWinPos = 0 Then Return Local $aMousePos = MouseGetPos() If $aMousePos[0] <= $MARGIN And _ ($aMousePos[1] >= $iY And $aMousePos[1] <= ($iY + $aWinPos[3])) And _ $aWinPos[0] < 0 Then _WinAPI_SetWindowPos($hWnd, $HWND_TOP, 0, 0, 0, 0, BitOR($SWP_NOMOVE, $SWP_NOSIZE)) WinMove($hWnd, '', 0, $iY, $aWinPos[2], $aWinPos[3], 2) ElseIf ($aWinPos[0] >= 0) And ($aMousePos[0] > $aWinPos[2] + $MARGIN Or _ ($aMousePos[1] < $iY - $MARGIN Or $aMousePos[1] > ($iY + $aWinPos[3] + $MARGIN))) Then WinMove($hWnd, '', -$aWinPos[2] + 10, $iY, $aWinPos[2], $aWinPos[3], 2) EndIf EndFunc ;==>MoveWindow Func CalculateYPos($sWinTitle) Local $iY = 0, $aPos For $sWindow In $WINDOWS If $sWindow = $sWinTitle Then ExitLoop $aPos = WinGetPos($sWindow) If Not @error Then $iY = $iY + $aPos[3] Next Return $iY EndFunc ;==>CalculateYPos Func RestoreWindows() Local $i, $aPos For $i = 0 To UBound($WINDOWS) - 1 $aPos = $aOriginalPositions[$i] If WinExists($WINDOWS[$i]) Then WinMove($WINDOWS[$i], '', $aPos[0], $aPos[1]) Next EndFunc ;==>RestoreWindows Any advice appreciated!
-
Progress bar issue when embedded inside a status bar
W2lkm2n replied to MasterMind's topic in AutoIt GUI Help and Support
Two years later, this helped me not pulling my hair out after two days of trouble with this ! Thanks ! -
Ok, I didn't realized, there is a nice UDF for manipulating menus, so it's even easier: ; Original script: http://www.autoitscript.com/forum/topic/100125-disable-close-button/#entry716490 ; USer32.dll functions: http://msdn.microsoft.com/en-us/library/ms647985(v=vs.85).aspx #include <GuiMenu.au3> Run("Notepad") WinWait("Untitled - Notepad") $handle = WinGetHandle("Untitled - Notepad") ConsoleWrite('+ Window Handle: ' & $handle & @CRLF) DisableButton($handle, $SC_CLOSE) ;~ EnableButton($handle, $SC_CLOSE) DisableButton($handle, $SC_MAXIMIZE) DisableButton($handle, $SC_RESTORE) DisableButton($handle, $SC_MOVE) Func DisableButton($hWnd, $iButton) $hSysMenu = _GUICtrlMenu_GetSystemMenu($hWnd, 0) _GUICtrlMenu_RemoveMenu($hSysMenu, $iButton, False) _GUICtrlMenu_DrawMenuBar($hWnd) EndFunc Func EnableButton($hWnd, $iButton) $hSysMenu = _GUICtrlMenu_GetSystemMenu($hWnd, 1) _GUICtrlMenu_RemoveMenu($hSysMenu, $iButton, False) _GUICtrlMenu_DrawMenuBar($hWnd) EndFunc
-
However, there is a it took me several hours to figure out how to do it on other windows in runtime, so I tought it might help others. So you want to remove buttons like this: #include <WinAPI.au3> #include <Constants.au3> #include <WindowsConstants.au3> $h = WinGetHandle("Untitled - Note") $iOldStyle = _WinAPI_GetWindowLong($h, $GWL_STYLE) ConsoleWrite("+ old style: " &amp; $iOldStyle &amp; @CR) $iNewStyle = BitXOr($iOldStyle, $WS_MINIMIZEBOX, $WS_MAXIMIZEBOX) _WinAPI_SetWindowLong($h, $GWL_STYLE, $iNewStyle) _WinAPI_ShowWindow($h, @SW_SHOW) or remove even the close button: instead of $iNewStyle = BitXOr($iOldStyle, $WS_MINIMIZEBOX, $WS_MAXIMIZEBOX)use $iNewStyle = BitXOr($iOldStyle, $WS_SYSMENU) The cool part about these is that you can still close the window with ALT+F4 or minimize it clicking the tray icon. The trickiest part caused me the biggest headache that if you just set the window style with a SetWindowLong() API call, but don't run _WinAPI_ShowWindow($h, @SW_SHOW) the following can happen. To show up properly after the style change, I tried redrawing the window, redrawing everything, sending WM_PAINT message to the Window, calling SetWindowLong() with different handles and options, nothing worked, until I found this comment. So it is very important to run it after setting the style. You can find more about Window styles on MSDN or Autoit help Now, what if you want only disable the buttons, but don't want to remove them ? Like this: (The close button is "greyed" out, the other two are still visible. but if you click them, nothing happens.) The following forum topic solution is very good: You can disable any of you want with these functions: ; Constants from http://msdn.microsoft.com/en-us/library/windows/desktop/ms646360(v=vs.85).aspx Const $SC_CLOSE = 0xF060 Const $SC_MOVE = 0xF010 Const $SC_MAXIMIZE = 0xF030 Const $SC_MINIMIZE = 0xF020 Const $SC_SIZE = 0xF000 Const $SC_RESTORE = 0xF120 Func GetMenuHandle($hWindow, $bRevert = False) If $bRevert = False Then $iRevert = 0 Else $iRevert = 1 EndIf $aSysMenu = DllCall("User32.dll", "hwnd", "GetSystemMenu", "hwnd", $hWindow, "int", $iRevert) ConsoleWrite("+ Menu Handle: " &amp; $aSysMenu[0] &amp; @CRLF) Return $aSysMenu[0] EndFunc Func DisableButton($hWindow, $iButton) $hSysMenu = GetMenuHandle($hWindow) DllCall("User32.dll", "int", "RemoveMenu", "hwnd", $hSysMenu, "int", $iButton , "int", 0) DllCall("User32.dll", "int", "DrawMenuBar", "hwnd", $hWindow) EndFunc Func EnableButton($hWindow, $iButton) $hSysMenu = GetMenuHandle($hWindow, True) DllCall("User32.dll", "int", "RemoveMenu", "hwnd", $hSysMenu, "int", $iButton , "int", 0) DllCall("User32.dll", "int", "DrawMenuBar", "hwnd", $hWindow) EndFunc by calling the functions like this: DisableButton($handle, $SC_CLOSE) DisableButton($handle, $SC_MAXIMIZE) DisableButton($handle, $SC_RESTORE) DisableButton($handle, $SC_MINIMIZE)Same with EnableButton(). If you disable $SC_SIZE, the window will not be resizeable with the mouse. If you disable SC_MOVE, you also cannot move it. Note: everything was tested on Windows 7 with Aero theme. On other system you might not have the same problem (window becoming a ghost after style update). If you test it on other system, please make a feedback about it ! Hope this helps somebody !
-
Beautiful solution, thank you !
-
I want to run a "utility" script which performs small tasks, like closing specific windows if they appear, short urls with hotkey, resize window if some specific thing happens, set volume to a specific level if media player start, etc. What is the best (I mean fastest-running, least memory-consuming) way to run it all the time ? If I do While 1 Sleep(100) WEnd won't it slow down my computer ? What about memory ? I tought I do it like this: a bunch of AdlibRegister() and HotkeySet() If I need a new functionality, I just add one more and that's it. Is there a better way ? Also what is the best way if I edit and save, the script reload itself (or at least one click solution). Also, I would like to see all the ConsoleWrite() output. How can I see it without running Scite ?
-
Of course I can close it, but the whole window still pops up from the tray from minimized which is the most annoying part of it I want to manipulate PokerStars This happens on "Tournament Register". Thanks, I can do basic things, but I need an advanced way here to prevent popping up the parent window from minimized state, as I mentioned in OP.
-
I have a program that when I use a specific functionality, it makes a message box containing one "Ok" button to let me now the action went succesful. This is very annoying, I would like to prevent these message boxes. I tought WinEvents might do that, but as I understand those are just notifications when the event occurs (for ex. EVENT_SYSTEM_DIALOGSTART). What is even more annoying in this software, that the parent window pops up from minimized state, so I can't automate it while it's minimized on the tray... Is there any way to prevent those messages boxes to pop up ?
-
Cannot send POST request with WinHttp functions
W2lkm2n replied to W2lkm2n's topic in AutoIt General Help and Support
Man, I can't believe I pulled my hair out because of this typo ! THANK YOU SO MUCH -
Cannot send POST request with WinHttp functions
W2lkm2n replied to W2lkm2n's topic in AutoIt General Help and Support
I had exactly the same two functions on the server, and I got only the headers back, no BODY at all, when I tried to send my request in OP. However your solution works like a charm, thank you very much !!! I will use this and now I can sleep However I would like to understand what was the problem with my code if you would be kind enough to help me. So I made the changes what ProgAndy suggested, and still got nothing back from body... Now it looks like this and still no good: #include "WinHttp.au3" Opt("MustDeclareVars", 1) ; Initialize and get session handle Global $hOpen = _WinHttpOpen() ; Get connection handle Global $hConnect = _WinHttpConnect($hOpen, "dev.walkman.pk") ; Specify the reguest Global $hRequest = _WinHttpOpenRequest($hConnect, "POST", "HHupload/index.php") ;~ -------------------------------------------------------- Global $sFileName = "Walk_teszt.txt" Global $sFullFile = @DesktopDir & "" & $sFileName Global $sBoundary = "------WALKMANlaksdjf" Global $sS $sS = @CRLF & "--" & $sBoundary & @CRLF $sS &= 'Content-Dispositon: form-data; name="file"; filename="' & $sFileName & '"' & @CRLF $sS &= "Content-Type: text/plain" & @CRLF & @CRLF & FileRead($sFullFile) & @CRLF $sS &= "--" & $sBoundary & "--" & @CRLF ; Send request Global $hSendRequest = _WinHttpSendRequest($hRequest, "Content-Type: multipart/form-data; boundary=" & $sBoundary & @CRLF, $sS, StringLen($sS)) ; Wait for the response _WinHttpReceiveResponse($hRequest) ; Check if there is data available... If _WinHttpQueryDataAvailable($hRequest) Then MsgBox(64, "OK ?", _WinHttpReadData($hRequest)) Else MsgBox(48, "Error", "Site is experiencing problems (or you).") EndIf ; Close handles _WinHttpCloseHandle($hRequest) _WinHttpCloseHandle($hConnect) _WinHttpCloseHandle($hOpen) Also, if the REQUEST body is not well formatted, I have no idea how to debug... because PHP won't have $_FILES set and 'php://input' wrapper doesn't work on multipart/form-data forms. Any idea ? Thanks anyway if you don't care anymore -
Cannot send POST request with WinHttp functions
W2lkm2n replied to W2lkm2n's topic in AutoIt General Help and Support
The API wasn't changed but I always get the same errorcode (api key not found). It might because Autoit doesn't send POST data right.Would somebody confirm that script is working without error ? I suspect that something is wrong with my Windows or I found a bug or something...