olympus
Active Members-
Posts
38 -
Joined
-
Last visited
olympus's Achievements
Seeker (1/7)
0
Reputation
-
Both method works! The difference: With the /k parameter, the window is closed by pressing by 'X' button. With the 'Pause' added, any key can be pressed to close the window. Thank you Xeno and water!
-
Thank you! I'll try both suggestion. Didn't know the /c parameter meant 'close' haha.
-
How do I pause a command prompt window that is generated using @ComSpec after it has finished executing the DOS command? For example: Run(@ComSpec " /c regedit.exe") After opening the RegEdit window, the black CMD window will automatically close. How do I make it pause? Thank you!
-
Incompatible 16 bit Application
olympus replied to olympus's topic in AutoIt General Help and Support
Oops, I don't think the error has anything to do with AutoIt, it's the installer that I'm using, Inno Setup. Probably some part in the setup script I left out. Thank you. -
When I compile a script and run it on Windows 7 x64 I get the error message 'Incompatible 16 bit Application'... Any ideas why?
-
[SOLVED]Sliding Notification Not Working in XP Classic
olympus replied to olympus's topic in AutoIt General Help and Support
Ah I see. Thank you for your help! -
[SOLVED]Sliding Notification Not Working in XP Classic
olympus replied to olympus's topic in AutoIt General Help and Support
It worked! Thank you, thank you, thank you! Can you explain a bit more about the solution you gave? It's like magic... -
[SOLVED]Sliding Notification Not Working in XP Classic
olympus replied to olympus's topic in AutoIt General Help and Support
Any help here please...? I've tried this but toast did not appear in either themes: #include <StaticConstants.au3> #include <WindowsConstants.au3> ; hotkey pause function HotKeySet("!p", "pause") Global $Paused ;Default is unpaused (0=off 1=on) Global $Paused = 0 ; Default is unpaused (0=off 1=on) Local $GUIToaster, $text1 = "the" Local $GUIToaster, $text2 = "slider" Local $Pos, $i While 1 Sleep(50) WEnd ; hotkey pause function Func pause() Opt("WinTitleMatchMode", 4) $Paused = Not $Paused ;changes $Paused from 0 to 1 or from 1 to 0 If $Paused And Not WinExists("slider", "") Then _HorzToaster(100,40) While $Paused ; while $Paused = 1 Sleep(10); idle around (pause) WEnd _TrayPopup_SlideOut($GUIToaster) GUIDelete($GUIToaster) EndIf EndFunc ;==>TogglePause Func _HorzToaster($nWidth, $nHeight, $nOffset = 4) Opt("WinTitleMatchMode", 4) Local $aPos = WinGetPos("[class:Shell_TrayWnd]"), $y, $x Switch _TaskBarGetSide() Case "Bottom" $y = $aPos[1] - $nHeight - $nOffset $x = @DesktopWidth - $nWidth - $nOffset Case "Left" $y = @DesktopHeight - $nHeight - $nOffset $x = $aPos[2] + $nOffset Case "Top" $y = $aPos[3] + $nOffset $x = @DesktopWidth - $nWidth - $nOffset Case "Right" $y = @DesktopHeight - $nHeight - $nOffset $x = $aPos[0] - $nWidth - $nOffset EndSwitch ConsoleWrite($x & ", " & $y & @CRLF & _TaskBarGetSide() & @CRLF) $GUIToaster = GUICreate("slider", $nWidth, $nHeight, $x, $y, _ $WS_POPUP, BitOR($WS_EX_TRANSPARENT, $WS_EX_LAYERED, $WS_EX_TOPMOST, $WS_EX_TOOLWINDOW)) GUISetBkColor(0xFFFFFF, $GUIToaster) $label1 = GUICtrlCreateLabel($text1, 0, 0, 100, 15, $SS_CENTER) GUICtrlSetFont(-1, 11, 800, 1, "Arial") GUICtrlSetColor($label1, 0x000000) $label2 = GUICtrlCreateLabel($text2, 0, 17, 100, 30, $SS_CENTER) GUICtrlSetFont(-1, 11, 800, 1, "Arial") GUICtrlSetColor($label2, 0x000000) WinSetTrans($GUIToaster, "", 0) Sleep(20) GUISetState(@SW_SHOW, $GUIToaster) _TrayPopup_SlideIn($GUIToaster) EndFunc ;==>_HorzToaster Func _TaskBarGetSide() Local $aPos = WinGetPos("[class:Shell_TrayWnd]") If $aPos[0] < 10 Then If $aPos[2] > 200 Then Return "Bottom" Return "Right" EndIf If $aPos[3] > 200 Then Return "Left" Return "Top" EndFunc ;==>_TaskBarGetSide ; Gary Frost's WinAnimate function ; 0x00040001 ; slide in from left ; 0x00050002 ; slide out to left ; 0x00040002 ; slide in from right ; 0x00050001 ; slide out to right ; 0x00040004 ; slide-in from top ; 0x00050008 ; slide-out to top ; 0x00040008 ; slide-in from bottom ; 0x00050004 ; slide-out to bottom Func _TrayPopup_SlideIn($GUIToaster, $i_duration = 1000) Local $i_mode Switch _TaskBarGetSide() Case "Bottom" $i_mode = 0x00040008 Case "Left" $i_mode = 0x00040001 Case "Top" $i_mode = 0x00040004 Case "Right" $i_mode = 0x00040002 EndSwitch If @OSVersion = "WIN_XP" Or @OSVersion = "WIN_2000" Or @OSVersion = "WIN_VISTA" Then DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $GUIToaster, "int", $i_duration, "long", $i_mode) Local $ai_gle = DllCall('kernel32.dll', 'int', 'GetLastError') If $ai_gle[0] <> 0 Then Return SetError(1, 0, 0) EndIf Return 1 Else Return SetError(2, 0, 0) EndIf EndFunc ;==>_TrayPopup_SlideIn Func _TrayPopup_SlideOut($GUIToaster, $i_duration = 1000) Local $i_mode Switch _TaskBarGetSide() Case "Bottom" $i_mode = 0x00050004 Case "Left" $i_mode = 0x00050002 Case "Top" $i_mode = 0x00050008 Case "Right" $i_mode = 0x00050001 EndSwitch If @OSVersion = "WIN_XP" Or @OSVersion = "WIN_2000" Or @OSVersion = "WIN_VISTA" Then DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $GUIToaster, "int", $i_duration, "long", $i_mode) Local $ai_gle = DllCall('kernel32.dll', 'int', 'GetLastError') If $ai_gle[0] <> 0 Then Return SetError(1, 0, 0) EndIf Return 1 Else Return SetError(2, 0, 0) EndIf EndFunc ;==>_TrayPopup_SlideOut I just can't figure out what's wrong. Any help is appreciated. Thank you. -
I'm using this code: #include <StaticConstants.au3> #include <WindowsConstants.au3> ; hotkey pause function HotKeySet("!p", "pause") Global $Paused ;Default is unpaused (0=off 1=on) Global $Paused = 0 ; Default is unpaused (0=off 1=on) Local $GUIToaster, $text1 = "the" Local $GUIToaster, $text2 = "slider" Local $Pos, $i While 1 Sleep(50) WEnd ; hotkey pause function Func pause() Opt("WinTitleMatchMode", 4) $Paused = Not $Paused ;changes $Paused from 0 to 1 or from 1 to 0 If $Paused And Not WinExists("slider", "") Then _HorzToaster() While $Paused ; while $Paused = 1 Sleep(10); idle around (pause) WEnd For $i = 100 To 1 Step -1 WinSetTrans($GUIToaster, "", $i * 1.5) WinMove("slider", "", $Pos[2] - $i, $Pos[3] - 30) Sleep(0) ; fast slide-out to right Next GUIDelete($GUIToaster) EndIf EndFunc ;==>TogglePause Func _HorzToaster() ; incorporating code from Danny35d Opt("WinTitleMatchMode", 4) $Pos = WinGetPos("classname=Shell_TrayWnd") If $Pos[2] <> @DesktopWidth Then $Pos[2] = @DesktopWidth - $Pos[2] If $Pos[3] <> @DesktopHeight Then $Pos[3] = @DesktopHeight - ($Pos[3] + 11) Else $Pos[3] -= 32 EndIf $GUIToaster = GUICreate("slider", 100, 40, $Pos[2] - 100, $Pos[3], _ $WS_POPUP, BitOR($WS_EX_TRANSPARENT, $WS_EX_LAYERED, $WS_EX_TOPMOST, $WS_EX_TOOLWINDOW)) GUISetBkColor(0xFFFFFF, $GUIToaster) $label1 = GUICtrlCreateLabel($text1, 0, 0, 100, 15, $SS_CENTER) GUICtrlSetFont(-1, 11, 800, 1, "Arial") GUICtrlSetColor($label1, 0x000000) $label2 = GUICtrlCreateLabel($text2, 0, 17, 100, 30, $SS_CENTER) GUICtrlSetFont(-1, 11, 800, 1, "Arial") GUICtrlSetColor($label2, 0x000000) WinSetTrans($GUIToaster, "", 0) Sleep(20) GUISetState(@SW_SHOW, $GUIToaster) For $i = 1 To 100 WinSetTrans($GUIToaster, "", 1.5 * $i) WinMove("slider", "", $Pos[2] - $i, $Pos[3] - 30) Sleep(0) ; fast slide-in from right Next EndFunc ;==>_HorzToaster It works great on the default theme of Windows XP whereby when you press 'Alt+p', a notification slides-in above the system tray(clock). But on the Classic theme, I can only see a quick flash on the left bottom side of my screen. Turns out that the WinGetPos("classname=Shell_TrayWnd") doesn't return the same value and it depends on the theme used. Can anyone suggest a more reliable method? Thank you!
-
Sliding Notification Not Working in XP Classic
olympus posted a topic in AutoIt GUI Help and Support
I'm using this code: #include <StaticConstants.au3> #include <WindowsConstants.au3> ; hotkey pause function HotKeySet("!p", "pause") Global $Paused ;Default is unpaused (0=off 1=on) Global $Paused = 0 ; Default is unpaused (0=off 1=on) Local $GUIToaster, $text1 = "the" Local $GUIToaster, $text2 = "slider" Local $Pos, $i While 1 Sleep(50) WEnd ; hotkey pause function Func pause() Opt("WinTitleMatchMode", 4) $Paused = Not $Paused ;changes $Paused from 0 to 1 or from 1 to 0 If $Paused And Not WinExists("slider", "") Then _HorzToaster() While $Paused ; while $Paused = 1 Sleep(10); idle around (pause) WEnd For $i = 100 To 1 Step -1 WinSetTrans($GUIToaster, "", $i * 1.5) WinMove("slider", "", $Pos[2] - $i, $Pos[3] - 30) Sleep(0) ; fast slide-out to right Next GUIDelete($GUIToaster) EndIf EndFunc ;==>TogglePause Func _HorzToaster() ; incorporating code from Danny35d Opt("WinTitleMatchMode", 4) $Pos = WinGetPos("classname=Shell_TrayWnd") If $Pos[2] <> @DesktopWidth Then $Pos[2] = @DesktopWidth - $Pos[2] If $Pos[3] <> @DesktopHeight Then $Pos[3] = @DesktopHeight - ($Pos[3] + 11) Else $Pos[3] -= 32 EndIf $GUIToaster = GUICreate("slider", 100, 40, $Pos[2] - 100, $Pos[3], _ $WS_POPUP, BitOR($WS_EX_TRANSPARENT, $WS_EX_LAYERED, $WS_EX_TOPMOST, $WS_EX_TOOLWINDOW)) GUISetBkColor(0xFFFFFF, $GUIToaster) $label1 = GUICtrlCreateLabel($text1, 0, 0, 100, 15, $SS_CENTER) GUICtrlSetFont(-1, 11, 800, 1, "Arial") GUICtrlSetColor($label1, 0x000000) $label2 = GUICtrlCreateLabel($text2, 0, 17, 100, 30, $SS_CENTER) GUICtrlSetFont(-1, 11, 800, 1, "Arial") GUICtrlSetColor($label2, 0x000000) WinSetTrans($GUIToaster, "", 0) Sleep(20) GUISetState(@SW_SHOW, $GUIToaster) For $i = 1 To 100 WinSetTrans($GUIToaster, "", 1.5 * $i) WinMove("slider", "", $Pos[2] - $i, $Pos[3] - 30) Sleep(0) ; fast slide-in from right Next EndFunc ;==>_HorzToaster It works great on the default theme of Windows XP whereby when you press 'Alt+p', a notification slides-in above the system tray(clock). But on the Classic theme, I can only see a quick flash on the left bottom side of my screen. Can anyone help me see what the problem is? Thank you. -
Excellent! I wanted to start another thread on this too but discovered this. I always had problems with the $ES_READONLY style. The vertical scrolling bar was enabled even though the input data was shorter than the input space and it was impossible to move it. Similarly if the input data was longer than the input space, the scrolling bar was activated but I couldn't move it therefore preventing me from reading the hidden input data to the right. I was using $WS_VSCROLL, $ES_AUTOVSCROLL, $ES_MULTILINE, $ES_WANTRETURN, $ES_READONLY Maybe the styles I was using was overwriting one another(no BitOr maybe) but your script worked great! Thank you!
-
Background color works! Thank you!
-
When I use GuiCtrlCreateInput with $ES_READONLY, it turns the input box grey. Is there a way to stop it from changing colour?
-
Under the AutoIt3Wrapper there is this directive: #AutoIt3Wrapper_UseX64= The default is no, but should I put yes if I wish to use the script on 64 bit machine? If I do not, will the script still work alright?
-
Ahhh... it works when I add 2. I was always using 1. Was there a change in autoit? Before this I didn't encounter this problem? Thank you!