Guest Posted February 23, 2013 Share Posted February 23, 2013 (edited) Hello. i worte some good script with amazing idea for myself and all of it do the job Perfectly. but it is is required that this specific job will not execute whan i for example playing movie or listen to music. so i have to do a condition that checks if i am not do such things. i know that i can program that it will look in to ini file ot txt file which contains a list of programs that when they runing so the job will not execute but i wondering if there is a better way that the script will know alone when to do the job and when not. thanks for the helpers! Edited February 23, 2013 by Guest Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 23, 2013 Moderators Share Posted February 23, 2013 gil900, I seem to remember that the last time this was asked the solution was to look at the size of the active window and compare it to the screen size - something like this: $aWin_Pos = WinGetPos("[ACTIVE]") If $aWin_Pos[3] = @DesktopWidth And $aWin_Pos[3] = @DesktopHeight Then MsgBox(0, "Result", "FullScreen") Else MsgBox(0, "Result", "Windowed") EndIf M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Guest Posted February 23, 2013 Share Posted February 23, 2013 (edited) gil900, I seem to remember that the last time this was asked the solution was to look at the size of the active window and compare it to the screen size - something like this: $aWin_Pos = WinGetPos("[ACTIVE]") If $aWin_Pos[3] = @DesktopWidth And $aWin_Pos[3] = @DesktopHeight Then MsgBox(0, "Result", "FullScreen") Else MsgBox(0, "Result", "Windowed") EndIf M23 thanks, good idea or maybe not? if the active widow is firefox or some window? so its size will never can be the screen size.. it will really work? EDIT: OK my mistake. i got the idea and what about music or sound? how it can i recognize if there is sound from the computer? Edited February 23, 2013 by Guest Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 23, 2013 Moderators Share Posted February 23, 2013 gil900,You spoke of music or movies - which do run fullcreen - not browsers - which can be maximized. If you want to look to see if a window is maximized rather than actually fullscreen then you can just look for the maximized attribute like this:If BitAND(WinGetState("[ACTIVE]"), 32) Then MsgBox(0, "Result", "Maximized") Else MsgBox(0, "Result", "Not maximized") EndIfM23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Guest Posted February 23, 2013 Share Posted February 23, 2013 (edited) OK i got the idea about the fullscreen! thanks you! now i want to know if there is a way to recognize sound froum the Audio Device. because the case of sound cover all other cases when the job should not execute Edited February 23, 2013 by Guest Link to comment Share on other sites More sharing options...
Guest Posted February 23, 2013 Share Posted February 23, 2013 (edited) Update:i found here:a small program with something i need..so i changed the code to this:expandcollapse popup#include <BassEnc.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GuiComboBox.au3> Opt("GUIOnEventMode", 1) Global $device, $input, $EncHandle, $RecHandle, $Bitrate = 128, $KHZ = 44100, $levels, $levelL = 0, $levelR = 0, $temp, $EncState = False $bass_dll = DllOpen("BASS.dll") $bassenc_dll = DllOpen("BASSENC.dll") $basscb_dll = DllOpen("BASSCB.dll") ;_BASS_SetConfig($bass_dll, $BASS_CONFIG_REC_BUFFER, 1000) $device = _GetDevices() $test = _BASS_RecordInit($bass_dll, $device) $RecHandle = _BASS_RecordStart(44100, 2, 0, $BASS_EXT_RecordProc) $timer = TimerInit() While 1 Sleep(20) $peak = _BASS_ChannelGetLevel($bass_dll,$RecHandle) ToolTip( $peak) WEnd Func _GetDevices() Local $count = 0, $info, $name = "", $sdef = "", $idef = 0 While 1 $info = _BASS_RecordGetDeviceInfo($bass_dll, $count) If @error Then ExitLoop $count += 1 If BitAND($info[2], $BASS_DEVICE_ENABLED) Then $name &= $info[0] & "|" If BitAND($info[2], $BASS_DEVICE_DEFAULT) Then $sdef = $info[0] $idef = $count EndIf WEnd Return $idef - 1 EndFunc Func _Exit() If _BASS_Encode_IsActive($bass_dll, $bassenc_dll, $EncHandle) Then _BASS_Encode_Stop($bass_dll, $bassenc_dll, $EncHandle) _BASS_RecordFree($bass_dll) Exit EndFuncthe only thing that i need is the $peak variable.i still didn't ccleened the code perfectly but i will do this aftar i will get what i want..the only problam is that the $peak variable give the number of the sound that out frome the microphone and not from the Speakers.i just need that it will give it from the Speakers...how to do this? Edited February 23, 2013 by Guest Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 23, 2013 Moderators Share Posted February 23, 2013 gil900, I suggest you start a new thread - no-one is going to read this far down to find a new question and I have no idea. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Guest Posted February 24, 2013 Share Posted February 24, 2013 (edited) gil900, I seem to remember that the last time this was asked the solution was to look at the size of the active window and compare it to the screen size - something like this: $aWin_Pos = WinGetPos("[ACTIVE]") If $aWin_Pos[3] = @DesktopWidth And $aWin_Pos[3] = @DesktopHeight Then MsgBox(0, "Result", "FullScreen") Else MsgBox(0, "Result", "Windowed") EndIf M23 I checked it now. It does not work on anything .. I tried XBMC, VLC and Firefox. It does not recognize the full screen. This is what I tried (I did a minor change to test it) While 1 Sleep(200) $aWin_Pos = WinGetPos("[ACTIVE]") If $aWin_Pos[3] = @DesktopWidth And $aWin_Pos[3] = @DesktopHeight Then ToolTip("FullScreen") Else ToolTip("Windowed") EndIf WEnd Edited February 24, 2013 by Guest Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 24, 2013 Moderators Share Posted February 24, 2013 gil900, Are you maximizing these windows using the button at top right so that the title bar is still visible - or are you actually going "full screen" so nothing else is visible (as you can with a DVD player)? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Guest Posted February 24, 2013 Share Posted February 24, 2013 gil900,Are you maximizing these windows using the button at top right so that the title bar is still visible - or are you actually going "full screen" so nothing else is visible (as you can with a DVD player)? M23i actually going "full screen" so nothing else is visible Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 24, 2013 Moderators Share Posted February 24, 2013 gil900, Well, the 2 snippets I posted above work for me when I run maximized or fullscreen apps, so I have no idea why they do not for you - sorry. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Guest Posted February 24, 2013 Share Posted February 24, 2013 Maybe the tooltip is like a window.. i will test it with ConsoleWrite() Link to comment Share on other sites More sharing options...
Guest Posted February 24, 2013 Share Posted February 24, 2013 ok it is not the tooltip. it just not working.. Thanks anyway Someone else can help me? Link to comment Share on other sites More sharing options...
Guest Posted February 24, 2013 Share Posted February 24, 2013 (edited) Update:i found your mistake in the code and i have fixed it. the red color is the mistake after i fixed it.it was before 3but it need one more change about when no window is activeWhile 1Sleep(250)$aWin_Pos = WinGetPos("[ACTIVE]")If $aWin_Pos[2] = @DesktopWidth And $aWin_Pos[3] = @DesktopHeight ThenToolTip("FullScreen")ElseToolTip("Windowed")EndIfWEndEDITand Shorter way to write this is this:IF $aWin_Pos[2]&$aWin_Pos[3] = @DesktopWidth&@DesktopHeight Then Edited February 24, 2013 by Guest Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted February 24, 2013 Moderators Share Posted February 24, 2013 gill900, Well spotted - that is what comes of typing too fast! M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Guest Posted February 24, 2013 Share Posted February 24, 2013 (edited) gill900, Well spotted - that is what comes of typing too fast! M23 It's okay .. We all make mistakes sometimes. I added something necessary the code: While 1 Sleep(250) $aWin_Pos = WinGetPos("[ACTIVE]") If $aWin_Pos[2]&$aWin_Pos[3] = @DesktopWidth&@DesktopHeight And WinGetTitle("[ACTIVE]") <> "Program Manager" Then ToolTip("FullScreen") Else ToolTip("NO FullScreen") EndIf WEnd Edited February 24, 2013 by Guest Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now